3 min read 1 wk ago

MCP Server: Claude Code

Make sure to read the WordPress MCP Server to set up your environment in AI Engine before starting here.

Using AI Engine MCP with Claude Code is one of the easiest ways to set up and use your WordPress server as an MCP server.

First, make sure your Claude Code client is up to date:

claude update

In AI Engine > Settings > MCP, open the Claude Code tab of the Connect an AI assistant card. It gives you a command like this one to copy and run in your terminal:

claude mcp add --transport http yoursite https://yoursite.com/wp-json/mcp/v1/http
Connect card with the Claude Code steps

Then, in Claude Code, run /mcp, pick your site and authenticate. Your browser opens the AI Engine authorization page on your site: log in to WordPress if asked (as an administrator, or as an Editor when Editor Access is on), choose Full access or Read-only, and click Approve. The card turns to Connected, and the connection appears in Connections, where you can switch its access or revoke it later.

Connect with the Bearer Token

If you prefer a token (for scripts, or a server with no browser), set one in the Bearer Token section of MCP Settings. That section shows two ready-made commands, and the only difference between them is how the token is sent: in an Authorization header, or inside the URL. The URL version also works on servers that remove the Authorization header. The token acts as an administrator, limited by its Access Level, so keep it secret.

Bearer Token section with the Claude Code commands

Heads up: in this example, everything is running locally on a test server, so it uses HTTP instead of HTTPS. In your case, make sure to use HTTPS for a secure connection.

With the URL version, you should see in your console:

❯ claude mcp add meow-local http://meow.local/wp-json/mcp/v1/ThisIsASecretBearerToken --transport http
Added HTTP MCP server meow-local with URL: http://meow.local/wp-json/mcp/v1/ThisIsASecretBearerToken to local config
File modified: /Users/user/.claude.json [project: /Users/user]

To remove it later, run claude mcp remove meow-local.

Use it

And you are done! 🎉 Use Claude Code as usual: it now has access to all the tools exposed by your WordPress server through AI Engine. If you turn more tool sets on later, run /mcp and reconnect so Claude Code loads the new list.

In the example below, both the Social Engine and SEO Engine plugins are installed, so their respective tools are also available directly within Claude Code.

Something not working? See MCP Connection.