home / mcp / apostrophe code generator mcp server
Provides an MCP server to generate Apostrophe CMS modules via Claude AI, returning ready-to-save code for pieces, pages, widgets, and bundles.
Configuration
View docs{
"mcpServers": {
"andrewmat32-apostrophe-cms-generator": {
"command": "node",
"args": [
"/absolute/path/to/apostrophe-code-generator/mcp-server/index.js"
]
}
}
}You can extend Apostrophe CMS with AI-assisted code generation through an MCP server. This MCP server acts as a bridge between Claude Code and your local generator, enabling you to issue generation requests and receive ready-to-save module code for pieces, pages, widgets, and bundles. It is designed to streamline your workflow by handling AI-driven module creation, design token extraction, and automatic registration within your Apostrophe project.
Interact with the MCP server using your MCP client or Claude Code integration. You initiate a generation request for a specific module type (piece, page, widget, or bundle), provide a name and description, configure fields and relationships, and decide on styling options like design token integration and BEM-style SCSS. The MCP server processes your request, returns the generated module code, and optionally auto-registers the module in your projectβs modules.js. You can then save the generated code to your Apostrophe project and review it in your IDE.
Prerequisites to run the MCP server include Node.js and npm, plus Claude Code for AI-powered generation. You will also need an Anthropic API key to access Claude Code.
Key steps to get started on a typical system are:
List all discovered Apostrophe projects in the parent directory that contain an app.js with a shortName property.
Generate a piece module, including its schema and fields, to be saved in the project's modules.
Generate a page module, including its schema and any related piece-page configuration and views.
Generate a reusable widget module with fields, relationships, and a corresponding frontend template.
Generate a complete bundle consisting of a piece, a piece-page, and a widget in one operation.
Save the generated files from the history or current generation to your Apostrophe project.