How Antigravity handles this
You are in Antigravity with a WordPress project open and an agent ready to take a task. You change a template or a stylesheet and need to see it live. You describe the job in the agent panel: purge the cache on shop for the files I touched, and tell me what was cleared. The agent calls list_sites to match the name, then purge_cache with a type, and the result returns in the same session.
Antigravity connects to the Hub with OAuth, so an xSpeed Hub page opens in your browser where you sign in and approve access, then you copy the authorization code the page shows and paste it into the settings panel. Antigravity keeps the credentials it receives. The OAuth consent page has no read-only option, so the sign-in gets the scopes Antigravity requests, read and write by default, and only a sign-in as a Viewer member is read-only. A purge of type all reports the page cache, the object cache and, where Cloudflare is connected, the edge, so the agent can tell you which store held the old copy, and it can read get_cache_status afterwards to confirm.
Antigravity runs MCP tools in Ask mode unless you have configured otherwise, so each call waits for your approval in a card. xSpeed Hub has no confirmation of its own, so a purge runs as soon as the connection allows writes and Antigravity lets the call through. Allow rules such as mcp(xspeedhub/get_cache_status) or mcp(xspeedhub/*) let calls through without a prompt, and the Turbo permission preset allows MCP actions without asking. For a purge across every site, the Hub also tells the agent to say that it will touch all the sites and wait for your yes, but that is an instruction to the model, not a lock.
Set up Antigravity once
Already connected? Skip to the prompts. Alternatives and troubleshooting are on the Antigravity guide.
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_config.json
Antigravity reads ~/.gemini/config/mcp_config.json for every project, or .agents/mcp_config.json inside one workspace. In the IDE, open the ... menu at the top of the agent side panel, choose MCP Servers, then Manage MCP Servers and View raw config. Remote servers must use the serverUrl field; the older url and httpUrl fields are not supported.
{
"mcpServers": {
"xspeedhub": {
"serverUrl": "https://app.xspeedcache.com/xspeed/mcp"
}
}
} 3Authenticate
Open Agent settings with Cmd+, on macOS or Ctrl+, on Windows and Linux, go to the Customizations tab and click Authenticate next to xspeedhub. Sign in to xSpeed Hub in the browser and approve access, copy the authorization code the page shows, paste it into the settings panel and click Submit. Antigravity keeps the credentials it receives and refreshes them. In the CLI, type /mcp to open the MCP manager and check the server status.
Settings → Customizations → Authenticate
Full Antigravity setup, sign-in options and FAQ
Before you send a prompt that changes something
Reads change nothing on your sites, though contact_support emails xSpeed support. Writes run once your connection allows them, so your client's approval prompt and a read-only connection (the token's Read-only everywhere switch, or a Viewer sign-in) are the gates that matter. Antigravity runs unconfigured MCP tools in Ask mode, so each call waits for your approval in a card before it executes. Allow rules such as mcp(xspeedhub/get_cache_status) or mcp(xspeedhub/*) let calls through without a prompt, Ask and Deny rules take precedence over Allow, and the Turbo permission preset allows MCP and web actions without asking. When you approve a card you can also edit its target to widen the grant. With Turbo or a broad allow rule, a write reaches the Hub as soon as your connection allows writes. xSpeed Hub has no confirmation step of its own.
What do I ask?
Three prompts written for Antigravity. More for this job are below.
I changed the header styles on blog. Use xSpeed Hub to purge only assets there and check the cache status afterwards.
With xSpeed Hub, read the cache status of every site, then purge the page cache on the one with the lowest hit ratio.
Using xSpeed Hub, purge every site in my workspace and list any that failed.
What happens, step by step
A purge throws away stored copies so the next visitor gets a fresh page. Through xSpeed Hub an agent can purge everything, only pages, only CSS and JavaScript assets, the object cache or the REST cache, on one site or across every site in a workspace. A full purge also clears the Cloudflare edge when the site has Cloudflare connected.
01
Find the site
The agent calls list_sites when you have more than one site, then matches the name you used to a site handle. If the name could mean two sites, the Hub tells it to ask you rather than guess.
02
Pick the purge type
purge_cache takes a type: all, page, assets, object or rest. all clears the page cache, the object cache and, when they are connected, the Cloudflare edge and CDN. After a theme or CSS change, assets is enough; after a content edit, page; after a deploy, all.
03
Purge
The call runs straight away on that site once your connection allows writes. For every site at once the agent passes site: "all", and the Hub runs the sites one after another with a one-second pause.
04
Clear only the edge if that is all you need
purge_cloudflare empties the Cloudflare edge cache on its own, without touching the copies on your server. A page or assets purge does not reach Cloudflare; a purge of type all does when Cloudflare is connected.
05
Warm it again
start_preloader rebuilds the cache in the background so the first visitors after the purge are not the ones paying for it.
Reference
| Tool | purge_cache (write) |
|---|---|
| Purge types | all, page, assets, object, rest |
| What all covers | Page cache, object cache, plus the Cloudflare edge and CDN when connected |
| Every site at once | site: "all" or a list of handles, one result per site |
| Fan-out pacing | Sites run one after another with a 1 second pause |
| Edge only | purge_cloudflare, a separate write tool |
| Re-warm | start_preloader after the purge |
| Read-only access | purge_cache is refused on a connection token with Read-only everywhere on, and for a Viewer sign-in |
| Confirmation | None on the Hub; your client's prompt is the gate |
Rules worth keeping
- Name the site. With several sites, an unclear name should make the agent ask, and the Hub tells it to.
- A purge of every site is one call with site: "all". The Hub tells the agent to confirm it with you once before it runs.
- Purge the narrowest type that fixes the problem, then warm the cache, so visitors do not all hit uncached pages at once.
- A fan-out result is reported per site. Treat some sites failing as a partial result, not a failure of the whole call.
Good to know with Antigravity
Antigravity runs MCP tools in Ask mode by default, so a purge waits for your approval card. A broad allow rule such as mcp(xspeedhub/*) or the Turbo permission preset removes that stop, and then purge_cache runs the moment the agent calls it. Allow single reads with a rule like mcp(xspeedhub/get_cache_status), add an Ask rule for purge_cache, and remember that Ask and Deny take precedence over Allow. When you approve a card you can edit its target to widen the grant, so read it before you submit. The OAuth sign-in gets the scopes Antigravity requests, read and write by default, and the Hub's Read-only everywhere switch applies only to the connection token, so for an agent that should only look, sign in as a Viewer member of the workspace.
More prompts for this job
They work in any client connected to xSpeed Hub.
Use xSpeed Hub to purge the page cache on blog.
I just changed the theme CSS on shop. Use xSpeed Hub to purge only the assets cache there.
With xSpeed Hub, purge every site in my workspace and tell me which ones failed.
Use xSpeed Hub to purge shop, then purge its Cloudflare edge cache too.
With xSpeed Hub, purge the docs site and start the preloader so it is warm again.
Using xSpeed Hub, what purge type should I use after updating a plugin that changes the checkout page?
Frequently asked questions
Keep going
Purge the cache with other agents
More with Antigravity
Documentation
- How to enable Page Cache
- How to warm your cache ahead of visitors
- Managing your fleet with xSpeed Hub
- How to write prompts for xSpeed Hub
- Antigravity + xSpeed
- Every AI agent that works with xSpeed
From the blog