Connect Claude Code
One command adds your site, and one sign-in in the browser connects it. This is how we run the Toolkit day to day: Claude Code in the editor, pointed at a staging site.
Before you start
Install and activate the MCP Adapter and the Toolkit (Get started has both). Then, in wp-admin, open Settings → AI Toolkit. It opens on the Connect tab. The MCP server URL is at the top of every tab with a Copy button. It looks like this:
https://your-site.com/wp-json/mcp/ppok-ai-toolkit/
Under Status, click Test the addresses to check that the endpoint answers. Then the tab asks two things: your site's name, which becomes the connection's name, and which client you're connecting. It shows that client's steps with both filled in. This guide follows the same steps and adds the detail the tab leaves out.
From version 2.0.1 the same endpoint also answers at the shorter https://your-site.com/mcp. The Connect tab lists it when your host allows it; test it before you rely on it.
Your site needs HTTPS. Connecting a staging site and a live site? Each one has its own URL, so add them as two connectors with names you can tell apart.
Add the server
-
Run
claude mcp addOn the Connect tab, choose Claude Code and copy the command it shows. It already has your URL in it, and a name made from your site's name. It looks like this:
claude mcp add --transport http your-site https://your-site.com/wp-json/mcp/ppok-ai-toolkit/your-siteis the name of the connection. Use the same name in the commands below.As written, the command adds the site to the current project only. To have it in every project, add
--scope userbefore the name;--scope projectshares it with your team through the project's.mcp.json. -
Sign in
Start Claude Code, run
/mcp, pick the server and follow the steps in your browser. You can also runclaude mcp login your-sitefrom the terminal. If the browser can't hand back to Claude Code, paste the full callback URL into the prompt Claude Code shows.Sign in from an interactive session first. Non-interactive runs like
claude -pcan't open the browser to do it.
Several sites? The Connect tab names each one after its site. If two would come out the same, change one, like your-site-staging and your-site, so you always know which one a session is writing to.
Signing in
-
Log in to WordPress
Your client opens your site's login page in the browser. Log in as the account the agent should work as. It gets that account's permissions and nothing more.
-
Choose what it can do
The Authorize MCP client screen lists what the client is asking for. Read access comes ticked. Under Write access, tick only the abilities you want it to use, then click Authorize.
Write abilities also have to be switched on, on the Abilities tab under Settings → AI Toolkit. The post types and statuses they're allowed to touch are set on the Write rules tab.
Disconnecting
Run claude mcp logout your-site first. That revokes the token on your site. Then claude mcp remove your-site removes the server. Removing it on its own deletes the token from your computer but leaves it valid on the site until it expires.
Check that it works
Start with something read-only, like: “List the block types registered on this site, grouped by plugin.” If it answers with your theme's blocks, you're connected.
If it won't connect
- Your host blocks
/wp-json/. Use the fallback URL under “If it does not connect” on the Connect tab. It looks likehttps://your-site.com/?rest_route=/mcp/ppok-ai-toolkit. - Sign-in never starts. Open
https://your-site.com/.well-known/oauth-authorization-serverin a browser. It should show a page of JSON. If it doesn't, a server rule or security plugin is catching that path. - Not sure where it's failing. The Connect tab has a status checklist and a “Test the addresses” button, which checks from the server. It also has a test command to run from a terminal, which shows whether the address answers from outside.
- A security plugin limits the REST API. Sign-in uses
/wp-json/ppok/v1/and the agent uses/wp-json/mcp/. Both have to answer requests from your client.
To disconnect a client later, revoke it on the Clients tab. It has to sign in and be approved again to reconnect.