Connect WordPress to VS Code
Use WP MCP Connector to give VS Code full, structured control of a WordPress site: content, media, page-builder layouts and plugin files.
Prerequisites
- WP MCP Connector installed and activated on the site.
- Your API key and endpoint URL from Dashboard → MCP — the settings screen shows a ready-made config block.
Add the server to VS Code
Add this to .vscode/mcp.json, swapping in your own endpoint and key from the dashboard:
{
"servers": {
"my-site": {
"type": "http",
"url": "https://example.com/wp-json/custom-mcp/v1/mcp",
"headers": { "x-custom-mcp-api-key": "your-key-here" }
}
}
}
VS Code uses a top-level servers key — not mcpServers — and the tools appear in Copilot’s agent mode.
MCP config formats move quickly — if the shape has drifted, your editor’s own MCP documentation is the tiebreaker.
Verify the connection
Restart VS Code (or reload its MCP servers), then ask for your site info. A call to wp_get_site_info should return your site name, active theme and detected page builders.
Troubleshooting
- 401 Invalid API Key — the key in your config does not match Dashboard → MCP. Copy it again; regenerating the key invalidates old configs.
- Tools not appearing — fully restart the editor or reload its MCP server list; most editors cache the tool manifest.
- The endpoint must be reachable over HTTPS from your machine. If the site uses an IP allowlist, add your current address.
Full tool reference and security notes · Works the same in Claude Code · Cursor · Windsurf · VS Code · Cline · Zed · Gemini CLI · Antigravity · Codex CLI · Get the plugin