Claude Code
Add the MCP server
Section titled “Add the MCP server”claude mcp add my-site \ --transport http \ --url "https://YOUR-SITE.com/wp-json/mcpwp/v1/mcp" \ --header "X-API-Key: mcpwp_YOUR_KEY"This saves the config to your project’s .claude/mcp.json. The server is available in all Claude Code sessions in that directory.
Header auth (--header) is the working connect method today and the more secure one — the key lives in a request header, never in the URL, so it won’t show up in shell history from the URL alone, in connector-settings screens, or in URL-based logs. Prefer this over URL-embedded keys whenever the client supports it.
Verify
Section titled “Verify”claude mcp listPer-project config
Section titled “Per-project config”For a project-scoped setup, add .claude/mcp.json to your repo:
{ "mcpServers": { "my-site": { "url": "https://YOUR-SITE.com/wp-json/mcpwp/v1/mcp", "headers": { "X-API-Key": "mcpwp_YOUR_KEY" } } }}Add the key to .env and reference it via an environment variable if you need to avoid committing secrets.
First call
Section titled “First call”Start each session with wp_introspect (machine-readable capabilities), then wp_onboard (full site briefing) before making any changes.