ZeroToWP
tutorialsby Marvin

How to Connect AI Agents to WordPress: Complete MCP Setup Guide (2026)

Share this article

The first time I tried to connect Claude Desktop to my WordPress site, I did it the wrong way. I pasted the REST API URL into a config file, crossed my fingers, and watched Claude return a very polite error. It took me about an hour of reading GitHub issues to realize that WordPress and MCP actually speak through a specific adapter now — not through the REST API directly — and that the pieces landed in a very different order than the early tutorials suggested.

This guide is the version I wish I had that afternoon. It walks through connecting AI agents to WordPress using the official WordPress MCP Adapter, with real config, real authentication, and honest notes on what still does not work yet. Last updated April 17, 2026, against mcp-adapter v0.5.0, WordPress 6.9, and the MCP spec as of February 2026.

If you are new to the general idea, start with my WordPress Claude AI MCP connector overview, then come back here for the technical setup. Related reading: best WordPress AI chatbot plugins and best WordPress AI internal link plugins.

Connect AI agents to WordPress using the official MCP Adapter and Claude Desktop

TL;DR: Quick Answer

  • What you need: WordPress 6.9+, the wordpress/mcp-adapter plugin, and an MCP client (Claude Desktop, Cursor, VS Code, or Claude Code).
  • Two transports: STDIO for local dev via WP-CLI, HTTP for remote sites via the @automattic/mcp-wordpress-remote proxy.
  • Auth: WordPress Application Passwords for HTTP, local user for STDIO. WordPress.com uses OAuth 2.1 with PKCE.
  • Config file: claude_desktop_config.json — edit via Claude menu → Settings → Developer.
  • Biggest gotcha: only abilities flagged meta.mcp.public are exposed. The plugin ships with a safe default set; you add the rest.

What Is MCP and Why Does It Matter for WordPress?

The Model Context Protocol (MCP) is an open standard Anthropic released in late 2024 that lets AI clients like Claude call external tools in a consistent way. Instead of every app inventing its own plugin format, MCP defines a shared interface for tools, resources, and prompts.

For WordPress, MCP matters because it is the first serious path toward an AI agent that can genuinely operate your site — create posts, update settings, read analytics, fix SEO metadata — without you building a custom integration for every single action. The heavy lifting has been done in WordPress 6.9's Abilities API, which exposes core and plugin capabilities as typed, discoverable functions. The MCP Adapter simply translates those abilities into MCP tools.

So the stack in 2026 looks like this:

  1. WordPress core or a plugin registers an Ability (e.g. "create a post", "list users").
  2. The MCP Adapter exposes abilities marked meta.mcp.public as MCP tools.
  3. An MCP client (Claude Desktop, Cursor) discovers those tools and lets the LLM call them.

Which WordPress MCP Server Should You Use?

Three valid options in 2026, and it is worth picking deliberately:

Option Best for Auth
WordPress/mcp-adapter (official) Self-hosted WordPress sites running 6.9+ Application Passwords or local user
WordPress.com built-in MCP WordPress.com hosted sites (no install needed) OAuth 2.1 with PKCE
WooCommerce MCP Stores needing product, order, and customer tools Application Passwords

The old Automattic/wordpress-mcp repository was archived in January 2026 and now redirects to WordPress/mcp-adapter. If you are starting fresh, ignore the archived repo completely.

Step 1: Install the WordPress MCP Adapter

You have two install paths. Composer is cleaner for production; downloading the release ZIP is easier for one-off testing.

From your WordPress root:

composer require wordpress/mcp-adapter

If you are still on WordPress 6.8, the Abilities API is not in core yet and you need both packages:

composer require wordpress/abilities-api wordpress/mcp-adapter

Option B: Install as a plugin ZIP

  1. Grab the latest release from github.com/WordPress/mcp-adapter/releases (v0.5.0 as of April 15, 2026).
  2. In Plugins → Add New → Upload Plugin, upload the ZIP.
  3. Activate it. A default MCP server named mcp-adapter-default-server is registered automatically.

After activation, confirm the endpoint is live by visiting:

https://your-site.com/wp-json/mcp/mcp-adapter-default-server

You should get a JSON response describing the server. If you get a 404, flush permalinks (Settings → Permalinks → Save Changes) and try again.

Step 2: Create a WordPress Application Password

For HTTP transport (which you almost certainly want for remote sites), the adapter authenticates against WordPress Application Passwords rather than your main login.

  1. Go to Users → Profile.
  2. Scroll to Application Passwords.
  3. Enter a name like Claude MCP and click Add New Application Password.
  4. Copy the generated password immediately — it is shown once.

Treat this password like an API token: anyone with it can act as your user. If this is a production site, consider creating a dedicated WordPress user with the minimum role needed (Editor, not Administrator, if you never need plugin management).

Step 3: Configure Claude Desktop

On macOS, open Claude Desktop → Claude menu → Settings → Developer → Edit Config. On Windows, the file lives at %APPDATA%\Claude\claude_desktop_config.json.

HTTP transport (remote or production sites)

This is the config I run. It uses the official proxy package so Claude Desktop can talk to your WordPress HTTP endpoint:

{
  "mcpServers": {
    "wordpress": {
      "command": "npx",
      "args": ["-y", "@automattic/mcp-wordpress-remote@latest"],
      "env": {
        "WP_API_URL": "https://your-site.com/wp-json/mcp/mcp-adapter-default-server",
        "WP_API_USERNAME": "marvin",
        "WP_API_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
      }
    }
  }
}

The password format with spaces is how WordPress generates it — paste it exactly as shown.

STDIO transport (local development with WP-CLI)

If you are running WordPress locally and have WP-CLI installed, you can skip the HTTP layer entirely:

{
  "mcpServers": {
    "wordpress-local": {
      "command": "wp",
      "args": [
        "--path=/Users/marvin/Sites/mysite",
        "mcp-adapter",
        "serve",
        "--server=mcp-adapter-default-server",
        "--user=admin"
      ]
    }
  }
}

STDIO is faster and skips Application Password management, but it only works where you can run wp on the same machine as Claude Desktop.

Step 4: Restart Claude Desktop and Verify

After saving the config, fully quit and reopen Claude Desktop. The config is only read on startup.

Once it restarts, you should see a tools icon in the message input. Click it to confirm wordpress is listed with tools like create_post, list_posts, and get_site_settings. Ask Claude something concrete:

"List my 5 most recent WordPress posts and tell me which ones are missing a featured image."

If Claude runs the tool and returns real post titles from your site, the connection works. If it says it cannot find the tool, check the Developer log in Claude Desktop — 90% of the time it is either a typo in WP_API_URL or a stale Node cache (run npx clear-npx-cache and retry).

Claude Desktop showing the WordPress MCP server connected with available tools

Step 5: Expose More Abilities (Optional)

By default the adapter only exposes abilities that are explicitly marked meta.mcp.public. This is deliberate — it prevents a plugin from silently exposing a destructive action to every connected AI client. To add your own abilities to the MCP server, register them in a small mu-plugin:

add_action('abilities_api_init', function () {
  wp_register_ability('my-site/summarize-comments', [
    'label'               => 'Summarize recent comments',
    'description'         => 'Returns a short summary of the last N approved comments.',
    'meta'                => ['mcp' => ['public' => true]],
    'execute_callback'    => 'my_site_summarize_comments',
    'permission_callback' => fn () => current_user_can('moderate_comments'),
  ]);
});

Restart Claude Desktop and the new tool appears automatically. This is where MCP gets genuinely interesting — you can expose business logic, not just CRUD.

Security Considerations You Should Not Skip

MCP is powerful, which is another way of saying it can cause real damage if you configure it carelessly. Four rules I apply to every site I connect:

  1. Use a least-privilege user. Do not connect Claude with your main admin account. Create a dedicated user with just the role the agent needs.
  2. Scope abilities tightly. Every ability you mark public is a function an AI can call without asking you again. Audit this list the same way you would audit plugin permissions.
  3. Always use HTTPS. The HTTP transport sends your Application Password on every request. On a non-HTTPS site, that password is effectively public.
  4. Log everything in staging first. Before pointing an MCP client at production, run it against a staging clone. Watch what tools the model actually reaches for — you will be surprised.

For a broader hardening baseline, use my WordPress security guide and lock down WordPress login security before you ever enable MCP on a production site.

Common Errors and Fixes

"MCP server failed to start"

Usually a Node path issue on Windows or an outdated npx cache. Run npx clear-npx-cache, then restart Claude Desktop. If you use nvm, make sure Claude Desktop launches from a shell that has the right Node version on its PATH.

"401 Unauthorized" when Claude calls a tool

The Application Password is wrong, expired, or tied to a user that was deleted. Regenerate it under Users → Profile and update the env block in claude_desktop_config.json.

"Tool not found" after registering an ability

You forgot meta.mcp.public => true, or the abilities_api_init hook fired before your plugin loaded. Move the registration into a mu-plugin or hook it on plugins_loaded with priority 20.

404 at the MCP endpoint

Pretty permalinks are disabled, or you upgraded from an earlier version without flushing rewrite rules. Visit Settings → Permalinks and click Save.

Claude returns generic answers instead of calling tools

The model sometimes needs an explicit nudge. Phrase your request around the data, not the action: "Using the WordPress tools, fetch my 10 most recent posts" works more reliably than "Show me my posts".

Pairing MCP With AI Plugins You Already Use

Affiliate note: the links below are affiliate links. The picks are the ones I actually use.

MCP is great for operating WordPress from outside. For work that lives inside the WordPress editor itself, I still run two specific plugins:

  • AI Engine Pro — in-editor chat, bulk content tools, and a clean way to expose a site chatbot. Works alongside MCP without conflicts.
  • Rank Math AI — for on-page SEO suggestions the MCP agent can then apply via the admin. See my WordPress SEO guide for how these fit together.

Frequently Asked Questions

Do I need WordPress.com or will WordPress.org work?

Both work, but the path differs. WordPress.com has a built-in MCP server with OAuth 2.1 — nothing to install. Self-hosted WordPress.org sites install the wordpress/mcp-adapter plugin and authenticate with Application Passwords.

Which AI clients can connect to WordPress MCP?

Any MCP-compatible client, including Claude Desktop, Claude Code, Cursor, VS Code with the MCP extension, and custom clients built on the MCP SDK. The adapter is client-agnostic.

Is the old Automattic/wordpress-mcp plugin still maintained?

No. That repository was archived in January 2026. Migrate to WordPress/mcp-adapter, which is now the canonical plugin.

Can Claude publish posts automatically or do I have to approve each action?

By default Claude Desktop prompts you to approve each tool call. You can enable "Always allow" per tool, but I would not do that for create_post or update_settings on a production site.

Does MCP work with WooCommerce?

Yes. WooCommerce ships its own MCP integration for product, order, and customer tools. You can install both wordpress/mcp-adapter and the WooCommerce MCP integration side by side.

What does this cost?

The MCP Adapter is GPL-licensed and free. You only pay for the Claude Desktop subscription (or whichever client you use) and for your existing WordPress hosting. No Automattic subscription is required for self-hosted sites.

Is it safe to expose my site to an AI agent?

Safe is the wrong word — it is controllable. You decide which abilities are exposed, which user role the agent runs as, and which transport (STDIO, HTTP, HTTPS) it uses. Treat MCP like giving an assistant their own staff account: you would not hand over your admin password, and you should not here either.

Primary Sources Used

Marvin

Written by Marvin

Our team tests and reviews WordPress products to help beginners make confident choices.

Learn more about our team →

You might also like

Leave A Reply

Thanks for choosing to leave a comment. All comments are moderated, and your email address will NOT be published. Please do NOT use keywords in the name field.