Get the plugin
WP MCP/Docs/Claude Code and WordPress

Claude Code and WordPress · connection guide

Claude Code and WordPress: one command to connect.

Claude Code works on a WordPress site through an MCP server. WP MCP is a free WordPress plugin that adds one, so Claude Code can read and edit posts, pages, blocks, menus, media and settings over HTTP, with no SSH or file access to the server, and with a snapshot saved before every write.

Free and GPL-2.0 · self-hosted · snapshot before every write

Before you start

What you need.

  • A WordPress 6.9 or newer site on PHP 8.1 or newer, with the free WP MCP plugin installed and active.
  • A WordPress user for the agent with at least the edit_posts capability (Editor or Administrator). A dedicated user is easier to audit and revoke than your own account.
  • The WP MCP, Connection screen in wp-admin. It creates the application password and shows every snippet below already filled in for your site.

Connect

3 ways to connect Claude Code to WordPress.

01 / Easiest

The one-line command

Signs in with a WordPress application password, sent as a Basic header.

  1. In wp-admin open WP MCP, Connection and create an application password. The screen shows this command with your site and credential filled in.
  2. Run it in your project directory.
  3. Start Claude Code and ask it to list your post types to confirm.

terminal

claude mcp add --transport http wpmcp https://your-site.com/wp-json/mcp/wpmcp-server \
  --header "Authorization: Basic BASE64_OF_username:application-password"

02 / Per project

A .mcp.json entry

The same application password, in the project's config file.

  1. Create the application password under Users, Profile, Application Passwords, or on the Connection screen.
  2. Encode username:application-password as Base64, keeping the spaces WordPress generated.
  3. Add the entry to .mcp.json in the project root. Keep the file out of version control if it holds a real credential.

.mcp.json

{
  "mcpServers": {
    "wpmcp": {
      "type": "http",
      "url": "https://your-site.com/wp-json/mcp/wpmcp-server",
      "headers": {
        "Authorization": "Basic BASE64_OF_username:application-password"
      }
    }
  }
}

encode the credential

echo -n "your-username:xxxx xxxx xxxx xxxx xxxx xxxx" | base64

03 / No credentials

Local development: the WP-CLI stdio bridge

Runs as a local process; no HTTP sign-in at all.

  1. On a machine that has WP-CLI and the site's files, Claude Code can run WP MCP over stdio instead of HTTP.
  2. Register the command wp mcp-stdio serve as a local MCP server, run from the WordPress directory. It needs the global --user flag, because WP-CLI runs as no user by default and the server refuses to start without one.

the command the client runs

claude mcp add wpmcp-local -- wp mcp-stdio serve --user=admin --path=/path/to/wordpress
The WP MCP Audit Log Requests tab: one row per MCP tool call with time, tool name, client, outcome, duration and a View in History link to the undo point.
After Claude Code connects, every tool call appears in the WP MCP Audit Log, with a link to its undo point. Captured on a local test site.

Which client

What works best today, client by client.

The Claude clients are the most tested path and work on a default install with an application password. Clients that can only sign in with OAuth, ChatGPT among them, need OAuth switched on first: it ships off.

ClientHow it signs inSetup it needsHow well tested
Claude CodeApplication passwordOne command, or one .mcp.json entry. Works on a default install.Most tested, alongside Claude Desktop.
Claude DesktopApplication password (desktop bundle or config file). OAuth for the custom connector.Download the bundle from the Connection screen and enter the password. The custom connector needs OAuth switched on first.Most tested, alongside Claude Code.
CursorApplication passwordOne entry in .cursor/mcp.json. Works on a default install.Supported through the standard MCP config. Our own testing is done mostly with Claude clients.
ChatGPTOAuth only. It cannot send an application password.A site administrator switches OAuth on in wp-config.php (it ships off), then adds the site in ChatGPT as a custom MCP server.Works through OAuth once it is enabled. Not fully tested yet. A one-click switch is planned.

Check it

Verify the connection.

Ask Claude Code to call list-post-types or list-posts. A result means it works. On a 401 or 403, check that the WordPress user has edit_posts and that the Base64 string was built from username:application-password with the spaces kept.

If it does not work

Common snags.

401 on every call
The Base64 value is wrong or the application password was revoked. Re-create it on the Connection screen and copy the command again.
Some tools refuse to run
Risky tools (database writes, file writes, package updates, deletes) ship off and answer with the exact filter that enables them. That is by design.
Tools missing for a builder
Builder and block suite tools appear when that plugin is active, and deep builder editing is part of WP MCP Pro.

Frequently asked

Claude Code and WordPress: questions, answered.

Is there a Claude Code WordPress plugin?

WP MCP is the WordPress side: a plugin that turns the site into an MCP server. Claude Code needs no plugin of its own; you add the site with claude mcp add or a .mcp.json entry.

Can Claude Code edit a live WordPress site?

Yes, through WP MCP's tools, and every write is snapshotted first so a change or a whole session can be rolled back from wp-admin or by the agent itself.

Does Claude Code need SSH or file access to the server?

No. It talks to the MCP endpoint on your site over HTTPS as a WordPress user. File and database tools exist but are off by default and limited to administrators.

Can I use it on a local site?

Yes. Use the HTTP endpoint of the local site, or the WP-CLI stdio bridge, wp mcp-stdio serve --user=admin, which needs no HTTP credentials, only a WordPress user to act as.

What can Claude Code do in WordPress with this?

Create and edit posts and pages, edit Gutenberg blocks, manage media, menus, users, comments and settings, run WooCommerce and SEO metadata work, and read performance and security reports. Page builder editing is on Pro.

Is it free?

The plugin is free and GPL, including the undo engine. WP MCP Pro adds deep page builder editing and unlimited history.

Connect Claude Code to your WordPress site.