Connect Claude Code
Add RankKit SEO to Claude Code with one terminal command and an agent token, then let Claude audit and fix your WordPress SEO.
On this page
Claude Code connects to RankKit SEO's MCP server over HTTP with an agent token. The same command works in Claude Code in your terminal and in the Code tab of the Claude desktop app.
Because Claude Code runs on your computer, it can also reach a local or staging WordPress site, as long as your computer can open the site's URL.
Before you start
- Agent access is on: RankKit SEO → AI Agents → Allow AI agents to connect. See Connect an AI agent.
- You are an administrator, or your role has the AI Agents permission in the role manager.
Step 1: Create a token
- Go to RankKit SEO → AI Agents and click Create token in the Agent tokens card.
- Name it, for example "Claude Code".
- Pick an expiry and a Permissions preset. Content editor lets Claude edit titles, descriptions, keywords and alt text and use your AI key. Choose Full if you also want it to manage redirects and SEO settings.
- Click Create token.
The token is shown once. RankKit SEO also fills it into the snippets in the Connect an AI client card.
Step 2: Add the server
Open the Claude Code tab in the Connect an AI client card and copy the command. It looks like this, with your site's endpoint and your token:
claude mcp add --transport http rankkit https://example.com/wp-json/speedrank/v1/mcp \
--header "Authorization: Bearer sr_your_token_here"
Run it in your terminal. This registers an MCP server named speedrank.
Tip Connecting several sites? Give each one its own name instead of
speedrank, for examplespeedrank-shopandspeedrank-blog, and use a separate token for each site.
Step 3: Check that it works
Start Claude Code and ask:
Run site_overview and summarise my site's SEO.
Claude calls the site_overview tool and answers with your site name, enabled modules, content counts, the latest audit score and any changes waiting for approval. Back in wp-admin, the token's Last used column changes from Never to a time and a call count, and the call appears in the Activity card.
Use the ready-made workflows
RankKit SEO offers its MCP prompts to Claude Code, which shows them as slash commands. For example, the SEO health check workflow audits the site and proposes the five highest-impact fixes without changing anything.
Working with approval mode
With Agents' changes need my approval on (the default), Claude's edits come back as pending. They go live only after you approve them in RankKit SEO → Change Log. Site-wide changes, such as settings, redirects, robots.txt and backups, come back as pending_approval and wait for an administrator even with approval mode off. Ask Claude to preview a change first with dry_run, so you see the old and new values before anything is queued. More in Approval mode, dry runs and undo.
Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
| "Invalid or expired RankKit SEO agent token." | The token was mistyped, revoked or has expired, or its WordPress user was deleted. | Create a new token and run the command again with it. |
| "AI agent access is turned off. Enable it in RankKit SEO → AI Agents." | Allow AI agents to connect is off. | Turn it on in RankKit SEO → AI Agents. |
| A tool you expect is missing | The token's permissions don't include that area, or the tool needs RankKit SEO Pro or a Google connection. | Check the token's Permissions column and the MCP tool reference. |
| "Authentication required: send Authorization: Bearer |
The header didn't reach WordPress. Some servers strip the Authorization header. |
Send the token in an X-RankKit-Token header instead. See MCP troubleshooting. |
FAQ
Can Claude Code connect to a site on localhost?
Yes. Claude Code calls the endpoint from your computer, so any URL your computer can open works. claude.ai and ChatGPT, in contrast, need a public HTTPS site.
Where does Claude Code store the token?
In its own MCP configuration on your computer. Treat it like a password and revoke it in RankKit SEO → AI Agents if it leaks.
Can I use OAuth instead of a token?
The Claude Code tab in RankKit SEO gives you the token method. OAuth sign-in is offered for web connectors such as claude.ai and ChatGPT; see Connect claude.ai or ChatGPT.
Was this page helpful?
Related guides
Agent tokens, scopes and access levels
Create RankKit SEO agent tokens for MCP clients, choose per-area permissions and expiry, and see when each token was last used or revoke it.
Ready-made agent workflows (MCP prompts)
RankKit SEO's eleven ready-made MCP prompts, from an SEO health check to drafting an article, which your AI client can run as slash commands.
Connect an AI agent to WordPress over MCP
Turn on RankKit SEO's built-in MCP server and connect Claude, ChatGPT, Cursor or VS Code so an AI agent can audit and fix your SEO.
Fix MCP connection problems
Every error RankKit SEO's MCP server, OAuth sign-in and agent tools can return, what causes it and how to fix it, from bad tokens to missing tools.
Still need help?
Email us with your WordPress and RankKit SEO versions and what you tried. Pro customers get priority replies.