WordPress as an AI Platform

The MCP Adapter

Learning objectives

By the end of this lesson, you will be able to:

  • Recall that the MCP Adapter is an official WordPress plugin that exposes site capabilities to external AI agents using the Model Context Protocol
  • Explain how the MCP Adapter translates registered WordPress abilities into MCP tools that AI assistants can discover and invoke
  • Install the MCP Adapter on a WordPress site and identify the default server endpoint
  • Configure an MCP client connection for a local development site, a tunneled site, or a production site
  • Evaluate which site capabilities should be exposed as public through the MCP Adapter, and who should be responsible for that decision

The Abilities API and the AI Client both handle what happens inside WordPress: registering capabilities and routing requests to providers. The MCP Adapter works in the other direction. It takes what your site can do and makes it available to external AI agents, turning your WordPress site into a tool that AI assistants can discover and use directly.

What is the Model Context Protocol?

The Model Context Protocol (MCP) is an open standard that defines how AI assistants discover and use tools provided by external systems. Think of it as a common language AI agents use to ask “What can you do?” and then “Do that thing.”

When an AI assistant like Claude Desktop or Claude Code connects to an MCP server (a service that exposes tools in MCP format), it can list the available tools, read what each one does and what inputs it expects, and call them with the right data. The assistant does not need custom integration code for each system it talks to: it follows the MCP standard, and any compatible system responds in kind.

The MCP Adapter turns your WordPress site into one of those compatible systems.

How the MCP Adapter works

The MCP Adapter is a WordPress plugin maintained by the WordPress AI Team at github.com/WordPress/mcp-adapter. It bridges the Abilities API and the MCP specification, translating registered WordPress abilities into MCP tools that external AI agents can discover and invoke.

Public ability discovery. Abilities registered with meta.public set to true are automatically discoverable through the adapter’s default server. A connected AI assistant can list all public abilities, read their schemas, and understand how to call them.

Remember from Lesson 1: The Abilities API that, as of AI plugin 1.3.0, several of the plugin’s own abilities (ai/get-post-details, ai/get-post-terms, core/read-settings, core/read-users, core/read-content) are no longer registered by default. If you want a connected AI assistant to discover and use these, enable the Custom Abilities experiment in Settings > AI > Admin Experiments in addition to installing the MCP Adapter itself. Custom abilities you register yourself are unaffected by this toggle; it only governs the plugin’s own built-in custom abilities.

Permission-controlled execution. Even though the MCP Adapter exposes abilities externally, WordPress permission checks still apply. An ability only executes for authenticated users with the capabilities required by that ability’s permission callback. Public discoverability does not mean unrestricted access.

Default server endpoint. When installed, the adapter creates a default server accessible at /wp-json/mcp/mcp-adapter-default-server. This is the URL you provide to MCP clients when setting up a connection.

Two transport methods. The adapter supports HTTP transport for remote connections over the web, and STDIO transport (communication via standard input/output streams) for local development and command-line workflows using WP-CLI, the WordPress command-line interface.

💡 Why this matters for you: Once the MCP Adapter is installed, AI assistants can interact with your WordPress site as a set of tools. A developer using Claude Desktop or Claude Code could ask the assistant to retrieve recent posts, check site health, or trigger any public ability registered by your plugins, without leaving their AI workflow. This is how WordPress becomes part of a broader ecosystem of AI-powered tools and agents.

📸 Screenshot placeholder: diagram showing an external AI agent such as Claude Desktop connecting to a WordPress site via the MCP Adapter, with the Abilities API registry in the middle providing the list of available tools.

Installing the MCP Adapter

The MCP Adapter is an official WordPress plugin maintained by the WordPress AI Team. It is not yet listed on WordPress.org (submission is planned), so you install it directly from the GitHub Releases page.

From the WordPress admin:

  1. Go to github.com/WordPress/mcp-adapter/releases/latest and download mcp-adapter.zip.
  2. In your WordPress admin, go to Plugins > Add New Plugin > Upload Plugin.
  3. Upload the zip file and activate the plugin.

With WP-CLI:

wp plugin install https://github.com/WordPress/mcp-adapter/releases/latest/download/mcp-adapter.zip --activate

The adapter requires WordPress 6.9 or higher and PHP 7.4 or higher.

📸 Screenshot placeholder: Plugins > Add New Plugin screen showing the Upload Plugin button and file upload area where mcp-adapter.zip would be selected.

Connecting an MCP client

Once installed, you connect an AI assistant by pointing it to your site’s MCP server endpoint. The right approach depends on where your site is running.

Production site (HTTP transport). For a live site accessible on the internet, provide the full URL to the default server. The exact configuration format varies by client; check your AI assistant’s MCP documentation for specifics.

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

Local site, same machine (STDIO transport). If your WordPress site is running locally in an environment like Studio, MAMP, or similar, and your AI agent is running on the same computer, STDIO transport is the recommended approach. It requires no network connection and does not expose your site externally. Add this to your AI agent’s MCP configuration:

{
  "command": "wp",
  "args": [
    "mcp-adapter",
    "serve",
    "--user=admin",
    "--server=mcp-adapter-default-server",
    "--path=/path/to/your/local/wordpress"
  ]
}

Replace /path/to/your/local/wordpress with the actual path to your local site’s root directory. The –user flag sets which WordPress user the MCP session runs as, so choose a user with the capabilities required by the abilities you want to invoke.

Local site, HTTP transport. If you prefer HTTP for a local site, your AI agent can reach it at the loopback address or local domain your environment provides:

http://my-site.local/wp-json/mcp/mcp-adapter-default-server

or

http://localhost:8888/wp-json/mcp/mcp-adapter-default-server

Check your local environment’s documentation for the correct hostname and port.

Local site, remote agent (tunnel required). If you are using a remote AI agent and need it to reach a local site, the local site is not accessible over the internet by default. A tunneling tool creates a temporary public URL that forwards traffic to your machine. Using ngrok:

ngrok http 80

ngrok generates a public HTTPS URL like https://abc123.ngrok.io. Use that as your server address:

https://abc123.ngrok.io/wp-json/mcp/mcp-adapter-default-server

Cloudflare Tunnel is an alternative for more persistent configurations.

Sites behind a reverse proxy. If your site is behind a reverse proxy handling HTTPS termination (such as nginx or Apache), no special MCP Adapter configuration is required beyond a standard WordPress REST API setup. Confirm that the proxy preserves the Host header and forwards the full request path to WordPress, including /wp-json/mcp/.

💡 Why this matters for you: STDIO transport is the right default for local development. It avoids the complexity of tunneling, does not expose your site externally, and runs under the exact WordPress user permissions you specify. Reserve HTTP transport and tunneling for situations where a remote agent needs to reach your site, or when sharing access with a collaborator.

📸 Screenshot placeholder: side-by-side comparison: terminal showing the STDIO wp mcp-adapter serve command on the left, and an AI agent configuration file showing the corresponding JSON config on the right.

AI assistants with MCP support include Claude Desktop and Claude Code. Because MCP is an open standard, support continues to expand across AI tools. [Link — verify current MCP client support before publishing]

Managing your site through conversation

Once your MCP client is connected, you can manage your site by describing what you want in plain language instead of navigating the WordPress admin directly. The AI assistant discovers which public abilities are available, works out which one matches your request, and calls it on your behalf.

Before trying the examples below, confirm the Custom Abilities experiment is enabled in Settings > AI > Admin Experiments. Several of these examples rely on plugin abilities that require this toggle as of AI plugin 1.3.0; without it, the assistant simply won’t see them as available tools.

A few examples of what this looks like in practice, using abilities already covered in this course:

  • “What can you do on this site?” The assistant lists every public ability it has discovered, in plain language, based on each ability’s label and description.
  • “Show me my five most recent draft posts.” The assistant calls an ability that returns recent posts and summarizes the result for you.
  • “Generate an excerpt for my latest draft and show me what it says.” The assistant locates the draft, invokes the excerpt generation ability behind it, and returns the result for your review before anything is saved.
  • “How many comments are waiting for moderation right now?” The assistant calls a moderation-related ability and reports back a count, without you opening Comments > All Comments yourself.

📸 Screenshot placeholder: a conversation in Claude Desktop showing a natural-language request, followed by the assistant listing the abilities it called and the result returned.

The assistant can only see and use abilities registered with meta.public set to true, and every call still passes through that ability’s permission callback. If you ask for something outside what’s registered, or something your connected user account doesn’t have permission to do, the assistant will tell you it cannot complete the request rather than working around it.

💡 Why this matters for you: This is the payoff of everything covered in this module. The Abilities API defines what your site can do, the AI Client and connectors handle the credentials, and the MCP Adapter is what turns that into a conversation you can have instead of a set of screens you have to click through.

What you’ll notice: conversational site management is only as good as the abilities you’ve made public. A site with a handful of registered abilities gives an assistant a handful of things to do. This is part of what makes the practical that follows worth doing: registering your own ability directly expands what a connected assistant can help you with.

WordPress Playground

The MCP Adapter requires an external AI client and cannot be fully demonstrated within Playground alone. To explore which abilities your site would expose through the adapter, install the AI Plugin in Playground, enable the Abilities Explorer experiment in Settings > AI > Admin Experiments, and navigate to Tools > Abilities Explorer. Abilities marked as public are the ones that would appear as MCP tools to a connected AI agent.

Key terms

TermDefinition
Model Context Protocol (MCP)An open standard that defines how AI assistants discover and use tools, resources, and prompts provided by external systems
MCP serverA service that exposes tools, resources, and prompts to AI assistants using the MCP protocol, making them available for the assistant to list, inspect, and call
MCP AdapterAn official WordPress plugin, maintained by the WordPress AI Team at github.com/WordPress/mcp-adapter, that translates registered WordPress abilities into MCP tools for external AI agents
HTTP transportA communication method that uses standard web requests, allowing remote MCP clients to connect to a WordPress site over the internet
STDIO transportA communication method that uses standard input/output streams, typically used for local development and WP-CLI-based MCP connections on the same machine
WP-CLIThe WordPress command-line interface, a tool that lets developers and administrators manage WordPress installations from the terminal using text commands
TunnelA service such as ngrok or Cloudflare Tunnel that creates a public URL routing traffic to a locally running site, making it accessible to remote services or agents
Public abilityAn ability registered in the Abilities API with meta.public set to true, making it discoverable and available to the MCP Adapter’s default server

✅ Check your understanding

  1. The MCP Adapter offers two transport methods: HTTP and STDIO. In what scenarios would you choose each one, and what are the trade-offs between them for a team working across different development environments?
  2. Deciding which abilities to mark as public is a governance decision with real security implications. Who on your site should be responsible for that decision, and what criteria would you use to determine whether an ability is safe to expose?

A note on the Abilities API’s evolving scope: The Abilities API is still an actively developing part of WordPress core. Interfaces and conventions covered in this module may continue to change as the WordPress AI Team refines them. Check the weekly contributor summaries at make.wordpress.org/ai for the latest before building anything you plan to maintain long term.

Up next: Practical: Register an ability & MCP Adapter walks you through registering a custom ability and connecting it to an external AI client.

This is a preview lesson

Please contact the course administrator to take this lesson.

Suggestions

Found a typo, grammar error or outdated screenshot? Contact us.