Skip to content
WP EngineDocumentation

Connect Claude Code to your WordPress sites

This guide connects Claude Code to your WordPress sites through the AI MCP service, from creating an API key to running your first ability. To configure Claude Desktop, see Connect Claude Desktop.

  • Claude Code installed (install guide)
  • A WP Engine account with at least one WordPress site
  • WP Engine AI access to create API keys

Create a User key with MCP set to Write. An Account key will not do: only a user key carries a person for an ability to run as.

Create a key in the WP Engine User Portal, then copy the secret — a user key starts with wpe_pat_, and it is shown once.

Terminal window
claude mcp add --transport http --scope user wpengine-coworker \
https://api.ai.wpengine.com/v1/mcp \
--header "Authorization: Bearer YOUR_API_KEY_HERE"

Replace YOUR_API_KEY_HERE with the key from step 1.

That one command registers the server, sets the HTTP transport, and stores the header. There is no config file to edit by hand and no restart — start a new session and the tools are there.

--scope user makes the server available in every directory. Without it, Claude Code registers the server only for the directory you ran the command in.

Start a new Claude Code session and ask:

Terminal window
claude "Use the coworker MCP server to list my WordPress sites"

Claude calls list_account_sites and returns your active registered sites, something like:

You have 3 WordPress sites connected:
1. example.com (example-prod) - Active
2. staging.example.com (example-staging) - Active
3. dev.example.com (example-dev) - Active

If no tools appear at all, see Troubleshooting.

Listing sites and searching a knowledge base work with what you have now. Running an ability does not — that needs a second, separate connection between you and each site.

This catches almost everyone out: registering a site with WP Engine grants nobody the ability to act on it, including the administrator who registered it. The two connections explains why.

Complete this once per site:

  1. Ask Claude: “What’s the WordPress connection status for my sites?”

  2. For any site that is not connected, Claude hands you a link. Open it while logged in to that site’s WordPress admin. If no link comes back, build it yourself:

    {site_url}/wp-admin/admin.php?page=power-overview&action=trigger_wp_connection

    Opening this link is the only way to start the connection — there is no option to start it manually anywhere in WordPress.

  3. Review the permissions, then confirm with Connect WordPress User. You land back in wp-admin, now connected. (The consent screen.)

Terminal window
claude "Create a draft post on example.com titled 'Today in the news with WP Engine' using the coworker MCP server"

Claude:

  1. Finds the site’s Create Post ability (wp-engine-ai/create-posts) with search_abilities
  2. Executes it with run_site_ability
  3. Returns the new post ID and a link to the draft

Screenshot: Claude creating a WordPress post via MCP


Last updated: