cboxdk/statamic-mcp

AI-powered development tools for Statamic CMS. Provides 100+ MCP tools for blueprints, entries, collections, and more.

v0.9.0 2025-09-27 18:31 UTC

This package is auto-updated.

Last update: 2025-09-27 18:31:51 UTC


README

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 modern router-based 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 Composer
composer require cboxdk/statamic-mcp

# Run the installation command to set up MCP
php 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 powerful router tools that organize Statamic's capabilities into logical domains with action-based routing:

๐Ÿ“‹ Blueprint Management

Router: statamic.blueprints Actions: list, get, create, update, delete, scan, generate, types, validate

  • List blueprints with optional details and namespace filtering
  • Get specific blueprints with full field definitions and relationships
  • Create new blueprints from field definitions with validation
  • Update existing blueprints with field changes and configuration
  • Delete blueprints with safety checks and dependency validation
  • Scan blueprint directories with performance optimization
  • Generate blueprints from templates and AI-assisted field definitions
  • Analyze blueprint types for TypeScript/PHP type generation
  • Validate blueprints for field conflicts and structural integrity

๐Ÿ“š Content Management

Router: statamic.content Actions: list, get, create, update, delete, publish, unpublish Types: entry, term, global

  • Unified content operations across entries, terms, and global sets
  • Security-first permissions with audit logging and validation
  • Multi-site support with proper localization handling
  • Blueprint-based validation with comprehensive field validation
  • Slug uniqueness validation using Statamic's built-in rules
  • Publishing workflows with state management and validation
  • Bulk operations with safety checks and rollback capabilities

๐Ÿ“š System Management

Router: statamic.system Actions: info, health, cache_status, cache_clear, cache_warm, config_get, config_set

  • System information with version, edition, and multi-site analysis
  • Health monitoring with comprehensive diagnostic checks
  • Cache management with selective clearing and warming capabilities
  • Configuration access with safe get/set operations
  • Performance analysis with bottleneck detection and optimization
  • Storage detection for file-based, database, or mixed patterns

๐Ÿ—๏ธ Structure Management

Router: statamic.structures Purpose: Manage structural configurations across Statamic

  • Collection structures with route patterns and blueprint associations
  • Navigation trees with hierarchical organization and URL structures
  • Form configurations with field definitions and validation rules
  • Global set structures with multi-site value management
  • Asset containers with storage driver configuration
  • User group hierarchies with permission inheritance
  • Permission structures with role-based access control analysis

๐Ÿ“ Entry Management

Router: statamic.entries Purpose: Dedicated entry operations with advanced features

  • List entries with filtering, search, pagination, and status filtering
  • Get entry details with full data, relationships, and metadata
  • Create entries with blueprint validation and slug uniqueness checks
  • Update entries with merge strategies and change tracking
  • Delete entries with relationship validation and cleanup
  • Publishing workflows with draft/published state management
  • Bulk operations with collection-wide actions and validation

๐Ÿท๏ธ Term Management

Router: statamic.terms Purpose: Dedicated taxonomy term operations

  • List terms with taxonomy filtering, search, and pagination
  • Get term details with full data and related entry connections
  • Create terms with validation and slug conflict prevention
  • Update terms with merge strategies and relationship maintenance
  • Delete terms with dependency validation and cleanup
  • Taxonomy analysis with term usage and relationship mapping

๐ŸŒ Global Management

Router: statamic.globals Purpose: Global set and values management

  • List global sets with structure and value metadata
  • Get global values with site-specific data and field filtering
  • Update global values with validation and change tracking
  • Create global sets with blueprint support and initial values
  • Delete global sets with backup options and safety checks
  • Multi-site support with localization and value inheritance

๐Ÿ—‚๏ธ Asset Management

Router: statamic.assets Purpose: Asset container and file operations

  • List asset containers with storage driver information
  • Create containers with custom disk configurations
  • Update containers with settings and access control
  • Delete containers with content cleanup options
  • File operations with upload, move, and organization features
  • Metadata management with alt text, titles, and custom fields

๐ŸŒ Sites Management Tools

Purpose: Multi-site Statamic configuration and management

  • statamic.sites.list - List all configured sites with settings and status
  • statamic.sites.create - Create new site configurations with validation
  • statamic.sites.update - Update existing site configurations with backup options
  • statamic.sites.delete - Delete sites with content analysis and cleanup options
  • statamic.sites.switch - Switch default site with impact analysis
  • statamic.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 metadata
  • statamic.users.get - Get specific user with detailed role and permission information
  • statamic.users.create - Create new users with role assignment and validation
  • statamic.users.update - Update users with granular role management
  • statamic.users.delete - Delete users with content reassignment options
  • statamic.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 counts
  • statamic.roles.get - Get specific role with detailed permission analysis
  • statamic.roles.create - Create new roles with permission validation
  • statamic.roles.update - Update roles with impact analysis on affected users
  • statamic.roles.delete - Delete roles with user impact assessment
  • statamic.permissions.list - List all available permissions with descriptions
  • statamic.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

Router: statamic.tags | Actions: list, create, discover Purpose: Manage Statamic tags for both Antlers and Blade

  • list - Tag discovery and management for both Antlers and Blade
  • create - Generate new custom tags with proper structure
  • discover - Find and analyze existing tags in the codebase

๐Ÿ”ง Modifier Tools

Router: statamic.modifiers | Actions: list, create, examples Purpose: Manage template modifiers

  • list - Modifier discovery and creation
  • create - Generate new custom modifiers
  • examples - Get usage examples for existing modifiers

๐ŸŽ›๏ธ Field Type Tools

Router: statamic.fieldtypes | Actions: list, create, configure Purpose: Manage custom field types

  • list - Field type discovery and configuration options
  • create - Generate new custom field types
  • configure - Get configuration options for field types

๐Ÿ” Scope Tools

Router: statamic.scopes | Actions: list, create, apply Purpose: Manage query scopes

  • list - Query scope discovery
  • create - Generate new query scopes
  • apply - Test scope application on collections

๐Ÿ—‚๏ธ Filter Tools

Router: statamic.filters | Actions: list, create, test Purpose: Manage collection filters

  • list - Filter discovery
  • create - Generate new collection filters
  • test - Test filter logic against sample data

โš™๏ธ Development Tools

Router: statamic.development | Actions: templates, antlers-validate, blade-lint, addons, types Purpose: Enhanced developer experience with advanced optimization

  • templates - Template hints with performance analysis and edge case warnings
  • antlers-validate - Advanced Antlers template validation with performance analysis
  • blade-lint - Comprehensive Blade linting with policy enforcement
  • addons - Addon development, analysis, and scaffolding
  • types - TypeScript/PHP type generation from blueprints

Advanced Features:

  • OptimizedTemplateAnalyzer: Detects N+1 queries, nested loops, excessive partials
  • Performance Analysis: Memory issues, recursive partials, XSS vulnerabilities
  • Edge Case Detection: Infinite loop risks, unescaped output, caching conflicts
  • Security Scanning: XSS detection, input sanitization, security best practices

๐Ÿ”ง System Tools

Router: statamic.system | Actions: info, cache, docs, health Purpose: System management and operations

  • info - Comprehensive system analysis and health checks
  • cache - Advanced cache management with selective clearing and warming
  • docs - Documentation search and discovery
  • health - System health checks with performance analysis

๐Ÿ—๏ธ Architecture & Design

Router-Based MCP Tool Architecture

The addon follows a router-based architecture where domain routers handle multiple actions:

  • Domain-based organization: Each router manages one Statamic domain (blueprints, collections, etc.)
  • Action-based routing: Single router handles multiple related operations (list, get, create, update, delete)
  • Reduced tool count: ~10 router tools instead of 140+ individual tools
  • Better performance: Fewer tools for AI assistants to choose from
  • Clearer organization: Domain boundaries with action-based routing
  • Easier maintenance: Single file per domain reduces fragmentation

Router Pattern Benefits

  • Scalability: Easy to add new actions without creating new tools
  • Maintainability: All domain operations in one location
  • Performance: Reduced overhead and faster tool loading
  • Clarity: Clear domain boundaries and action routing
  • Testing: Complete domain functionality in single test suite

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
  • Router-based efficiency: Domain-focused operations reduce complexity
  • Action-driven workflows: Clear action patterns for predictable behavior

๐ŸŽฏ 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 and filter 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 MCP
php artisan mcp:statamic:install

See docs/AI_ASSISTANT_SETUP.md for more details or manual setup.

๐Ÿ’ก Example Usage with AI

Router-Based Tool Architecture

This MCP server uses a router-based architecture where each domain (blueprints, collections, entries, etc.) has a single router tool that handles multiple actions. For example:

  • statamic.blueprints router handles: list, get, create, update, delete, scan, generate, types
  • statamic.entries router handles: list, get, create, update, delete, publish, unpublish
  • statamic.system router handles: info, cache, docs, health

This design provides better organization and performance compared to having 140+ individual tools.

Natural Language Usage

Once configured, you can ask your AI assistant using natural language:

"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 discover action to show me all available router tools"

# Get detailed schema for a specific tool
"Show me the schema for the statamic.entries router and its available actions"

# 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 folder
mkdir -p addons/cboxdk
cd addons/cboxdk
git clone https://github.com/cboxdk/statamic-mcp.git

# Add to composer.json repositories section
"repositories": [
    {
        "type": "path",
        "url": "addons/cboxdk/statamic-mcp"
    }
]

# Install the addon
composer require cboxdk/statamic-mcp:@dev

# Install dependencies
cd addons/cboxdk/statamic-mcp
composer install

๐Ÿงช Development & Testing

Running Tests

# Run all tests with Pest
./vendor/bin/pest
composer test

# Run with coverage report
./vendor/bin/pest --coverage
composer 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/pint
composer pint

# Check formatting without fixing
./vendor/bin/pint --test
composer pint:test

# Run PHPStan Level 8 analysis
./vendor/bin/phpstan analyse
composer 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 to local
  • 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

  1. Fork the repository
  2. Install: composer install
  3. Test: ./vendor/bin/pest
  4. Ensure quality checks pass: composer quality
  5. Submit pull request

๐Ÿ“„ License

MIT License

Enhanced Statamic development with AI assistance ๐Ÿš€