Flexible content management for web projects.
## Craft CMS MCP Server: Flexible Content Management The **Craft CMS MCP Server** integrates Craft CMS into Google Antigravity, enabling flexible content management with custom fields, Matrix blocks, and GraphQL APIs directly from your development environment. ### Why Craft CMS MCP? - **Developer-Friendly**: Built for developers with powerful templating - **Custom Fields**: Extensive field types with custom field layouts - **Matrix Blocks**: Flexible content blocks for modular page building - **GraphQL API**: Built-in GraphQL with custom schema extensions - **Multi-Site**: Native multi-site and localization support ### Key Features #### 1. Entry Queries ```python # Query entries via GraphQL result = await mcp.query(""" query GetNews { entries(section: "news", orderBy: "postDate DESC", limit: 10) { id title slug postDate ... on news_article_Entry { summary featuredImage { url } author { fullName } } } } """) for entry in result["entries"]: print(f"Entry: {entry['title']}") ``` #### 2. Entry Management ```python # Create entry entry = await mcp.create_entry( section="news", type="article", title="New Article", fields={ "summary": "Article summary...", "body": "Full article content...", "featuredImage": [asset_id] } ) # Update entry await mcp.update_entry( entry_id=entry["id"], fields={"title": "Updated Title"} ) # Publish entry await mcp.set_entry_status( entry_id=entry["id"], enabled=True ) ``` #### 3. Matrix Operations ```python # Create entry with Matrix blocks entry = await mcp.create_entry( section="pages", type="page", title="Landing Page", fields={ "contentBlocks": [ { "type": "hero", "fields": {"heading": "Welcome", "subheading": "To our site"} }, { "type": "textBlock", "fields": {"text": "Page content..."} }, { "type": "gallery", "fields": {"images": [img1_id, img2_id]} } ] } ) ``` #### 4. Asset Management ```python # Upload asset asset = await mcp.upload_asset( volume="images", folder="blog", file_path="./hero.jpg", title="Hero Image" ) # Query assets assets = await mcp.query(""" query { assets(volume: "images", limit: 20) { id title url width height } } """) ``` ### Configuration ```json { "mcpServers": { "craftcms": { "command": "npx", "args": ["-y", "@anthropic/mcp-craftcms"], "env": { "CRAFT_BASE_URL": "https://your-craft-site.com", "CRAFT_API_TOKEN": "your-api-token", "CRAFT_GQL_TOKEN": "your-graphql-token" } } } } ``` ### Use Cases **Marketing Websites**: Build flexible marketing sites with modular Matrix blocks. **Multi-Site Management**: Manage multiple related sites with shared content structures. **E-commerce Content**: Complement commerce platforms with rich product content. **Custom Applications**: Build custom content structures for unique business requirements. The Craft CMS MCP enables flexible content management within your development environment.
{
"mcpServers": {
"craftcms": {}
}
}