A comprehensive MCP (Model Context Protocol) server for Statamic CMS that provides AI assistants with structured access to Statamic's content management capabilities through a clean, organized tool architecture.
[!WARNING] π§ Alpha Software - Expect Bugs!
This MCP server is currently in alpha stage. With over 100+ tools available, many of which were AI-generated, comprehensive testing is an ongoing process that takes time.
What to expect:
- π Bugs and errors - This is alpha software, things will break
- π€ AI-generated tools - Some tools were created with AI assistance and may have edge cases
- π§ Ongoing improvements - We're actively testing and refining all tools
- π Rapid iteration - Frequent updates as we discover and fix issues
How you can help:
- π§ͺ Test the tools in your Statamic projects
- π Report bugs by creating issues
- π― Submit PRs with fixes and improvements
- π¬ Share feedback on what works and what doesn't
Your testing and contributions help make this tool better for everyone! π
π Requirements
- PHP 8.2+
- Laravel 11+
- Statamic 5.0+
π Installation
# Install via Composercomposer require cboxdk/statamic-mcp # Run the installation command to set up MCPphp artisan mcp:statamic:install # The addon automatically registers with Laravel's MCP server
π― Recommended: Laravel Boost Integration
We strongly recommend installing Laravel Boost alongside this Statamic MCP server for the best development experience:
composer require laravel/boost --dev
Why use both?
- Laravel Boost and Statamic MCP Server run in parallel, complementing each other perfectly
- Laravel Boost provides Laravel-specific tools (Eloquent, database, debugging, Artisan commands)
- Statamic MCP Server provides Statamic-specific tools (blueprints, collections, entries, assets)
- Together, they give you complete AI-assisted development capabilities for your Statamic/Laravel application
With both installed, your AI assistant can:
- Use Laravel Boost for database queries, debugging, and Laravel framework operations
- Use Statamic MCP for content management, blueprint operations, and Statamic-specific tasks
- Seamlessly work across both the Laravel framework and Statamic CMS layers
β¨ Features
The MCP server provides 100+ tools organized into logical categories that mirror Statamic's architecture:
π Blueprint Tools
Purpose: Manage blueprint definitions and schema
statamic.blueprints.list
- List blueprints with optional details and filteringstatamic.blueprints.get
- Get specific blueprint with full field definitionsstatamic.blueprints.create
- Create new blueprints from field definitionsstatamic.blueprints.update
- Update existing blueprint fields and configurationstatamic.blueprints.delete
- Delete blueprints with safety checksstatamic.blueprints.scan
- Blueprint scanning with performance optimizationstatamic.blueprints.generate
- Generate blueprints from templates and field definitionsstatamic.blueprints.types
- Blueprint type analysis and TypeScript/PHP type generation
π Collection Tools
Purpose: Manage collection structures and configuration
statamic.collections.list
- List all collections with configuration detailsstatamic.collections.get
- Get specific collection with full configurationstatamic.collections.create
- Create new collections with blueprint associationsstatamic.collections.update
- Update collection settings and structurestatamic.collections.delete
- Delete collections with safety checks
π Taxonomy Tools
Purpose: Manage taxonomies and their terms
statamic.taxonomies.list
- List all taxonomies with filtering and metadatastatamic.taxonomies.get
- Get specific taxonomy with detailed informationstatamic.taxonomies.create
- Create new taxonomies with configurationstatamic.taxonomies.update
- Update taxonomy settings and associationsstatamic.taxonomies.delete
- Delete taxonomies with safety checksstatamic.taxonomies.analyze
- Analyze taxonomy usage and term relationshipsstatamic.taxonomies.terms
- List and manage terms within taxonomies
ποΈ Structure Tools
Purpose: Manage structural configurations and scanning
statamic.structures.fieldsets.scan
- Fieldset analysis and parsingstatamic.structures.fieldsets
- Fieldset configuration managementstatamic.structures.navigations
- Navigation structure managementstatamic.structures.forms
- Form configuration managementstatamic.structures.globals
- Global set configuration managementstatamic.structures.assets
- Asset container configurationstatamic.structures.groups
- User group structure managementstatamic.structures.permissions
- Permission structure analysis
π Entry Tools
Purpose: Manage entries across all collections
statamic.entries.list
- List entries with filtering, search, and paginationstatamic.entries.get
- Get specific entry with full data and relationshipsstatamic.entries.create
- Create new entries with validation and blueprint compliancestatamic.entries.update
- Update existing entries with merge options and validationstatamic.entries.delete
- Delete entries with safety checks and relationship validationstatamic.entries.publish
- Publish draft entries with validationstatamic.entries.unpublish
- Unpublish entries with safety checks
π·οΈ Term Tools
Purpose: Manage taxonomy terms across all taxonomies
statamic.terms.list
- List terms with filtering, search, and paginationstatamic.terms.get
- Get specific term with full data and related entriesstatamic.terms.create
- Create new terms with validation and slug conflict checkingstatamic.terms.update
- Update existing terms with merge options and validationstatamic.terms.delete
- Delete terms with safety checks and dependency validation
π Global Tools
Purpose: Manage global set values
statamic.globals.list
- List all global sets with metadatastatamic.globals.get
- Get specific global set with full datastatamic.globals.update
- Update global set values with validation
π§ Navigation Tools
Purpose: Manage navigation structures
statamic.navigation.list
- List navigation trees with full structure
π Sites Management Tools
Purpose: Multi-site Statamic configuration and management
statamic.sites.list
- List all configured sites with settings and statusstatamic.sites.create
- Create new site configurations with validationstatamic.sites.update
- Update existing site configurations with backup optionsstatamic.sites.delete
- Delete sites with content analysis and cleanup optionsstatamic.sites.switch
- Switch default site with impact analysisstatamic.sites.analyze
- Analyze site configuration and detect potential issues
π₯ User Management Tools
Purpose: Comprehensive user management with RBAC support
statamic.users.list
- List users with filtering, roles, and metadatastatamic.users.get
- Get specific user with detailed role and permission informationstatamic.users.create
- Create new users with role assignment and validationstatamic.users.update
- Update users with granular role managementstatamic.users.delete
- Delete users with content reassignment optionsstatamic.users.analyze
- Analyze user activity and permission usage patterns
π Role & Permission Tools
Purpose: Role-based access control and security management
statamic.roles.list
- List all roles with permissions and user countsstatamic.roles.get
- Get specific role with detailed permission analysisstatamic.roles.create
- Create new roles with permission validationstatamic.roles.update
- Update roles with impact analysis on affected usersstatamic.roles.delete
- Delete roles with user impact assessmentstatamic.permissions.list
- List all available permissions with descriptionsstatamic.permissions.analyze
- Analyze permission usage and security implications
ποΈ Other Content Tools
Purpose: Additional content management capabilities
statamic.content.assets
- Asset CRUD operations (coming soon)statamic.content.submissions
- Form submission management (coming soon)
π·οΈ Tag Tools
Purpose: Manage Statamic tags for both Antlers and Blade
statamic.tags.list
- Tag discovery, creation, and management for both Antlers and Blade
π§ Modifier Tools
Purpose: Manage template modifiers
statamic.modifiers.list
- Modifier discovery, creation, and usage examples
ποΈ Field Type Tools
Purpose: Manage custom field types
statamic.fieldtypes.list
- Field type discovery, creation, and configuration options
π Scope Tools
Purpose: Manage query scopes
statamic.scopes.list
- Query scope discovery and creation
ποΈ Filter Tools
Purpose: Manage collection filters
statamic.filters.list
- Filter discovery and creation
β Blueprint Validation Tools
Purpose: Blueprint integrity and field validation
statamic.blueprints.validate
- Validate blueprint structure and field configurationstatamic.blueprints.dependencies
- Analyze field dependencies and conditional logicstatamic.blueprints.conflicts
- Detect cross-blueprint field conflicts and naming issues
βοΈ Development Tools
Purpose: Enhanced developer experience and tooling
statamic.development.templates
- Template hints, validation, and optimization for Antlers/Bladestatamic.development.addons
- Addon development, analysis, and scaffoldingstatamic.development.addon.discovery
- Addon discovery and recommendationsstatamic.development.types
- TypeScript/PHP type generation from blueprintsstatamic.development.console
- Artisan command execution and managementstatamic.development.antlers.validate
- Antlers template validation and syntax checkingstatamic.development.blade.hints
- Blade template hints and suggestionsstatamic.development.blade.lint
- Blade template linting and best practicesstatamic.development.widgets
- Widget development and managementstatamic.development.performance.analyze
- Comprehensive template performance analysis with N+1 detectionstatamic.development.templates.unused
- Detect unused templates, partials, and layoutsstatamic.development.templates.variables
- Extract variables from templates with type analysisstatamic.development.templates.optimize
- Suggest specific template optimizations with examples
π§ System Tools
Purpose: System management and operations
statamic.system.info
- Comprehensive system analysis and health checksstatamic.system.cache
- Advanced cache management with selective clearing and warmingstatamic.system.docs
- Statamic documentation search with AI relevance scoringstatamic.system.license
- License management (solo/pro, addon licensing, key configuration)statamic.system.preferences
- Multi-level preferences management (global/role/user)statamic.system.stache
- Advanced Stache cache operations (clear/warm/analyze/optimize)statamic.system.search.index
- Search index performance analysis and optimizationstatamic.system.discover
- Dynamically discover all available MCP tools with examplesstatamic.system.schema
- Get detailed schema information for specific toolsstatamic.system.health
- Comprehensive system health check with security analysisstatamic.system.monitor
- Performance analysis with sample operations and bottleneck detection
ποΈ Architecture & Design
Clean MCP Tool Architecture
The addon follows a single-purpose tool pattern where each tool performs exactly ONE action:
- No action conditionals: Each tool has a focused responsibility
- Predictable schemas: Clear input/output contracts
- Better performance: Reduced token overhead for AI assistants
- Easier testing: Isolated, testable components
Security & Reliability
- Path traversal protection: All file operations validated against allowed directories
- Input sanitization: Sensitive data redacted from logs
- Structured error handling: Standardized error codes and responses
- Type safety: PHPStan Level 8 compliance with strict typing
Developer-Focused Design
- Local development first: Optimized for development workflows
- Smart caching: Expensive operations cached with dependency tracking
- Comprehensive logging: Structured logs with correlation IDs for debugging
- No unnecessary complexity: No rate limiting or emergency logging in dev tools
π― New Features & Performance
β‘ Automatic Cache Purging
All structural and content changes automatically clear relevant caches:
- Blueprint/fieldset changes: Clears stache, static, views
- Content operations: Clears stache, static caches
- Structure changes: Comprehensive cache clearing
- Transparent reporting: All responses include cache status
π Performance Optimizations
- Pagination support: Use
limit
andfilter
parameters for large datasets - Field filtering:
include_fields: false
for blueprint scanning performance - Response limits: Automatic limits to prevent token overflow (< 25,000 tokens)
- Smart defaults: Optimized for AI assistant token limits
- Smart caching: Discovery operations cached with file modification tracking
π€ AI Assistant Setup
# Run the installation command to set up MCPphp artisan mcp:statamic:install
See docs/AI_ASSISTANT_SETUP.md for more details or manual setup.
π‘ Example Usage with AI
Once configured, you can ask your AI assistant:
"What version of Statamic is installed and is it Pro or Solo?" "Show me all my blueprint structures and generate TypeScript types" "List all global sets and their current values across all sites" "Create a new global set for company contact information with phone, email, and address fields" "Update the footer global values for the Danish site" "What modifiers and filters are available in my project?" "Analyze this Antlers template for performance issues and security vulnerabilities" "Lint this Blade template and detect N+1 query problems" "Validate this template against my blueprint and check for edge cases" "Create a new blog entry with proper field validation" "Search for documentation about collections and how they work" "Check my templates for XSS vulnerabilities and recursive partial issues" "What global sets exist and what's their blueprint structure?" "Clear all Statamic caches and show me the status" "Analyze template performance and suggest optimizations" "Check for missing pagination in large collection loops" "Find templates with excessive complexity and suggest refactoring" "Show me user preferences and configure global settings"
π― Key Capabilities
System Intelligence & Management
- Installation Analysis: Version, edition (Pro/Solo), licensing status, multi-site configuration
- Storage Detection: File-based, database (Runway), or mixed storage patterns
- Content Extraction: Dynamic analysis of modifiers, globals, taxonomies, users, permissions
- Cache Management: Clear, warm, and monitor all Statamic caches (Stache, static, images, views)
Content Operations
- CRUD Operations: Create, edit, delete, reorder entries, taxonomy terms, navigation items
- Content Discovery: Extract all content types with filtering and metadata
- Bulk Operations: Mass content management and organization
- Data Integrity: Safe operations with proper validation and error handling
Blueprint Intelligence
- Complete Analysis: Blueprint and fieldset scanning with relationship mapping
- Type Generation: TypeScript, PHP classes, JSON Schema from blueprints
- Field Categories: 25+ supported field types with validation patterns
- Dynamic Discovery: On-demand field type and configuration analysis
Documentation Intelligence
- Dynamic Search: Live content from statamic.dev with sitemap parsing
- Relevance Scoring: Intelligent content ranking and suggestions
- Addon Coverage: Third-party documentation and community resources
- Comprehensive Coverage: All modifiers, tags, and constantly updated content
Template Development
- Language-Aware Hints: Context-appropriate suggestions for Antlers vs Blade
- Syntax Validation: Blueprint-driven template validation with error reporting
- Best Practices: Anti-pattern detection with auto-fix suggestions
- Template Separation: Clear guidance on when to use Antlers vs Blade
Code Quality & Security
- Policy Enforcement: Configurable linting rules for both Antlers and Blade
- Security Detection: Template vulnerability scanning and prevention
- Accessibility: Compliance checks and automated improvements
- Performance: Template optimization suggestions and cache-aware development
π Project Structure
statamic-mcp/βββ src/Mcp/Tools/ # 50+ specialized MCP toolsβ βββ Blueprints/ # Blueprint management and analysisβ β βββ ListBlueprintsTool.phpβ β βββ GetBlueprintTool.phpβ β βββ CreateBlueprintTool.phpβ β βββ UpdateBlueprintTool.phpβ β βββ DeleteBlueprintTool.phpβ β βββ ScanBlueprintsTool.phpβ β βββ GenerateBlueprintTool.phpβ β βββ TypesBlueprintTool.phpβ β βββ ValidateBlueprintTool.phpβ β βββ CheckFieldDependenciesTool.phpβ β βββ DetectFieldConflictsTool.phpβ βββ Collections/ # Collection managementβ β βββ ListCollectionsTool.phpβ β βββ GetCollectionTool.phpβ β βββ CreateCollectionTool.phpβ β βββ UpdateCollectionTool.phpβ β βββ DeleteCollectionTool.phpβ βββ Taxonomies/ # Taxonomy managementβ β βββ ListTaxonomyTool.phpβ β βββ GetTaxonomyTool.phpβ β βββ CreateTaxonomyTool.phpβ β βββ UpdateTaxonomyTool.phpβ β βββ DeleteTaxonomyTool.phpβ β βββ AnalyzeTaxonomyTool.phpβ β βββ ListTermsTool.phpβ βββ Entries/ # Entry managementβ β βββ ListEntresTool.phpβ β βββ GetEntryTool.phpβ β βββ CreateEntryTool.phpβ β βββ UpdateEntryTool.phpβ β βββ DeleteEntryTool.phpβ β βββ PublishEntryTool.phpβ β βββ UnpublishEntryTool.phpβ βββ Terms/ # Term managementβ β βββ ListTermsTool.phpβ β βββ GetTermTool.phpβ β βββ CreateTermTool.phpβ β βββ UpdateTermTool.phpβ β βββ DeleteTermTool.phpβ βββ Globals/ # Global sets and values managementβ β βββ ListGlobalSetsTool.phpβ β βββ GetGlobalSetTool.phpβ β βββ CreateGlobalSetTool.phpβ β βββ DeleteGlobalSetTool.phpβ β βββ ListGlobalValuesTool.phpβ β βββ GetGlobalValuesTool.phpβ β βββ UpdateGlobalValuesTool.phpβ βββ Navigation/ # Navigation managementβ β βββ ListNavigationTool.phpβ βββ Content/ # Other content operationsβ β βββ AssetsContentTool.phpβ β βββ SubmissionsContentTool.phpβ β βββ UsersContentTool.phpβ βββ Tags/ # Tag managementβ β βββ ListTagsTool.phpβ βββ Modifiers/ # Modifier managementβ β βββ ListModifiersTool.phpβ βββ FieldTypes/ # Field type managementβ β βββ ListFieldTypesTool.phpβ βββ Scopes/ # Scope managementβ β βββ ListScopesTool.phpβ βββ Filters/ # Filter managementβ β βββ ListFiltersTool.phpβ βββ Sites/ # Multi-site managementβ β βββ ListSitesTool.phpβ β βββ CreateSiteTool.phpβ β βββ UpdateSiteTool.phpβ β βββ DeleteSiteTool.phpβ β βββ SwitchSiteTool.phpβ β βββ AnalyzeSitesTool.phpβ βββ Users/ # User management and RBACβ β βββ ListUsersTool.phpβ β βββ GetUserTool.phpβ β βββ CreateUserTool.phpβ β βββ UpdateUserTool.phpβ β βββ DeleteUserTool.phpβ β βββ AnalyzeUsersTool.phpβ βββ Roles/ # Role managementβ β βββ ListRolesTool.phpβ β βββ GetRoleTool.phpβ β βββ CreateRoleTool.phpβ β βββ UpdateRoleTool.phpβ β βββ DeleteRoleTool.phpβ β βββ ListPermissionsTool.phpβ β βββ AnalyzePermissionsTool.phpβ βββ Development/ # Advanced developer toolsβ β βββ TemplatesDevelopmentTool.phpβ β βββ AddonsDevelopmentTool.phpβ β βββ AddonDiscoveryTool.phpβ β βββ TypesDevelopmentTool.phpβ β βββ ConsoleDevelopmentTool.phpβ β βββ AntlersValidateTool.phpβ β βββ BladeLintTool.phpβ β βββ OptimizedTemplateAnalyzer.php # Advanced template analysisβ β βββ AnalyzeTemplatePerformanceTool.phpβ β βββ DetectUnusedTemplatesTool.phpβ β βββ ExtractTemplateVariablesTool.phpβ β βββ SuggestTemplateOptimizationsTool.phpβ β βββ WidgetsDevelopmentTool.phpβ βββ Structures/ # Structure managementβ β βββ FieldsetsScanStructuresTool.phpβ β βββ FieldsetsStructureTool.phpβ β βββ NavigationsStructureTool.phpβ β βββ FormsStructureTool.phpβ β βββ GlobalsStructureTool.phpβ β βββ AssetsStructureTool.phpβ β βββ GroupsStructureTool.phpβ β βββ PermissionsStructureTool.phpβ βββ System/ # System operationsβ βββ InfoSystemTool.phpβ βββ CacheSystemTool.phpβ βββ DocsSystemTool.phpβ βββ GetLicenseStatusTool.phpβ βββ VerifyLicenseTool.phpβ βββ PreferencesManagementTool.phpβ βββ StacheManagementTool.phpβ βββ SearchIndexAnalyzerTool.phpβ βββ SitesTool.phpβ βββ DiscoverToolsTool.phpβ βββ GetToolSchemaTool.phpβ βββ SystemHealthCheckTool.phpβ βββ PerformanceMonitorTool.phpβββ tests/ # Comprehensive test suiteβββ docs/ # Detailed documentationβββ config/statamic_mcp.php # Configuration options
π Documentation
Tool Discovery
Use the built-in discovery tools to explore available capabilities:
# Discover all available tools with their schemas"Use the statamic.system.tools.discover tool to show me all available tools" # Get detailed schema for a specific tool"Show me the schema for statamic.entries.create" # Find tools by domain"What blueprint management tools are available?"
Additional Documentation
- Installation Guide: See Installation section above
- AI Assistant Setup: See AI Assistant Setup section
- Tool Examples: Use discovery tools for live examples
βοΈ Configuration
Publish and customize the configuration:
php artisan vendor:publish --tag=statamic-mcp-config
Configure blueprint paths, linting rules, cache settings, and more in config/statamic_mcp.php
.
Development Installation
For local development or contributing:
# Clone the repository into your Statamic project's addons foldermkdir -p addons/cboxdkcd addons/cboxdkgit clone https://github.com/cboxdk/statamic-mcp.git # Add to composer.json repositories section"repositories": [ { "type": "path", "url": "addons/cboxdk/statamic-mcp" }] # Install the addoncomposer require cboxdk/statamic-mcp:@dev # Install dependenciescd addons/cboxdk/statamic-mcpcomposer install
π§ͺ Development & Testing
Running Tests
# Run all tests with Pest./vendor/bin/pestcomposer test # Run with coverage report./vendor/bin/pest --coveragecomposer test:coverage # Development watch mode./vendor/bin/pest --watch # Run specific test file./vendor/bin/pest tests/BlueprintsScanToolTest.php
Code Quality
# Format code with Laravel Pint./vendor/bin/pintcomposer pint # Check formatting without fixing./vendor/bin/pint --testcomposer pint:test # Run PHPStan Level 8 analysis./vendor/bin/phpstan analysecomposer stan # Run complete quality check (format + analysis + tests)composer quality
Quality Standards
This project maintains the highest code quality standards:
- PHPStan Level 8: Strict type checking with zero tolerance for errors
- Laravel Pint: Consistent code formatting following Laravel conventions
- Type Safety: All methods have explicit parameter and return types
- Test Coverage: Comprehensive test suite with 92+ passing tests
- Strict Types: All PHP files declare
strict_types=1
π§ Troubleshooting
Common Issues
MCP server not connecting in Claude:
- Ensure absolute paths in config file
- Check
APP_ENV
is set tolocal
- Verify PHP path:
which php
- Test manually:
php artisan mcp:serve statamic
Tools not appearing:
- Clear Laravel cache:
php artisan cache:clear
- Check service provider registration
- Verify
laravel/mcp
is installed:composer show laravel/mcp
PHPStan errors:
- Run
composer update
to ensure latest dependencies - Check PHP version: minimum 8.2 required
- Clear PHPStan cache:
./vendor/bin/phpstan clear-result-cache
Test failures:
- Ensure Statamic is properly installed
- Check test database configuration
- Run
composer dump-autoload
π€ Contributing
- Fork the repository
- Install:
composer install
- Test:
./vendor/bin/pest
- Ensure quality checks pass:
composer quality
- Submit pull request
π License
MIT License
Enhanced Statamic development with AI assistance π