Connect VS Code (GitHub Copilot)

Connect VS Code and GitHub Copilot to RankKit SEO by adding your MCP endpoint and agent token to .vscode/mcp.json and starting the server.

Updated 2 min read
On this page

VS Code can use MCP servers in GitHub Copilot chat. Add RankKit SEO to your workspace's .vscode/mcp.json with an agent token, start the server, and Copilot can audit and edit your WordPress SEO.

VS Code runs on your computer, so a local or staging site works too.

Before you start

Turn on agent access in RankKit SEO → AI Agents → Allow AI agents to connect. See Connect an AI agent.

Step 1: Create a token

  1. Go to RankKit SEO → AI Agents and click Create token.
  2. Name it, for example "VS Code", pick an expiry and a Permissions preset, and click Create token.

The token is shown once, and RankKit SEO fills it into the snippets in the Connect an AI client card. See Agent tokens, scopes and access levels.

Step 2: Add RankKit SEO to .vscode/mcp.json

Open the VS Code tab in the Connect an AI client card and copy the snippet:

{
  "servers": {
    "rankkit": {
      "type": "http",
      "url": "https://example.com/wp-json/speedrank/v1/mcp",
      "headers": {
        "Authorization": "Bearer sr_your_token_here"
      }
    }
  }
}

Save it as .vscode/mcp.json in the folder you have open. If the file already exists, add only the "rankkit": { … } entry inside servers.

Note the differences from other clients: VS Code uses a top-level servers key (not mcpServers) and needs "type": "http".

Important .vscode/mcp.json lives in your project. Don't commit it with a real token to a shared repository.

Step 3: Start the server

Start the server from the MCP view in VS Code. VS Code then connects to your site and loads RankKit SEO's tools.

Step 4: Check that it works

In Copilot chat, ask:

Run site_overview and summarise my site's SEO.

Copilot calls the RankKit SEO tool and answers with your site's name, modules, content counts and audit score. In wp-admin, the token's Last used column shows the time and call count, and the Activity card on RankKit SEO → AI Agents lists the call.

Troubleshooting

Problem Cause Fix
The server doesn't appear The file isn't at .vscode/mcp.json in the open folder, the JSON is invalid, or it uses mcpServers instead of servers. Fix the file, then start the server again from the MCP view.
"Invalid or expired RankKit SEO agent token." The token is wrong, revoked or expired. Create a new token and update the file.
"AI agent access is turned off. Enable it in RankKit SEO → AI Agents." Agent access is off. Turn on Allow AI agents to connect.

See Fix MCP connection problems for every error message.

FAQ

Can I connect a site that runs on my computer?

Yes. VS Code calls the endpoint from your computer, so a local URL works.

Can I share the configuration with my team?

Share the file without the token, and have each person create their own token in RankKit SEO → AI Agents. Each edit in the Change Log then shows who made it, and you can revoke one person's access without affecting the others.

Was this page helpful?

Still need help?

Email us with your WordPress and RankKit SEO versions and what you tried. Pro customers get priority replies.

Contact support