/craftcms-claude-skills:craft-mcpfrom craftcms-claude-skills
Guides setting up and using Craft CMS 5.12+ MCP servers, OAuth server, and personal access tokens. Covers authenticated/public/stdio servers, permission levels, config files, key generation, and connecting Claude Code or other clients.
Ships in craftcms-claude-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
!sh ${CLAUDE_SKILL_DIR}/scripts/craft-version.sh
If no Craft version line appears above, establish the version before any version-specific advice: craftcms/cms in composer.lock for a site, the lowest version the craftcms/cms constraint in composer.json allows for a plugin, or ask. Then check it against the version tags in this skill ([5.12+], [5.12.1+], [changed 5.12.1]).
Everything in this skill is new in Craft 5.12 (2026-11-03). On 5.11 or older there is no MCP server, OAuth server or Tokens screen in core. Before 5.12: upgrade first (ddev composer require craftcms/cms:^5.12.5 -W, then ddev craft up, commit composer.lock and config/project/; checklist: the craftcms skill's upgrade-5.12.md). Target 5.12.5 or later, not 5.12.0: 5.12.1 renamed every tool to snake_case, 5.12.1 through 5.12.5 fixed several security issues (5.12.5 a high-severity RCE and SQL injection; see references/security.md), and 5.12.5 stopped Matrix writes from deleting entries left out of sortOrder. [5.12+]
Source of truth: Craft's CHANGELOG and the 5.12.5 source (src/mcp/, src/services/Mcp.php, src/services/OAuth.php, src/controllers/McpController.php, src/controllers/OauthController.php). Craft's own docs pages still show the pre-5.12.1 dot-separated tool names; the source wins. [5.12+]
craftcms: Plugin or module PHP around an MCP capability (services, permissions, controllers), GraphQL OAuth details in references/graphql.md, config files in references/config-*.md.craft-php-guidelines: Whenever you write the PHP for an MCP tool, field interface or OAuth resource.ddev: Local environment; the stdio server runs through ddev craft.craft-cloud, servd, craft-fortrabbit: host-specific env var and filesystem handling for the signing keys.craft-content-modeling: When an MCP client is used to author sections, fields or entry types (project config workflow still applies).| Server | Transport | Who it acts as | Default endpoint | Default state |
|---|---|---|---|---|
| Authenticated | Streamable HTTP | The user who authorized the client via OAuth, capped by the access level they chose | /{cpTrigger}/mcp + /{cpTrigger}/mcp/auth; /mcp + /mcp/auth when public registration is on or cpTrigger is empty | Off |
| Public | Streamable HTTP | Nobody; only capabilities and content approved in Settings → MCP | /mcp | Off |
| stdio | craft mcp/serve --user=<id|username|email> | The named user, no access-level cap | n/a | Always available, ignores both switches |
Clients connect to the authorization endpoint (…/mcp/auth). Settings live in project config under mcp; saving Settings → MCP needs an admin and allowAdminChanges. Details: references/servers-and-access.md.
ddev craft oauth/generate-keys # once per checkout; writes storage/oauth-*.key
# CP → Settings → MCP → enable the authenticated server, save, commit config/project/
claude mcp add --transport http craft https://my-site.ddev.site/admin/mcp/auth
# in Claude Code: /mcp → authenticate → browser: CP login, pick Read only / Read and write / Full access
ddev share hosts are rejected (403 "Invalid Host header") unless they are also a site base URL. A personal access token cannot carry MCP scopes; use OAuth or stdio. Name the server craft: the pack's agents look for that name, and a server under another name is not visible to the pack's agents. Full recipes (stdio, TLS trust, production, Cloud/Servd/fortrabbit): references/client-setup.md.
elements_list, not the old dot-separated form) and plugin tools should be too, prefixed with the plugin handle: my_plugin_orders_list. Some clients reject dots. [changed 5.12.1]/admin/mcp instead of /admin/mcp/auth. Use the authorization endpoint; opening either in a browser shows copy-paste setup snippets.mcp scope group offers no grantable scopes, so create() throws "Invalid scopes" even for admins, and a GraphQL PAT sent to the MCP endpoint gets a 401. PATs are for GraphQL and plugin APIs. See references/personal-access-tokens.md.storage/ on an ephemeral or load-balanced host. Set CRAFT_OAUTH_PRIVATE_KEY and CRAFT_OAUTH_PUBLIC_KEY instead (multiline PEM, or newlines replaced by spaces; never stripped whitespace or literal \n). See references/oauth-server.md.securityKey. It derives the OAuth encryption key: refresh tokens and pending auth codes die, every client must authorize again. Regenerating the RSA keys kills access tokens only.RequiresAdminChanges (configuration writes, plugin install, project config apply/write, field layout updates, group permissions) disappear when allowAdminChanges is off. Make schema changes in dev and deploy project config.mcp/serve skips the enable switches and OAuth access levels and gets everything the named user can do. Run it as a least-privileged user. [5.12+]tools/list. Over stdio as an admin, 5.12.5 returns 70 tools in two pages (50 + cursor), and elements_* can land on page 2. [5.12+]readOnlyHint: true. It then requires mcp:write and is hidden from Read-only clients. A duplicate tool name throws a LogicException that breaks discovery for every user. See references/plugin-extension.md.redirectDomains at ['*'] on production. Restrict it to the clients you expect, keeping http://localhost for local desktop clients. See references/security.md.Task examples:
client-setup.mdservers-and-access.md + security.mdclient-setup.md + oauth-server.mdclient-setup.md (troubleshooting)tool-catalogue.mdpersonal-access-tokens.mdplugin-extension.mdplugin-extension.mdplugin-extension.md + oauth-server.mdservers-and-access.md (filters) + security.md| Reference | Scope | ~Lines |
|---|---|---|
references/servers-and-access.md | The three servers, routing and endpoints, access levels and gating attributes, Settings → MCP and public approvals, config/mcp.php (instructions, filters), sessions, discovery | ~135 |
references/oauth-server.md | Signing keys and the generate command, env vars, config/oauth.php keys, endpoints and metadata, dynamic client registration, lifetimes, rotation, revocation, rate limits | ~130 |
references/personal-access-tokens.md | Tokens screen and its gating, elevated session, expirations, scopes, using a PAT with GraphQL, programmatic creation | ~75 |
references/client-setup.md | Claude Code over HTTP on DDEV, TLS trust, stdio via ddev craft mcp/serve, production checklist, Craft Cloud / Servd / fortrabbit keys, troubleshooting [5.12+] | ~100 |
references/tool-catalogue.md | Every tool, resource and prompt in 5.12.5 with its scope and gating, upload tools, permission tools, expectedRevision, Matrix writes [5.12+] | ~170 |
references/plugin-extension.md | Registering capabilities, attribute signatures, naming, scopes, hiding per user, InputSchemaFieldInterface, McpOutputFieldInterface, OAuth resources, PAT scope groups, other hooks [5.12+] | ~270 |
references/security.md | What each server exposes, production hardening, rate limits, redirectDomains, revocation, the 5.12.x advisories [5.12+] | ~75 |
House rules: no AI or tool attribution and no co-author trailers in commits, PRs, comments, code or docs; no em dashes in prose; US spelling; no model or vendor names in pack files.
references/client-setup.md (opens in a new tab)references/oauth-server.md (opens in a new tab)references/personal-access-tokens.md (opens in a new tab)references/plugin-extension.md (opens in a new tab)references/security.md (opens in a new tab)references/servers-and-access.md (opens in a new tab)references/tool-catalogue.md (opens in a new tab)scripts/craft-version.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Triggers on: Craft MCP server, connect Claude Code or an AI assistant to Craft, claude mcp add, /admin/mcp/auth, mcp/serve, oauth/generate-keys, CRAFT_OAUTH_PRIVATE_KEY, config/mcp.php, config/oauth.php, redirectDomains, public MCP server, personal access token, My Account → Tokens, elements_list, craft_query, register an MCP tool from a plugin, McpTool, EVENT_REGISTER_CAPABILITY_TYPES, InputSchemaFieldInterface, McpOutputFieldInterface, OAuth resource. Do NOT trigger for Chrome DevTools or other non-Craft MCP servers, GraphQL schema tokens, Cloud or Servd deploys without MCP, GitHub or Composer tokens, Craft as an OAuth/SSO client (social login, OIDC), or plain plugin controller auth.
Three short reads, in order
npx claudepluginhub michtio/craftcms-claude-skills --plugin craftcms-claude-skills16 skills in this plugin
/craft-cloudCraft Cloud, Pixel & Tonic's serverless hosting platform for Craft CMS. Covers craft-cloud.yaml, the Build → Migrate → Release deploy pipeline, the craftcms/cloud extension, edge transforms and static caching (cache.rules, ESI), the Cloud S3 filesystem, MySQL 8 / Postgres 15 (no MariaDB, no tablePrefix), the Console command runner and scheduled cron, queue jobs, custom domains, preview environments per branch, limits (ephemeral filesystem, no SSH, no .htaccess, no built-in mail), Cloud-compatible plugins, and self-hosted → Cloud migration./craftcmsCraft CMS 5 plugin and module development in PHP. Covers elements, element queries, services, models, records, controllers, migrations, queue jobs, console commands, field types, events, Twig extensions, widgets, permissions, GraphQL, testing, and debugging./craft-content-modelingCraft CMS 5 content modeling: sections, entry types, fields, Matrix, relations, project config, and content architecture strategy. Covers choosing section types, designing entry types and field layouts, selecting field types, Matrix and nested entries, relations and eager loading, and multi-site propagation./craft-fortrabbitfortrabbit (fortrabbit.com): managed PHP hosting with a Craft CMS software template. Covers git push-to-deploy through the fortrabbit GitHub App, the template's build and post-deploy commands, the merge deployment strategy with the /config/project replace pattern, the deploy file (.fortrabbit/deploy.yml) and its replace-by-default trap, CRAFT_* ENV vars mapped from FORTRABBIT_DB_*, production settings (admin changes and updates off), persistent storage for asset volumes and rsync sync, MySQL over an SSH tunnel, the queue and image transforms in a worker job, crons, platform limits (no root, no sendmail), and DDEV local development./craft-garnishGarnish, Craft CMS's built-in JavaScript UI toolkit for the control panel. ALWAYS load when writing, editing, or reviewing JavaScript that runs in the Craft CP: plugin CP assets, custom field type JS, element index JS, CP webpack config, or code importing garnishjs / referencing window.Garnish. Also for CP accessibility, keyboard interactions, drag-sort, and CP JS memory issues./craft-gated-buildBuilds one approved slice with the outside builders listed in .ai/skills-profile.json (local AI, a script) and keeps the pack's gates: craft-gate-writer locks the gate ahead of any builder, each builder gets a brief and returns a handback, the handback is verified, the lock and craft-review-checker cover the result, at most three rounds, and craft-feature-builder takes over when every outside builder fails, is unavailable or passes its timeout setting.Other plugins' skills for the same job