# Connect GitHub Copilot in VS Code to xSpeed Hub MCP

> Add xSpeed Hub to VS Code with one mcp.json entry, sign in once, and ask GitHub Copilot to manage your WordPress sites from the Chat view.

- Category: AI & MCP
- Updated: 2026-10-06
- Canonical: https://xspeedcache.com/docs/hub-mcp-vs-code/

---

You add one MCP server, `xspeedhub`, to your VS Code user configuration. GitHub Copilot's agent in the Chat view can then use the Hub's tools.

## Steps

### 1. Add xSpeed Hub to your user mcp.json

Open the Command Palette and run MCP: Open User Configuration, then add this entry. Servers in your user profile are available in every workspace. MCP: Add Server walks you through the same thing, and the project-level .mcp.json file works too if you want the entry shared with your team; that file uses a top-level mcpServers object instead of servers.

File: `mcp.json (MCP: Open User Configuration)`

```json
{
  "servers": {
    "xspeedhub": {
      "type": "http",
      "url": "https://app.xspeedcache.com/xspeed/mcp"
    }
  }
}
```

### 2. Start the server and sign in

Run MCP: List Servers, pick xspeedhub and choose Start. VS Code asks whether you trust the server, then opens a browser page where you sign in to xSpeed Hub and approve access. There is no token to paste, and VS Code keeps the credentials it receives. Open the Chat view and use the Configure Tools button to see the xSpeed tools.

```
MCP: List Servers
```

### 3. Or use a connection token (optional)

Copy the connection token from Connect AI in the Hub (only the workspace owner sees it). The input variable makes VS Code ask for the token once and store it, instead of leaving it in the file.

File: `mcp.json (MCP: Open User Configuration)`

```json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "xspeed-token",
      "description": "xSpeed Hub connection token",
      "password": true
    }
  ],
  "servers": {
    "xspeedhub": {
      "type": "http",
      "url": "https://app.xspeedcache.com/xspeed/mcp",
      "headers": { "Authorization": "Bearer ${input:xspeed-token}" }
    }
  }
}
```

## Sign-in

**OAuth sign-in or connection token.** VS Code starts the OAuth flow on first connection, beginning with dynamic client registration, and opens a browser page where you approve access in xSpeed Hub. If you prefer a header, add the connection token from the Hub's Connect AI page under headers, using a VS Code input variable so it is not saved in the file.

## Check it worked

```
Using xSpeed Hub, which of my sites has the lowest cache hit ratio? Only read; do not change anything.
```

## A first prompt

```
Use xSpeed Hub to list my sites and show page cache status for each one.
```

## If something does not work

- A chat request can enable at most 128 tools. xSpeed Hub adds 29, so if you also run other MCP servers, deselect some in the tools picker when VS Code reports too many.
- Workspace MCP files such as .mcp.json are committed with the project and inherit Workspace Trust. Put the xSpeed entry in your user configuration unless you want teammates to get it too, and never put a connection token in a shared file.
- The VS Code documentation lists .vscode/mcp.json as a deprecated destination for new servers. Use the user configuration or a portable .mcp.json.
- Organizations can manage MCP access through GitHub policies, so a managed account may not be able to add a server at all.

More about GitHub Copilot in VS Code with xSpeed, including approvals and example sessions: https://xspeedcache.com/agent/github-copilot/

Sources checked: [VS Code: Add and manage MCP servers](https://code.visualstudio.com/docs/copilot/customization/mcp-servers), [VS Code: MCP configuration reference](https://code.visualstudio.com/docs/copilot/reference/mcp-configuration), [VS Code: MCP developer guide (authorization)](https://code.visualstudio.com/api/extension-guides/ai/mcp), [VS Code: Manage approvals and permissions](https://code.visualstudio.com/docs/agents/run/approvals), [VS Code: Use tools with agents (128-tool limit)](https://code.visualstudio.com/docs/copilot/agents/agent-tools)
