# Connect an AI Agent to WordPress Without Custom Plugins

- Link: https://dev.ejohnny.ro/connect-ai-agent-wordpress-tutorial/
- Published: 2026-10-17T23:10:52+03:00
- Author: eJohnny

## What the WordPress MCP Adapter Is

The **WordPress MCP Adapter** is an official plugin that exposes WordPress through
the Model Context Protocol (MCP). It takes WordPress’s Abilities API — introduced
in WordPress 6.9 — and turns each registered capability into an MCP tool that any
MCP-compatible AI client can discover and call.

That means your AI agent (Claude Desktop, Cursor, VS Code, Claude Code, OpenCode,
etc.) can ask your site what it can do, then act on it: read posts, create drafts,
update pages, list users, and more — without you writing custom integration code.

## Where to Find the Plugin

 * **WordPress plugin directory:** search for `mcp-adapter` in WP Admin → Plugins
   → Add New.
 * **GitHub releases:** the official repository is `WordPress/mcp-adapter`; download
   the latest release ZIP from the Releases tab.
 * **Version to use:** v0.7.1 (the current stable release at time of writing).

## Step 1: Install the Plugin

 1. Log in to your WordPress admin dashboard.
 2. Go to **Plugins → Add New Plugin**.
 3. Search for `mcp-adapter`, then click **Install Now** and **Activate**.
 4. Or: download the ZIP from GitHub, go to Plugins → Add New → Upload Plugin, select
    the ZIP, install, and activate.
 5. After activation, the plugin exposes the Abilities API at `/wp-json/wp-abilities/
    v1/abilities` on your site.

## Step 2: Create a Dedicated Application Password

Do not use your main administrator password. Create a dedicated WordPress user with
limited capabilities, then generate an application password for that user.

 1. Go to **Users → Add New** and create a user (for example, `mcp-agent`) with the**
    Author** or **Editor** role — never Administrator unless you absolutely need it.
 2. Go to **Users → Profile** (for that user) and scroll to **Application Passwords**.
 3. Enter a name like `mcp-agent-connection` and click **Add New Application Password**.
 4. WordPress will show a **16-character application password** only once. Copy it 
    immediately and store it in your local password manager. You will not see it again.

## Step 3: Configure the MCP Server in OpenCode

OpenCode connects to MCP servers through its MCP configuration. You need the WordPress
site URL, the dedicated username, and the application password.

### Option A: Remote MCP server (recommended for shared hosting)

If you cannot run WP-CLI locally (typical on shared hosting), use the remote MCP
proxy:

    ```
    # ~/.opencode/mcp.json (or your client’s MCP config)
    {
      "mcpServers": {
        "wordpress": {
          "command": "npx",
          "args": [
            "@automattic/mcp-wordpress-remote@latest",
            "--url=https://your-site.com",
            "--username=mcp-agent",
            "--password=YOUR_16_CHAR_APP_PASSWORD"
          ]
        }
      }
    }
    ```

Replace `your-site.com`, `mcp-agent`, and `YOUR_16_CHAR_APP_PASSWORD` with your 
actual values. Never commit this file to version control.

### Option B: Local STDIO (if you run WordPress locally with WP-CLI)

    ```
    {
      "mcpServers": {
        "wordpress": {
          "command": "npx",
          "args": [
            "@wordpress/mcp-adapter@latest",
            "--path=/path/to/your/wordpress"
          ]
        }
      }
    }
    ```

## Step 4: Verify the Connection

Open a chat in OpenCode and run a discovery command:

    ```
    > List the abilities available on my WordPress site.
    ```

The agent should respond with something like:

    ```
    Available abilities on your WordPress site:
    - get_site_info
    - get_users
    - get_posts
    - create_post
    - update_post
    - delete_post
    - get_pages
    - create_page
    ```

## Demo Examples: What You Can Ask the Agent

  |  Goal |  What to type in OpenCode |  
   |  Check site status |  `> Get site info from my WordPress site.` |  
 |  List recent posts |  `> Show me the 5 most recent posts on my site.` |  
 |  Read a specific post |  `> Get the post with slug “my-article”.` |  
 |  Create a draft |  `> Create a draft post titled “AI Weekly Roundup” with the content: “This week in AI…”` |  
 |  Publish a post |  `> Publish the draft post titled “AI Weekly Roundup”.` |  
 |  Update a page |  `> Update the “About” page to add a new team member bio.` |  
 |  List users |  `> List all users on my WordPress site.` |

## Security Checklist

 * Use a dedicated user with limited capabilities (Author/Editor), not Administrator.
 * Store the application password in a credential manager, never in plain text.
 * Never commit `mcp.json` or any file containing the app password to Git.
 * Prefer read-only abilities for public-facing endpoints.
 * Grant publish/delete only when explicitly needed.
 * Review your site’s activity logs periodically.

## What Your Agent Can and Cannot Do

Once connected, your agent operates within WordPress’s normal permission system.
It can only do what its user account is allowed to do. If the user is an Author,
the agent cannot install plugins, change themes, or delete other users’ content.
The Abilities API declares each capability’s permissions, so destructive actions
are gated by role.

### Share this:

 * [  X ](https://dev.ejohnny.ro/connect-ai-agent-wordpress-tutorial/?share=twitter)
 * [  Facebook ](https://dev.ejohnny.ro/connect-ai-agent-wordpress-tutorial/?share=facebook)
 * [More](https://dev.ejohnny.ro/connect-ai-agent-wordpress-tutorial/#)

 * [  LinkedIn ](https://dev.ejohnny.ro/connect-ai-agent-wordpress-tutorial/?share=linkedin)
 * [  Reddit ](https://dev.ejohnny.ro/connect-ai-agent-wordpress-tutorial/?share=reddit)
 * [  Tumblr ](https://dev.ejohnny.ro/connect-ai-agent-wordpress-tutorial/?share=tumblr)
 * [  Pinterest ](https://dev.ejohnny.ro/connect-ai-agent-wordpress-tutorial/?share=pinterest)
 * [  Telegram ](https://dev.ejohnny.ro/connect-ai-agent-wordpress-tutorial/?share=telegram)
 * [  WhatsApp ](https://dev.ejohnny.ro/connect-ai-agent-wordpress-tutorial/?share=jetpack-whatsapp)
