cboxdk/statamic-mcp
Composer 安装命令:
composer require cboxdk/statamic-mcp
包简介
MCP (Model Context Protocol) server for Statamic CMS v6 — gives AI assistants structured access to content, blueprints, assets, and more.
README 文档
README
A comprehensive MCP (Model Context Protocol) server for Statamic CMS v6 that provides AI assistants with structured access to Statamic's content management capabilities through a modern router-based architecture.
Requirements
- PHP 8.3+
- Laravel 12+
- Statamic 6.6+
- Laravel MCP ^0.6 || ^0.7 || ^0.8
Installation
# Install via Composer composer require cboxdk/statamic-mcp # Run the installation command php artisan mcp:statamic:install
Recommended: Laravel Boost Integration
We recommend installing Laravel Boost alongside this addon for the best experience:
composer require laravel/boost --dev
Laravel Boost provides Laravel-specific tools (Eloquent, database, debugging), while Statamic MCP Server provides Statamic-specific tools (blueprints, collections, entries, assets). Together they give your AI assistant complete coverage.
Web MCP Endpoint
The web MCP endpoint is enabled by default after installation. To customize the path:
STATAMIC_MCP_WEB_PATH="/mcp/statamic"
Create a token in the CP dashboard (Tools > MCP > Tokens), then configure your AI client:
{
"mcpServers": {
"statamic": {
"url": "https://your-site.test/mcp/statamic",
"headers": {
"Authorization": "Bearer <YOUR_TOKEN>"
}
}
}
}
See Getting Started for detailed setup or AI Client Setup for client-specific instructions (Claude, Cursor, ChatGPT, Windsurf).
Features
The MCP server organizes Statamic's capabilities into domain routers with action-based routing:
Blueprint Management — statamic-blueprints
Actions: list, get, create, update, delete, scan, generate, types, validate
List, inspect, create, and modify blueprints. Generate TypeScript/PHP types from field definitions. Validate blueprints for conflicts and structural integrity.
Entry Management — statamic-entries
Dedicated entry operations with filtering, search, pagination, status filtering, merge strategies, and bulk operations.
Term Management — statamic-terms
Taxonomy term operations with slug conflict prevention, dependency validation, and relationship mapping.
Global Management — statamic-globals
Global set structure and values management with multi-site support, change tracking, and field-level filtering.
Structure Management — statamic-structures
Collection, taxonomy, navigation, and site configuration management.
Asset Management — statamic-assets
Asset container and file operations: upload, move, copy, rename, delete with metadata management.
User Management — statamic-users
User CRUD, role assignment, group management with RBAC support.
System Management — statamic-system
System info, health checks, cache management (clear/warm), and configuration access.
Content Workflow Facade — statamic-content-facade
High-level workflow operations: content_audit and cross_reference.
Agent Education Tools
statamic-system-discover— Intent-based tool discoverystatamic-system-schema— Tool schema inspection
Architecture
Router-Based Design
- 11 domain routers instead of 140+ individual tools
- Action-based routing: Each router handles multiple related operations
- Better AI performance: Fewer tools to choose from, clearer purposes
- Single file per domain: Easy maintenance and testing
Security
- Scoped API tokens with 21 granular permissions
- OAuth 2.1 authorization server with PKCE and dynamic client registration
- Bearer token + Basic Auth authentication
- Rate limiting per token
- Audit logging for all operations
- Path traversal protection
- PHPStan Level 8 strict typing
CP Dashboard
Vue 3 dashboard in the Statamic CP (Tools > MCP) with:
- Connect — Endpoint URL, client config snippets for Claude/Cursor/ChatGPT/Windsurf
- Tokens — Create, list, and revoke API tokens with scope selection
- Activity — Audit log of MCP tool calls
- Settings — System stats, endpoint status, rate limiting
Configuration
php artisan vendor:publish --tag=statamic-mcp-config
Key settings in config/statamic/mcp.php:
- Web endpoint (enabled, path, HTTPS enforcement)
- Authentication (scoped tokens, token lifetime, audit logging)
- Security (force web mode, audit logging)
- Rate limiting (max attempts per minute)
- Per-domain tool enablement
Development
# Run tests ./vendor/bin/pest composer test # Code formatting ./vendor/bin/pint composer pint # Static analysis (Level 8) ./vendor/bin/phpstan analyse composer stan # Full quality check composer quality
Quality Standards
- PHPStan Level 8 with zero errors
- Laravel Pint formatting
- Strict types on all PHP files
- Comprehensive test suite
Example Usage
"What version of Statamic is installed?"
"Show me all blueprints and generate TypeScript types"
"Create a new blog entry with title and content fields"
"List all global sets and their current values"
"Clear all caches and show me the status"
"Analyze this Antlers template for performance issues"
Contributing
- Fork the repository
- Install:
composer install - Test:
./vendor/bin/pest - Quality:
composer quality - Submit pull request
License
MIT License
cboxdk/statamic-mcp 适用场景与选型建议
cboxdk/statamic-mcp 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14.95k 次下载、GitHub Stars 达 31, 最近一次更新时间为 2025 年 09 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「tools」 「development」 「laravel」 「cursor」 「ai」 「statamic」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 cboxdk/statamic-mcp 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cboxdk/statamic-mcp 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 cboxdk/statamic-mcp 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A set of useful PHP classes.
A Laravel package to retrieve data from Google Search Console
Debugging a problem and need to login as one of your customers? This allows you to authenticate as any of your customers.
Library with classes to help you do batch.
GHT D-Tools Bundle
Allow KoolReport to use twig template engine to render view
统计信息
- 总下载量: 14.95k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 31
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-09-03