# GitHub Copilot in VS Code + xSpeed: WordPress Caching

> GitHub Copilot in VS Code is the AI assistant inside Visual Studio Code, and once xSpeed Hub is added as an MCP server its chat agent can read cache status, purge, change settings and run speed tests on your WordPress sites. You edit one mcp.json entry, approve the sign-in in your browser, and ask from the Chat view.

Page: https://xspeedcache.com/agent/github-copilot/
Last updated: October 2026

- One entry in your user mcp.json covers every site you connected to the Hub
- Chat: Manage Tool Approval lists the xSpeed tools by server, so you can trust reads and keep writes on a prompt
- Sits next to the theme or plugin you are editing: check the cache without leaving the editor

## How do I connect GitHub Copilot in VS Code to xSpeed?

### 1. Put your sites in xSpeed Hub

Sign in at app.xspeedcache.com with Google or email; the Hub is free and has no site cap. Then connect each WordPress site from its own dashboard: click Connect Hub in the xSpeed Cache top bar, then Connect via xSpeed Hub. Each site needs the free xSpeed Cache plugin.

### 2. 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"
    }
  }
}
```

### 3. 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
```

### 4. Or use a connection token (alternative)

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}" }
    }
  }
}
```

**Authentication:** 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:** ask "Using xSpeed Hub, which of my sites has the lowest cache hit ratio? Only read; do not change anything."

## Does GitHub Copilot in VS Code ask before it changes my site?

In VS Code the default permission level is Manual permissions: a tool call that is not auto-approved shows a confirmation, and you can allow it once or for the session, the workspace or all future calls. Chat: Manage Tool Approval lists tools grouped by MCP server, so you can trust get_cache_status and the other reads while purge_cache and update_settings stay on a prompt. Allow all, Autopilot and global auto-approval skip those prompts, including for external tool calls, and then a write runs as soon as your connection allows writes. xSpeed Hub has no confirmation step of its own.

xSpeed Hub has no confirmation step of its own. Read tools change nothing on your sites, with one exception to know about: contact_support sends an email to xSpeed support, and a read-only connection can still call it. A write tool (a purge, a settings change, a cache toggle, or a speed test that spends the shared allowance) runs as soon as your connection allows writes. Three things stand between a prompt and a change: your connection's scope, because a read-only connection refuses every write tool (the connection token has a Read-only everywhere switch, and a Viewer member only ever gets read access); your AI client's own tool-approval prompt; and the Hub's instructions to the agent, which tell it to confirm the target site and to ask once before a write that touches every site.

## Example session

```
You: I just merged the lazy-load change. Use xSpeed Hub to run a mobile PageSpeed test on shop and compare it with the last stored result.
  → get_score_history(site: shop) [read-only]: last stored mobile run: score 71, LCP 3.4 s, six days ago
  → run_speed_test(site: shop, strategy: mobile) [uses quota]: mobile run finished: score 76, LCP 2.9 s
Agent: Mobile score went from 71 to 76 and LCP from 3.4 s to 2.9 s. That is one run each, and PageSpeed results vary, so run it twice more before you treat the gap as real. The test also spends the shared speed-test allowance.
You: Fine. Leave the cache alone for now.
```

## What is GitHub Copilot in VS Code?

GitHub Copilot in VS Code is the AI assistant built into Visual Studio Code. Its chat agent can read your workspace, run commands and call tools, including tools from MCP servers that you add to the editor.

MCP, the Model Context Protocol, is how VS Code reaches services outside your machine. Adding xSpeed Hub as an HTTP server gives the chat agent the Hub's caching tools: status, purge, settings, preloader, object cache, Cloudflare and speed tests, for every site in your workspace.

## Why use GitHub Copilot in VS Code with xSpeed?

- **Check the cache from the editor**: You change a theme or plugin in VS Code, so you can ask the Chat view whether the page cache is on and what the hit ratio is without opening wp-admin.
- **Approval per tool, per server**: Chat: Manage Tool Approval groups tools by MCP server. Trust the reads once, keep each write behind a prompt, and change your mind later in the same list.
- **One entry for the whole fleet**: The Hub fronts every site you connected. One mcp.json entry replaces a server per site, and a single call can return a result for each site.

## Good to know

- 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.

## Prompts to try

- Use xSpeed Hub to list my sites and show page cache status for each one.
- With xSpeed Hub, purge the shop site cache, then start the preloader and tell me how many URLs it queued.
- Use xSpeed Hub to run a mobile PageSpeed test on the blog and compare it with the stored score history.
- Ask xSpeed Hub to preview what optimize_site would change on docs with a safe pass. Do not apply it.
- Using xSpeed Hub, check that Redis answers on shop before you turn on the object cache.

## What can GitHub Copilot in VS Code do with xSpeed?

- [Purge the WordPress cache with GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/purge-cache/): Clear stale pages after a deploy, an edit or a plugin update, on one site or all of them.
- [Find out why WordPress pages are not cached with GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/troubleshoot-cache/): Work out why a site misses the cache, serves slow pages or shows a low hit ratio, using read-only checks first.
- [Scan a website for speed problems with GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/speed-scan/): Get a graded speed report with the fix for every failing check and a link you can share, for your own site or any public URL.
- [Run and track PageSpeed tests with GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/pagespeed-tests/): Read the PageSpeed scores a site already has, run a new test when something changed, and tell a Lighthouse score from a cache benchmark.
- [Raise a WordPress site's PageSpeed score with GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/optimize-site/): Preview and apply xSpeed's recommended settings to a site, check the pages still work, and be told plainly what caching cannot fix.
- [Tune WordPress cache settings with GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/cache-settings/): See which modules a site has, read their current settings, change them, and turn page caching on or off.
- [Warm the WordPress cache with GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/preload-cache/): Fill the page cache before visitors arrive, for example right after a purge or a deploy.
- [Set up the Redis object cache with GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/object-cache/): Connect a site to Redis or Memcached so database results survive between requests.
- [Manage Cloudflare caching with GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/cloudflare/): Check the Cloudflare connection, clear the edge cache and switch development mode on or off for a site.
- [Manage every WordPress site at once with GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/fleet/): Run one action across all of your sites, or a chosen few, and read the result site by site.

## Which way should I connect?

| Surface | Endpoint | Reaches | Auth | Tools |
| --- | --- | --- | --- | --- |
| [xSpeed Hub MCP](https://xspeedcache.com/docs/hub-mcp/) | `https://app.xspeedcache.com/xspeed/mcp` | Every site in your workspace, one connection | OAuth sign-in in the browser, or a connection token in an Authorization header | 29 tools (16 read, 13 write), seven of them can act on every site at once |
| [xSpeed Cache Site MCP](https://xspeedcache.com/docs/mcp-server/) | `https://your-site.com/xspeed/mcp` | One WordPress site | OAuth sign-in by a site admin, or the site's own token in an Authorization header | The full per-site tool set plus run_command for the WP-CLI surface |
| [xSpeed Scan MCP](https://xspeedcache.com/docs/scan-mcp/) | `https://xspeedcache.com/scan/mcp` | Any public URL, read-only | None. No account. | 5 tools: run_speed_scan, get_speed_scan and three product-info tools |
| [WP-CLI](https://xspeedcache.com/docs/wp-cli-commands/) | `wp xspeed …` | The site whose server the agent has a shell on | Your server login | Every xSpeed command: cache, purge, preloader, objcache, cf, score, settings and more |

## Frequently asked questions

### How do I add xSpeed Hub to GitHub Copilot in VS Code?

Run MCP: Open User Configuration from the Command Palette and add a server named xspeedhub with type http and the URL https://app.xspeedcache.com/xspeed/mcp. Then run MCP: List Servers, start the server and finish the sign-in in your browser. MCP: Add Server does the same through a guided flow.

### Do I need an API key?

No. VS Code signs in to the Hub with OAuth and keeps the credentials it receives. If you would rather use a header, the workspace owner can copy the connection token from the Hub's Connect AI page and you can reference it from the headers field through an input variable.

### Will Copilot change my site without asking?

Not by default. VS Code starts in Manual permissions and shows a confirmation for tool calls that are not auto-approved. The Hub has no confirmation step of its own, so if you trust a write tool, choose Allow all or turn on Autopilot, that write runs without a prompt. Trust reads, keep writes on a prompt. For read-only access, send the connection token with Read-only everywhere on, or sign in as a Viewer member.

### Which tools does Copilot get from xSpeed Hub?

The 29 tools of the xSpeed Hub MCP server. Sixteen only read. Thirteen change a site or spend the shared speed-test allowance. Use the Configure Tools button in the chat input to switch individual tools off.

### Why does VS Code say I have too many tools?

A chat request can enable at most 128 tools across all sources. Open the tools picker and clear some tools or whole MCP servers. xSpeed Hub accounts for 29 of them.

### Can I use it with one site and no Hub?

Yes. The xSpeed Cache plugin has its own MCP server at your-site.com/xspeed/mcp, and you add it to mcp.json the same way. The Hub is the better fit once you have more than one site.

### How do I disconnect it?

Run MCP: List Servers, choose xspeedhub and stop or disable it, and remove the entry from mcp.json to delete it. To clear a saved dynamic sign-in, run Authentication: Remove Dynamic Authentication Providers. Rotating or disconnecting the connection token in the Hub revokes only clients that send that token, so it does not end an OAuth sign-in; that is removed in VS Code.

## Also works with

[Claude Code](https://xspeedcache.com/agent/claude-code/) · [Claude](https://xspeedcache.com/agent/claude/) · [Claude Cowork](https://xspeedcache.com/agent/claude-cowork/) · [ChatGPT](https://xspeedcache.com/agent/chatgpt/) · [Codex](https://xspeedcache.com/agent/codex/) · [Cursor](https://xspeedcache.com/agent/cursor/) · [Windsurf](https://xspeedcache.com/agent/windsurf/) · [Gemini CLI](https://xspeedcache.com/agent/gemini-cli/) · [Antigravity](https://xspeedcache.com/agent/antigravity/) · [Zed](https://xspeedcache.com/agent/zed/) · [Kiro](https://xspeedcache.com/agent/kiro/) · [OpenCode](https://xspeedcache.com/agent/opencode/) · [OpenClaw](https://xspeedcache.com/agent/openclaw/) · [Hermes Agent](https://xspeedcache.com/agent/hermes-agent/) · [Grok Build](https://xspeedcache.com/agent/grok-build/) · [ChatGPT dots](https://xspeedcache.com/agent/chatgpt-dots/) · [Grok](https://xspeedcache.com/agent/grok/) · [Grok Bot](https://xspeedcache.com/agent/grok-bot/) · [Muse](https://xspeedcache.com/agent/muse/) · [Manus](https://xspeedcache.com/agent/manus/) · [Kimi Code](https://xspeedcache.com/agent/kimi/) · [Paperclip](https://xspeedcache.com/agent/paperclip/) · [NanoClaw](https://xspeedcache.com/agent/nanoclaw/)

## Sources

- 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
