Connect WordPress to Codex CLI

Connect WordPress to Codex CLI

Use WP MCP Connector to give Codex CLI 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 Codex CLI

Add this to ~/.codex/config.toml, swapping in your own endpoint and key from the dashboard:

~/.codex/config.toml
[mcp_servers.my-site]
url = "https://example.com/wp-json/custom-mcp/v1/mcp"

[mcp_servers.my-site.http_headers]
"x-custom-mcp-api-key" = "your-key-here"

Codex configures servers in TOML; static headers go in the http_headers table.

MCP config formats move quickly — if the shape has drifted, your editor’s own MCP documentation is the tiebreaker.

Verify the connection

Restart Codex CLI (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