How to connect your WordPress site to Claude Code
Claude Code can manage your self-hosted WordPress site from the terminal — publishing posts, running WP-CLI, and editing theme files by request. Install the free Cowboy MCP plugin, run claude mcp add to register your site as a remote MCP server, and click Approve on your own site. That's it: one-click sign-in means no API key to copy, store, or lose. It's fully self-hosted, with no Node.js bridge or proxy to run. New to MCP? Start with the WordPress MCP server guide.
What can Claude Code do on your WordPress site once it's connected?
Once connected, Claude Code acts on your live site with real tools, not just code you paste in yourself. It can vibe code a theme or plugin, run WP-CLI commands, read the PHP error log to debug what broke, and make bulk edits across posts or WooCommerce products. Cowboy MCP exposes 203 WordPress tools that Claude Code calls straight from your terminal.
How do you connect Claude Code to WordPress in three steps?
Connecting takes about two minutes. Install the Cowboy MCP plugin, run the two commands from the Claude Code panel under Settings → Cowboy MCP, and click Approve on your own site — one-click sign-in. There's no key to copy or keep safe, no setting to switch on first, and no config file to hand-edit. You decide exactly what Claude Code may do before it can do anything, and it works the same on a local dev site.
- 1
Install the free plugin
In WordPress, go to Plugins → Add New, search for Cowboy MCP, and click Install then Activate.
- 2
Run the two commands
Open Settings → Cowboy MCP, pick Claude Code on the Connections tab, and copy its two lines — claude mcp add, then claude mcp login — into your terminal.
- 3
Click Approve
Your browser opens a sign-in page on your site. Choose what Claude Code may do — everything, read-only, or just the tools you pick — and click Approve. Nothing is allowed until you do.
Then open a new Claude Code session and run /mcp — your site should be listed as connected. Over SSH? Add --no-browser to the second line and open the printed URL in a local browser.
Headless or CI? Generate an API key on the Connections tab (it's shown once) and add --header "Authorization: Bearer YOUR_API_KEY" to the first line instead of running the second.
Why doesn't Claude Code need a Node.js bridge to reach WordPress?
Many MCP setups run a local Node.js process that proxies requests between the AI and a remote service. Cowboy MCP needs none of that. The MCP endpoint is a standard WordPress REST route at /wp-json/cowboy-mcp/v1/endpoint, so Claude Code connects to your site directly over HTTPS — no bridge process, no npm install, and nothing extra to keep running. The plugin is itself the MCP server.
That means the setup survives reboots and laptop swaps: the connection lives on your server, not in a background daemon on your machine. It also means the same endpoint works for every MCP client — Claude Desktop and claude.ai, Cursor, Codex — so switching tools never means re-plumbing the site.
Is it safe to run Claude Code against your live production site?
Yes, with the same guardrails the plugin applies to every client. Safe mode is on by default, so destructive tools ask for confirmation before they run. Any write can be previewed as a dry run, every change lands in a per-change undo journal you can roll back, and requests are rate-limited to 120 per minute. It all runs on your own server. More on security →
Questions, answered.
Do I need Node.js or npm to connect Claude Code?
No. Cowboy MCP runs entirely inside WordPress as a REST endpoint, so there's no Node.js bridge, no npm install, and no local proxy to keep running. You only need Claude Code, the claude mcp add command, and one click to approve the sign-in.
Do I need an API key to connect Claude Code?
No — that's the point of one-click sign-in. claude mcp login opens a sign-in page on your own site, where you choose full access, read-only, or a custom list of tools and click Approve. There's no secret to copy, paste, or store, so there's nothing to leak, and Claude Code is recognised automatically, so there's no setting to switch on first. API keys remain for headless setups and CI — generate one on the Connections tab under Settings → Cowboy MCP; it's shown once and stored only as a hash. Every connection and key is listed there with one-click revoke.
What's the difference between Claude Code and Claude Desktop for WordPress?
Claude Code is the terminal client: you add your site with two commands and approve the sign-in in your browser. Claude Desktop and claude.ai connect with no terminal at all, from an Add to Claude button. Both reach the same tools on your site — pick whichever you already work in.
Can I use it on a live production site?
Yes, with care. Safe mode asks before destructive actions, writes can be previewed as a dry run, and every change lands in an undo journal you can roll back. Take a database checkpoint before big changes, and review the audit log regularly.
Ready to connect Claude Code to your WordPress site?
Install the free, open-source Cowboy MCP plugin, run two commands, and approve the sign-in in your browser — Claude Code is managing your site minutes later. It works on any self-hosted WordPress site running version 6.2 or newer on PHP 8.0+. If you'd rather use the browser than the terminal, the Claude Desktop and claude.ai guide covers the no-terminal path.