Skip to content
← Back to Integrations
O

OpenCode MCP Server for WordPress Setup

Model Context Protocol Tutorial

Connect WordPress to OpenCode, the open-source AI coding agent for your terminal. Add Easy MCP AI to opencode.json in your project with an API token, and OpenCode can manage your site's content from the command line. One config file to edit.

File: opencode.json in your project

  1. In WordPress, open Easy MCP AI → Dashboard, click Connect an AI client (the card is already open if nothing is connected yet) and choose OpenCode.
  2. Under Get an API token, click Create a token. On Connections → API tokens, choose the user and what the token may do (Read-only, Full access or Custom), then copy the token: it is shown only once. You can also use a token you already have.
  3. Add the config to opencode.json in your project and replace YOUR_API_TOKEN with your token. If the file already has an mcp object, add wordpress inside it. Use the MCP URL from the dashboard sidebar in place of the example address.
{
    "mcp": {
        "wordpress": {
            "type": "remote",
            "url": "https://yoursite.com/wp-json/easy-mcp-ai/v1/mcp",
            "headers": {
                "Authorization": "Bearer YOUR_API_TOKEN"
            }
        }
    }
}
  1. Back on the Easy MCP AI dashboard, the top of the page shows Connected: 1 API token (a higher number if you already had other connections). Ask OpenCode something simple, like “List my latest posts”: the call appears under Recent activity in the dashboard sidebar.

Need your API Token?

Remember to create your Bearer token in the WordPress admin under Easy MCP AI → Connections → API tokens before completing this setup.

Download Plugin