|
| 1 | +# .mcp.json — MCP Server Configuration for Claude Code |
| 2 | + |
| 3 | +`.mcp.json` is how Claude Code discovers MCP servers for this project. |
| 4 | +JSON does not support comments, so this companion file documents the config. |
| 5 | + |
| 6 | +## Repo Safety Reminder |
| 7 | + |
| 8 | +Do not commit site-specific LocalWP names, internal hostnames, user IDs, filesystem paths, bearer tokens, cookies, auth-state files, or other confidential environment details into `.mcp.json` or related MCP docs. |
| 9 | + |
| 10 | +Keep the checked-in `.mcp.json` generic and public-safe. If you need a second WordPress MCP Adapter entry for a real site, keep that variant local-only and store working snippets or notes under `temp/` instead of committing them. |
| 11 | + |
| 12 | +Tracked helpers for local use: |
| 13 | +- `.mcp.local.example.json` shows a generic dual-server shape with placeholders. |
| 14 | +- `./bin/mcp-local-config` merges `.mcp.json` with any local-only snippets under `temp/mcp/local-snippets/`. |
| 15 | +- `examples/mcp/local-snippet.example.json` shows the exact snippet shape expected under `temp/mcp/local-snippets/`. |
| 16 | + |
| 17 | +Scaffolded local snippet directories are kept in git with: |
| 18 | +- `temp/mcp/local-snippets/.gitkeep` |
| 19 | +- `temp/mcp/notes/.gitkeep` |
| 20 | + |
| 21 | +## Current: Single-Server (AI-DDTK) |
| 22 | + |
| 23 | +The checked-in `.mcp.json` now defaults to the public-safe AI-DDTK server only. Add a second WordPress MCP Adapter entry locally when you want site-specific abilities without committing a real Local site name into the repo. |
| 24 | + |
| 25 | +## Dual-Server Config: AI-DDTK + WordPress MCP Adapter |
| 26 | + |
| 27 | +To run the WP MCP Adapter alongside AI-DDTK, replace `.mcp.json` with: |
| 28 | + |
| 29 | +```json |
| 30 | +{ |
| 31 | + "mcpServers": { |
| 32 | + "ai-ddtk": { |
| 33 | + "command": "bash", |
| 34 | + "args": ["tools/mcp-server/start.sh"] |
| 35 | + }, |
| 36 | + "wordpress": { |
| 37 | + "command": "./bin/local-wp", |
| 38 | + "args": [ |
| 39 | + "<site-name>", |
| 40 | + "mcp-adapter", "serve", |
| 41 | + "--server=mcp-adapter-default-server", |
| 42 | + "--user=1" |
| 43 | + ] |
| 44 | + } |
| 45 | + } |
| 46 | +} |
| 47 | +``` |
| 48 | + |
| 49 | +You can also keep the checked-in `.mcp.json` generic, place one or more real local adapter snippets in `temp/mcp/local-snippets/*.json`, and generate a merged local config with: |
| 50 | + |
| 51 | +```bash |
| 52 | +./bin/mcp-local-config --write .mcp.local.json |
| 53 | +``` |
| 54 | + |
| 55 | +`/.mcp.local.json` is gitignored on purpose. |
| 56 | + |
| 57 | +Preview a write target without modifying files: |
| 58 | + |
| 59 | +```bash |
| 60 | +./bin/mcp-local-config --dry-run --write .mcp.local.json |
| 61 | +``` |
| 62 | + |
| 63 | +If you intentionally want to overwrite the repo-root `.mcp.json` for local-only work, the helper supports that too but requires an explicit warning acknowledgment: |
| 64 | + |
| 65 | +```bash |
| 66 | +printf 'OVERWRITE\n' | ./bin/mcp-local-config --write-root |
| 67 | +``` |
| 68 | + |
| 69 | +### Notes |
| 70 | + |
| 71 | +- Replace `<site-name>` with your Local site (e.g. `love2hugcom-clone`). |
| 72 | +- Use `--user=1` (user ID), not `--user=admin` — admin usernames vary per site. |
| 73 | +- Do not commit the resolved site name, internal domain, or user identifier from your local environment back into the checked-in `.mcp.json`. |
| 74 | +- For Valet sites, use system WP-CLI instead of `./bin/local-wp`: |
| 75 | + ```json |
| 76 | + "wordpress": { |
| 77 | + "command": "wp", |
| 78 | + "args": [ |
| 79 | + "--path=/Users/<you>/Valet-Sites/<site>", |
| 80 | + "mcp-adapter", "serve", |
| 81 | + "--server=mcp-adapter-default-server", |
| 82 | + "--user=admin" |
| 83 | + ] |
| 84 | + } |
| 85 | + ``` |
| 86 | + |
| 87 | +### Tool namespaces (no collisions) |
| 88 | + |
| 89 | +| Server | Tools | Prefix | |
| 90 | +|---|---|---| |
| 91 | +| ai-ddtk | 18 | `local_wp_*`, `pw_auth_*`, `tmux_*`, `wpcc_*`, `wp_ajax_test` | |
| 92 | +| wordpress | 3 | `mcp-adapter-*` (discover, get-info, execute) | |
| 93 | + |
| 94 | +### Custom ability requirements |
| 95 | + |
| 96 | +Abilities must set three things to be visible via MCP Adapter: |
| 97 | +1. Hook: `add_action('wp_abilities_api_init', ...)` |
| 98 | +2. Category: `'category' => 'site'` (or `user`, `mcp-adapter`) |
| 99 | +3. MCP flag: `'meta' => ['mcp' => ['public' => true]]` |
| 100 | + |
| 101 | +See `P1-WP-MCP-ADAPTER.md` Phase 0.2 for the full mu-plugin pattern. |
| 102 | + |
| 103 | +### No-parameter abilities — omit `input_schema` |
| 104 | + |
| 105 | +Abilities that take no parameters must **not** include an `input_schema`. Using `'properties' => new stdClass()` triggers two bugs in `ExecuteAbilityAbility` v0.4.1. See [docs/MCP-ADAPTER-SETUP.md](docs/MCP-ADAPTER-SETUP.md#abilities-with-no-parameters-must-omit-input_schema) for details. |
| 106 | + |
| 107 | +--- |
| 108 | +Validated 2026-03-22 on Local and Valet test sites. |
| 109 | +Validated 2026-03-21 on a Local WordPress 6.9.4 site — all 12 Phase 1+2 abilities confirmed. |
0 commit comments