What is MCP and How to Control WordPress with AI Agents

For the last two years, we’ve been chatting with AI about our WordPress sites. We ask ChatGPT to write a plugin, we copy the code, we paste it, we debug it, and we repeat. It’s useful, but it’s manual.

What if the AI could just do it?

Enter the Model Context Protocol (MCP). Released as an open standard by Anthropic, MCP is rapidly becoming the “USB-C port” for AI applications. It allows AI models (like Claude or open-source LLMs) to securely connect to your local data and tools—including your WordPress installation.

In this guide, we’ll explain what MCP is, why it changes the game for agencies, and provide a step-by-step tutorial on connecting Claude Desktop to a WordPress site.


What is the Model Context Protocol (MCP)?

The Model Context Protocol (MCP) is an open standard that standardizes how AI assistants interact with external systems.

Think of it this way:

  • Before MCP: An AI is a brain in a jar. It knows a lot, but it has no hands. It can’t see your local files or click buttons on your website.
  • With MCP: You give the AI “hands” (tools) and “eyes” (resources). It can read your database, execute CLI commands, and push updates via API—all through a standardized interface.

For WordPress developers, this means you can stop copy-pasting code. Instead, you can tell your AI: “Check the error logs on the staging site, fix the syntax error in functions.php, and create a draft post summarizing the fix.” And it actually does it.


Why Use MCP with WordPress?

This isn’t just about writing blog posts faster. It represents a shift toward Agentic AI—AI that takes action.

  1. Local Development speed: Connect your AI directly to your local wp-content folder. It can scaffold plugins and edit files in real-time.
  2. Site Management: Use natural language to manage complex tasks like “Update all plugins that have a security vulnerability” (requires specific tool implementation).
  3. WooCommerce Automation: Imagine telling your AI, “Find all products with 0 stock and set them to ‘Draft’.”
  4. No more proprietary APIs: MCP is a standard. Once you set up an MCP server for your site, it works with Claude, Cursor, and any future AI client that supports the protocol.

Tutorial: How to Connect Claude to WordPress via MCP

Let’s get technical. We are going to set up a connection where your local Claude Desktop App can talk to a WordPress site.

Prerequisites

  • Claude Desktop App installed (macOS or Windows).
  • Node.js (v18+) installed on your machine.
  • A WordPress site (Local or Staging) with Application Passwords enabled.

Step 1: Get Your WordPress Credentials

For the MCP server to talk to WordPress, it needs permission.

  1. Go to WP Admin > Users > Profile.
  2. Scroll down to Application Passwords.
  3. Name it “MCP Agent” and copy the generated password. Do not lose this.

Step 2: The MCP Configuration

You don’t need to write a custom server from scratch; you can use existing open-source MCP servers. We will use a standard Node.js based MCP server for WordPress.

Open your Claude Desktop config file:

  • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add the following configuration (using npx to run the server directly without installing it globally):

{
  "mcpServers": {
    "wordpress": {
      "command": "npx",
      "args": [
        "-y",
        "@automattic/wordpress-mcp-server" 
      ],
      "env": {
        "WP_URL": "https://your-site.local",
        "WP_USERNAME": "your_admin_username",
        "WP_PASSWORD": "your_application_password_here"
      }
    }
  }
}

Note: There are several community MCP servers available. The example above uses a common pattern, but check repositories like @modelcontextprotocol/server-wordpress or similar if you need specific CLI features.

Step 3: Restart and Test

  1. Save the JSON file.
  2. Completely quit and restart Claude Desktop.
  3. Look for the 🔌 (plug icon) in the Claude interface. It should show “Connected to 1 Server”.

Step 4: Prompting Your Agent

Now, the magic happens. You don’t ask about WordPress; you ask it to act on WordPress.

Try these prompts:

“Fetch the last 5 posts from my site and generate a new post summarizing them. Set the status to ‘Draft’.”

“List all the categories on my site and create a new one called ‘AI Trends’.”

“Get the media ID for the image titled ‘Logo’ and attach it to the ‘Hello World’ post.”


Pros and Cons for Agencies

Before you roll this out to your entire dev team, consider the trade-offs.

✅ The Pros

  • Context Awareness: The AI knows your specific site structure, tags, and content history.
  • Security: MCP runs locally on your machine. You aren’t giving your API keys to a random 3rd party website; they stay in your local config.
  • Efficiency: Eliminates context-switching between your IDE, browser, and AI chat window.

❌ The Cons

  • Read vs. Write Risk: Giving an AI “Write” access to your database is risky. Always use a staging site or local environment first.
  • Complexity: It requires a slightly technical setup (editing JSON files, handling Node.js).
  • Token Usage: Reading your entire database schema or post history consumes significant AI context tokens, which can get expensive.

Conclusion

The Model Context Protocol is the first step toward a future where we don’t just talk to computers—we partner with them. For WordPress agencies, mastering MCP now means you’ll be ready when AI agents become the standard way we build and manage websites in 2026.

Start small: Set up a local environment, connect Claude, and try automating your content drafting process.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *