Claude Code
Claude Code is Anthropic’s terminal-based AI coding agent. It supports MCP servers via the .mcp.json file in your project root.
Sign in with OAuth (recommended)
Section titled “Sign in with OAuth (recommended)”Add the server with a single command, no credentials to generate:
claude mcp add emcp-tools --transport http https://your-site.test/wp-json/mcp/emcp-tools-serverThe first time Claude Code connects, your browser opens so you can approve the connection from your WordPress login. Approve once and you’re done, run claude mcp list to confirm it’s connected.
Requires an HTTPS site with OAuth enabled (EMCP Tools → Connection: on by default on HTTPS). Only administrators can approve. Revoke access any time under EMCP Tools → Connection → Connected apps.
The VS Code Claude Code extension shares this config and its OAuth token, so adding it here also connects it there.
HTTP with an Application Password
Section titled “HTTP with an Application Password”Create or edit .mcp.json in the root of whichever project you want to expose EMCP Tools to:
{ "mcpServers": { "emcp-tools": { "type": "http", "url": "https://your-site.test/wp-json/mcp/emcp-tools-server", "headers": { "Authorization": "Basic BASE64_ENCODED_CREDENTIALS" } } }}Replace:
-
https://your-site.test→ your WordPress site URL. -
BASE64_ENCODED_CREDENTIALS→ base64 ofusername:application-password. Generate one at Users → Profile → Application Passwords, then encode:Terminal window echo -n "admin:xxxx xxxx xxxx xxxx xxxx xxxx" | base64
After saving, restart Claude Code. Run claude mcp list to verify: emcp-tools should show as connected.
The plugin’s EMCP Tools → Connection admin screen has a one-click config generator that fills this in for you once you enter your username and application password.
stdio via WP-CLI (recommended for local dev)
Section titled “stdio via WP-CLI (recommended for local dev)”If your WordPress install is on the same machine as Claude Code and you have WP-CLI available, this is faster, no HTTP round-trip, no auth needed:
{ "mcpServers": { "emcp-tools": { "type": "stdio", "command": "wp", "args": [ "mcp-adapter", "serve", "--server=emcp-tools-server", "--user=admin", "--path=/absolute/path/to/wordpress" ] } }}The wp mcp-adapter serve command is provided by the WordPress MCP Adapter plugin’s WP-CLI bridge. Verify it exists:
wp mcp-adapter list --path=/absolute/path/to/wordpressShould print emcp-tools-server as a registered server.
Troubleshooting
Section titled “Troubleshooting”- “No MCP servers configured.” Restart Claude Code after editing
.mcp.json. - “Connection failed.” Test the URL directly with
curl, see the requirements check. - “No tools available” but connection succeeded. See No tools appearing.
- “Tool limit exceeded.” Claude Code has no hard cap, but if you’re hitting context-window pressure, flip on Compact tool mode to collapse the surface to 3 dispatcher tools.