xSpeed Cache is officially live! Get 50% OFF during Launch Week — Lifetime starts at just $79Lifetime from $79 — 50% OFF, Launch Week! See Plans →

See Plans →
Features
xSpeed Hub Pricing Docs Blog Scan
Appearance
Get Plugin

Moonshot AI

Terminal

Kimi Code + xSpeed

Kimi Code is Moonshot AI's coding agent for the terminal, and with xSpeed Hub added as an MCP server it can read cache status, purge, change settings and run speed tests on every WordPress site in your workspace. You add one entry to mcp.json, sign in once with /mcp-config login, and ask in plain language next to your code.

  • One mcp.json entry, user-wide or per project, every site you connected to the Hub
  • Each Hub tool is mcp__xspeedhub__<tool>, so permission rules can allow reads and keep writes on a prompt
  • Purge and re-warm a site in the same session that shipped the theme change

Last updated: October 2026

Kimi Code Terminal
xSpeed Hub 29 tools
  • shop
  • blog
  • docs
Connects with an mcpServers entry in mcp.json, then /mcp-config login. Sign-in: OAuth sign-in or connection token.
01

How do I connect Kimi Code to xSpeed?

Put your sites in xSpeed Hub once, then add one URL to Kimi Code.

1Connect4 steps

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

2Add xSpeed Hub to mcp.json

Put this in ~/.kimi-code/mcp.json to use the Hub in every project, or in .kimi-code/mcp.json inside one repository, where it overrides a user entry of the same name. You can also run /mcp-config and let Kimi Code add it. A server added while a session is open joins only the next session.

~/.kimi-code/mcp.json
{
  "mcpServers": {
    "xspeedhub": {
      "url": "https://app.xspeedcache.com/xspeed/mcp"
    }
  }
}

3Sign in with /mcp-config login

Start a new session with kimi, run this and approve access on the xSpeed Hub page that opens in your browser. There is no token to paste. Then run /mcp to check that xspeedhub is connected.

Text
/mcp-config login xspeedhub
/mcp

4Or use a connection token alternative

Copy the connection token from Connect AI in the Hub (only the workspace owner sees it) and export it as XSPEED_HUB_TOKEN in your shell profile. bearerTokenEnvVar tells Kimi Code to send it as a Bearer token, so the token never sits in mcp.json.

~/.kimi-code/mcp.json
{
  "mcpServers": {
    "xspeedhub": {
      "url": "https://app.xspeedcache.com/xspeed/mcp",
      "bearerTokenEnvVar": "XSPEED_HUB_TOKEN"
    }
  }
}
1 / 4
Sign-in OAuth sign-in or connection token

Run /mcp-config login xspeedhub and approve access on an xSpeed Hub page in the browser. If you would rather not use a browser, put the connection token from the Hub's Connect AI page in an environment variable and point bearerTokenEnvVar at it.

2Askexample session
Check it worked

Use xSpeed Hub to list my sites and tell me which ones have page caching turned off.

Example session · Kimi Code

You: I just shipped new CSS to shop. Use xSpeed Hub to clear what is stale and warm the site again.

get_cache_status(site: shop) read-only
→ page cache on, 412 cached pages, assets cache 96 files

Kimi Code: The cached pages and the combined asset files still point at the old CSS. A full purge clears pages, assets and the object cache; a page and assets purge is enough here. Purge pages and assets on shop, then start the preloader?

You: Pages and assets only, then warm it.

purge_cache(site: shop, type: assets) changes site
→ assets cache purged (96 files)

purge_cache(site: shop, type: page) changes site
→ page cache purged (412 entries)

start_preloader(site: shop) changes site
→ preloader started, 430 URLs queued

Kimi Code: Done. The object cache was left alone. The preloader is warming 430 URLs; ask me in a few minutes and I will check the hit ratio.

Using it

02

Prompts to try in Kimi Code

Paste one as it is, or change the site name.

Prompt
Use xSpeed Hub to show the cache hit ratio for every site and flag anything under 70%.
Prompt
With xSpeed Hub, purge the page cache on blog, then start the preloader and tell me how many URLs it queued.
Prompt
Use xSpeed Hub to run a mobile PageSpeed test on shop and compare it with the stored score history.
Prompt
With xSpeed Hub, check whether Redis is reachable on shop before you suggest turning on the object cache.
Prompt
Use xSpeed Hub to read the cache settings on docs and tell me which URLs are excluded, without changing any.
03

What can Kimi Code do with xSpeed?

A guide for each job, written for Kimi Code.

Purge the WordPress cache with Kimi Code

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 Kimi Code

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 Kimi Code

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 Kimi Code

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 Kimi Code

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 Kimi Code

See which modules a site has, read their current settings, change them, and turn page caching on or off.

Warm the WordPress cache with Kimi Code

Fill the page cache before visitors arrive, for example right after a purge or a deploy.

Set up the Redis object cache with Kimi Code

Connect a site to Redis or Memcached so database results survive between requests.

Manage Cloudflare caching with Kimi Code

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 Kimi Code

Run one action across all of your sites, or a chosen few, and read the result site by site.

Trust and safety

04

Does Kimi Code ask before it changes my site?

Kimi Code

In Kimi Code's default Always Ask mode, an MCP call that matches no permission rule asks for approval, and Approve for this session allows the same kind of call until the session ends. Permanent rules go in [[permission.rules]] in config.toml: allow mcp__xspeedhub__get_* and mcp__xspeedhub__list_* to let the reads run, and leave the write tools on the prompt. Ask When Needed mode, from /yolo, approves MCP calls automatically, and Never Ask, from /auto, approves everything. xSpeed Hub has no confirmation step of its own, so in either of those modes a purge or a settings change runs as soon as your connection allows writes. To remove writes altogether, list the read tools in the entry's enabledTools, or use a connection token with Read-only everywhere on.

xSpeed Hub

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.

Good to know

  • A server added while Kimi Code is open joins only the next session, so restart before you run /mcp-config login.
  • Ask When Needed mode, from /yolo, approves every MCP call automatically, and Never Ask, from /auto, approves everything. Hub writes then run with no prompt.
  • A .kimi-code/mcp.json in a repository overrides a user entry with the same name, so a stale xspeedhub entry there can shadow the one in your home folder.
  • Kimi Code shows project-level servers in its workspace trust prompt. Check the URL there before you trust a folder that brings its own xspeedhub entry.

Reference

05

What is Kimi Code?

Kimi Code is Moonshot AI's coding agent for the terminal. You start it with the kimi command in a project folder, and it reads and edits files, runs commands and searches code while you watch. It runs Moonshot's Kimi models, and you sign in with /login using a Kimi Code account or a Moonshot platform API key.

It is also an MCP client. Servers are listed in ~/.kimi-code/mcp.json for every project or in .kimi-code/mcp.json for one repository, and the agent sees their tools beside its built-in ones. MCP, the Model Context Protocol, is how xSpeed Hub describes its caching tools, so one entry gives Kimi Code status, purge, settings, preloader, object cache, Cloudflare and speed tests for every site in your workspace.

At a glance

Made by
Moonshot AI
Type
Terminal
Connects with
an mcpServers entry in mcp.json, then /mcp-config login
Sign-in
OAuth sign-in or connection token
Last checked
October 2026
06

Why use Kimi Code with xSpeed?

Purge where you ship

The session that edited the theme can purge the stale pages and assets on the site you just deployed and start the preloader, without opening wp-admin.

Permission rules per tool

Every Hub tool has its own name in Kimi Code, so a rule can let reads run and keep each purge or settings change behind an approval.

Per-project or user-wide

Keep the Hub in your home config for every repository, or in one project's .kimi-code/mcp.json so it appears only where you work on WordPress.

07

How does Kimi Code compare with other AI clients?

Every client below reaches the same 29 Hub tools once connected. What differs is where it runs, how you add the server and how it signs in.

ClientMade byTypeHow you connect itSign-in
Kimi Code Moonshot AI Terminal an mcpServers entry in mcp.json, then /mcp-config login OAuth sign-in or connection token
OpenCode SST Terminal a remote mcp entry in the config, then opencode mcp auth OAuth sign-in or connection token
Claude Anthropic Chat app Customize, Connectors, Add custom connector OAuth sign-in or connection token
ChatGPT OpenAI Chat app Developer mode, then a custom MCP app OAuth sign-in
Claude Code Anthropic Terminal claude mcp add, then /mcp to sign in OAuth sign-in or connection token
08

Which way should I connect?

Kimi Code can use the Hub, one site's own MCP server, or the no-account Scan MCP. The Hub is the one most people want.

xSpeed Hub MCPMost people

https://app.xspeedcache.com/xspeed/mcp
Best for
Most people. One URL in your AI client, every site behind it.
Reaches
Every site in your workspace, one connection
Sign-in
OAuth sign-in in the browser, or a connection token in an Authorization header
Tools
29 tools (16 read, 13 write), seven of them can act on every site at once
Read the guide →

xSpeed Cache Site MCP

https://your-site.com/xspeed/mcp
Best for
A single site, or work the Hub does not expose, such as database cleanup.
Reaches
One WordPress site
Sign-in
OAuth sign-in by a site admin, or the site's own token in an Authorization header
Tools
The full per-site tool set plus run_command for the WP-CLI surface
Read the guide →

xSpeed Scan MCP

https://xspeedcache.com/scan/mcp
Best for
Grading a site you do not run, or trying xSpeed before you install anything.
Reaches
Any public URL, read-only
Sign-in
None. No account.
Tools
5 tools: run_speed_scan, get_speed_scan and three product-info tools
Read the guide →

WP-CLI

wp xspeed …
Best for
Agents that already run commands on the server, such as Claude Code or Codex over SSH.
Reaches
The site whose server the agent has a shell on
Sign-in
Your server login
Tools
Every xSpeed command: cache, purge, preloader, objcache, cf, score, settings and more
Read the guide →
09

Frequently asked questions

Add an xspeedhub entry with the url https://app.xspeedcache.com/xspeed/mcp under mcpServers in ~/.kimi-code/mcp.json, or let /mcp-config add it. Start a new session, run /mcp-config login xspeedhub and approve access in the browser, then run /mcp to see that it is connected.

No. Kimi Code signs in to the Hub with OAuth through /mcp-config login. If you prefer a header, the workspace owner can copy the connection token from the Hub's Connect AI page, export it as an environment variable and name that variable in bearerTokenEnvVar.

In the default Always Ask mode it asks before an MCP call that no permission rule allows. Ask When Needed and Never Ask approve MCP calls automatically, and xSpeed Hub has no confirmation step of its own, so in those modes a write runs at once. Keep writes on the prompt, or for read-only access use enabledTools with the read tools or a token with Read-only everywhere on.

Add allow rules under permission rules in config.toml whose patterns match the Hub's get_ and list_ tools, which Kimi Code names mcp__xspeedhub__ followed by the tool name. Every other Hub tool still asks. Avoid one wildcard rule for the whole server, which would let the write tools run too.

Run /mcp to see whether xspeedhub is listed and connected. If it is missing, check the JSON in ~/.kimi-code/mcp.json and any .kimi-code/mcp.json in the project, then start a new session. If it is listed but not signed in, run /mcp-config login xspeedhub.

No. This page covers Kimi Code CLI, the terminal agent, which connects to the Hub through its MCP configuration as described here.

Delete the xspeedhub entry with /mcp-config or remove it from mcp.json, or set enabled to false to keep it for later. 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.

10

Also works with

Sources checked (3)

Connect Kimi Code to every site at once.

xSpeed Hub is free and has no site cap. Connect your sites, add one URL, and ask.