MCP servers for WordPress: letting AI agents work with your site safely
What the Model Context Protocol is, why it matters for WordPress, and how to expose site abilities to AI without giving away the keys.

· 2 min read
AI assistants are only as useful as the systems they can reach. The Model Context Protocol (MCP) is an open standard that lets an AI agent discover and call tools, and WordPress turns out to be a natural fit for it.
Why MCP and WordPress fit together
WordPress already has a capability model, a REST API and, more recently, the Abilities API that the core AI team has been working on. MCP gives agents a standard way to find those abilities and call them:
- "Draft a post from these notes and save it as pending."
- "Which WooCommerce orders from last week are still unfulfilled?"
- "Update the alt text on every image missing it."
Principles I follow
- Least privilege. Give the agent its own application password tied to a role with only the capabilities it needs.
- Read first, write later. Start with read-only abilities and only add writes once you trust the output.
- Humans approve the irreversible. Agents can draft, but publishing or deleting needs a person to sign off.
- Log everything. Every ability call should leave an audit trail.
A tiny ability, registered
// Simplified example: check the Abilities API docs for the full argument list.
add_action( 'wp_abilities_api_init', function () {
wp_register_ability( 'site/count-drafts', [
'label' => 'Count draft posts',
'description' => 'Returns the number of posts in draft status.',
'permission_callback' => fn() => current_user_can( 'edit_posts' ),
'execute_callback' => fn() => [ 'count' => (int) wp_count_posts()->draft ],
] );
} );Once an ability like this is registered, an MCP adapter can expose it to any compatible client.
Where this is heading
I expect MCP to become as routine for WordPress sites as the REST API is now. If you'd like help getting your site ready, get in touch.