fix(mcp): enable stimmt/craft-mcp via committed config/mcp.php #12

Merged
Phil merged 1 commit from fix/enable-craft-mcp-prod into main 2026-06-20 19:08:35 +00:00
Owner

Problem

Both craft-cms MCP profiles were dead (/mcp reconnect → -32000), for two distinct reasons:

  • Local (craft-cms): the philflow_php_local container simply wasn't running — docker exec philflow_php_local … failed immediately. Fixed by bringing the local stack up.
  • Prod (craft-cms-prod): container healthy + SSH fine, but the MCP server exited with Error: Craft MCP is disabled. The plugin's applyProductionDefaults() (vendor/stimmt/craft-mcp/src/Mcp.php) hard-disables MCP when CRAFT_ENVIRONMENT=production and no config/mcp.php exists. That file was never tracked, so prod never actually had MCP enabled despite the 2026-05-20 deploy notes.

Fix

Commit config/mcp.php returning ['enabled' => true]. The plugin only reads flat top-level keys (Craft's multi-environment '*'/'production' form is not supported), so the config is intentionally flat. This makes the enabled state reproducible from a clean docker compose up, per project rule #5.

Verification

  • Local: initialize handshake returns Craft CMS MCP Server v1.2.2
  • Prod: rebuilt philflow:latest (config baked via Dockerfile.prod), recreated philflow_php (healthy), initialize now returns the server descriptor instead of "disabled"
  • Site: HTTP 200
  • Pre-deploy DB backup taken (backups/predeploy_20260620_190016.sql.gz, 14M)

🤖 Generated with Claude Code

## Problem Both `craft-cms` MCP profiles were dead (`/mcp` reconnect → `-32000`), for two distinct reasons: - **Local (`craft-cms`)**: the `philflow_php_local` container simply wasn't running — `docker exec philflow_php_local …` failed immediately. Fixed by bringing the local stack up. - **Prod (`craft-cms-prod`)**: container healthy + SSH fine, but the MCP server exited with `Error: Craft MCP is disabled`. The plugin's `applyProductionDefaults()` (`vendor/stimmt/craft-mcp/src/Mcp.php`) hard-disables MCP when `CRAFT_ENVIRONMENT=production` **and** no `config/mcp.php` exists. That file was never tracked, so prod never actually had MCP enabled despite the 2026-05-20 deploy notes. ## Fix Commit `config/mcp.php` returning `['enabled' => true]`. The plugin only reads flat top-level keys (Craft's multi-environment `'*'`/`'production'` form is **not** supported), so the config is intentionally flat. This makes the enabled state reproducible from a clean `docker compose up`, per project rule #5. ## Verification - Local: `initialize` handshake returns `Craft CMS MCP Server v1.2.2` ✅ - Prod: rebuilt `philflow:latest` (config baked via `Dockerfile.prod`), recreated `philflow_php` (healthy), `initialize` now returns the server descriptor instead of "disabled" ✅ - Site: `HTTP 200` ✅ - Pre-deploy DB backup taken (`backups/predeploy_20260620_190016.sql.gz`, 14M) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The plugin's applyProductionDefaults() hard-disables MCP when
CRAFT_ENVIRONMENT=production and no config/mcp.php exists, so the
craft-cms-prod MCP profile exited with "Craft MCP is disabled" (-32000).
The file was never tracked, so prod never actually had MCP enabled.

Committing it makes the enabled state reproducible from a clean
docker compose up, per project rule #5.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Phil merged commit f9ff1b80c6 into main 2026-06-20 19:08:35 +00:00
Phil deleted branch fix/enable-craft-mcp-prod 2026-06-20 19:08:35 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Phil/philflow.io!12
No description provided.