Tag: MCP

  • How to Manage Your WordPress Blog from Cursor Using MCP

    How to Manage Your WordPress Blog from Cursor Using MCP

    I just published a blog post to my WordPress site without ever opening wp-admin. No browser tab. No Gutenberg editor. I wrote the content in Cursor, told my AI agent to publish it, and it did — complete with categories, tags, and proper formatting.

    This isn’t a hack or a workaround. WordPress now has official MCP (Model Context Protocol) support, which means any AI agent — Cursor, Claude Code, Codex, Gemini CLI — can interact with your WordPress site programmatically. Create posts. Upload media. Manage plugins. Moderate comments. All from the same interface where you write code.

    Here’s how I set it up and why it’s worth doing.

    Why Bother?

    If you already use AI agents for coding, you know the flow: you describe what you want, the agent writes it, and you review. But the moment you need to publish something to WordPress, you break out of that flow entirely. Open a browser. Log in. Navigate to the editor. Paste content. Format it. Add categories. Hit publish.

    With MCP, the agent handles all of that. You stay in your IDE. The content goes from draft to published without a context switch. And it’s not just posts — you get full access to your WordPress admin capabilities.

    The Stack

    Three WordPress plugins and one MCP client configuration. That’s the entire setup.

    ComponentWhat It DoesSource
    Abilities APIWordPress core framework for declaring machine-readable capabilitiesGitHub
    MCP AdapterBridges WordPress abilities to the MCP protocol so AI agents can discover and call themGitHub
    MCP Expose AbilitiesRegisters 61 core WordPress abilities (posts, pages, media, plugins, users, comments, menus, options)GitHub
    MCP client configConnects your AI agent (Cursor, Claude Code, etc.) to the WordPress MCP server via HTTPYour ~/.cursor/mcp.json

    The Abilities API and MCP Adapter are official WordPress packages, maintained by the WordPress core team. MCP Expose Abilities is a free, open-source plugin by Devenia that registers the actual content management abilities.

    Setup: WordPress Side

    Step 1: Install the Plugins

    Go to your WordPress admin (your-site.com/wp-admin) and install these three plugins in order:

    1. Abilities API — download from GitHub releases, upload via Plugins → Add New → Upload Plugin, then activate
    2. MCP Adapter — download from GitHub releases (v0.4.1), install the same way, activate
    3. MCP Expose Abilities — download from GitHub releases, install, activate

    The order matters. Abilities API provides the foundation, MCP Adapter bridges it to MCP, and MCP Expose Abilities registers the actual WordPress capabilities.

    Step 2: Create an Application Password

    The MCP client needs to authenticate with your WordPress site. WordPress Application Passwords are the cleanest way to do this.

    1. Go to Users → Your Profile
    2. Scroll down to the Application Passwords section
    3. Enter a name like cursor-mcp
    4. Click Add New Application Password
    5. Copy the generated password — you only see it once

    This password is scoped to API access only. It can’t be used to log into wp-admin directly, which is a nice security boundary.

    Setup: Cursor Side

    For remote WordPress sites, the connection goes through @automattic/mcp-wordpress-remote, an official proxy package that handles the HTTP transport.

    Add this to your ~/.cursor/mcp.json inside the mcpServers object:

    "wordpress-blog": {
      "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": "your-username-or-email",
        "WP_API_PASSWORD": "your-application-password"
      }
    }

    Replace the URL, username, and password with your actual values. Restart Cursor to pick up the new MCP server.

    What You Get: 68 WordPress Abilities

    Once connected, you can ask your agent to discover what’s available. Behind the scenes, it calls the mcp-adapter-discover-abilities tool and gets back a full inventory. Here’s what MCP Expose Abilities registers:

    CategoryAbilities
    ContentList, get, create, update, delete, patch, search posts & pages; manage revisions, categories, tags
    MediaUpload (from URL), get, update, delete media items
    PluginsList, upload, activate, deactivate, delete plugins
    MenusList, create menus; add, update, delete items; assign locations
    UsersList, get, create, update, delete users
    CommentsList, get, create, reply, update status, delete comments
    OptionsGet, update, list site options
    SystemSite info, environment info, debug log, toggle debug mode, transients

    There are also 12 optional add-ons for Elementor, Rank Math, Wordfence, Cloudflare, GeneratePress, and more — install only the ones your site uses.

    Using It in Practice

    Here’s what it looks like in a real session. I asked my Cursor agent to publish a blog post I’d just drafted. It:

    1. Called content/list-categories to find the right category ID
    2. Created 5 new tags via content/create-tag
    3. Called content/create-post with the full HTML content, category, and excerpt
    4. Called content/update-post to attach the tags

    The post was live as a draft in under 10 seconds. I reviewed it in wp-admin, made one formatting tweak (which I also did via MCP), and published.

    The agent calls look like this under the hood:

    // Discover what's available
    mcp-adapter-discover-abilities {}
    
    // Create a post
    mcp-adapter-execute-ability {
      "ability_name": "content/create-post",
      "parameters": {
        "title": "My Blog Post Title",
        "content": "<!-- wp:paragraph -->n<p>Your content here...</p>n<!-- /wp:paragraph -->",
        "status": "draft",
        "category_ids": [6],
        "excerpt": "A short description of the post."
      }
    }
    
    // Create and assign tags
    mcp-adapter-execute-ability {
      "ability_name": "content/create-tag",
      "parameters": { "name": "AI" }
    }

    Tips and Gotchas

    Use Gutenberg Block Markup

    If you send raw HTML, WordPress will render it but your theme’s block styles won’t apply. For proper formatting, wrap content in Gutenberg block comments:

    <!-- wp:paragraph -->
    <p>Your paragraph text here.</p>
    <!-- /wp:paragraph -->
    
    <!-- wp:code -->
    <pre class="wp-block-code"><code>your code here</code></pre>
    <!-- /wp:code -->
    
    <!-- wp:heading -->
    <h2 class="wp-block-heading">Your Heading</h2>
    <!-- /wp:heading -->

    This is what the Gutenberg editor produces internally. If you tell your agent to use this format, your posts will look identical to ones created in the editor.

    Draft First, Publish Later

    Always create posts with "status": "draft" so you can review before publishing. You can then either publish from wp-admin or tell the agent to update the status:

    mcp-adapter-execute-ability {
      "ability_name": "content/update-post",
      "parameters": {
        "id": 48,
        "status": "publish"
      }
    }

    The Abilities API Is Now in WordPress Core

    As of WordPress 6.9, the Abilities API has been merged into core. If you’re on 6.9+, you may not need the separate Abilities API plugin. The MCP Adapter and MCP Expose Abilities plugins are still required as separate installs.

    Beyond Blog Posts

    The real power isn’t just publishing posts faster. It’s having your entire WordPress site accessible as part of your AI workflow. Some things I plan to use this for:

    • Batch content updates — update metadata, fix formatting, or patch content across multiple posts in one session
    • Plugin management — check plugin status, activate/deactivate, or upload new plugins without leaving the IDE
    • Comment moderation — review and respond to comments as part of a daily routine, all from the terminal
    • Site diagnostics — check debug logs, site info, and environment details when troubleshooting
    • Content pipelines — research a topic, draft in Obsidian, review, then publish to WordPress — all in one agent session

    That last one is exactly what I did today. I researched a topic, drafted a blog post, saved it to my Obsidian vault, then published it to WordPress — all without leaving Cursor.

    The Full Setup Checklist

    For reference, here’s everything in one place:

    1. Install Abilities API plugin (or upgrade to WordPress 6.9+)
    2. Install MCP Adapter plugin
    3. Install MCP Expose Abilities plugin
    4. Create an Application Password in Users → Your Profile
    5. Add the MCP server config to ~/.cursor/mcp.json
    6. Restart Cursor
    7. Ask your agent: “discover my WordPress abilities”

    That’s it. Your WordPress site is now part of your AI workflow.


    Credits and Links:

    This post was written, formatted, and published to WordPress entirely from within Cursor, using the exact setup described above.