How Hermes Agent handles this
Hermes Agent runs continuously on a machine you control, so the useful purge is often the one that happens without you at a keyboard. Maybe you publish posts in the evening and want the stored pages cleared before morning, or you want a purge after a weekly plugin update. You can also ask it directly in conversation: purge the page cache on shop and tell me what went. Either way it calls list_sites, then purge_cache, then reports what the plugin returned.
For timed runs, Hermes Agent documents cron, and the timing is its job rather than the Hub's, because xSpeed Hub has no scheduler for agent prompts. Treat a scheduled run as a prompt with no one watching: name the site, name the purge type, and say what to report. The result of each run is the plugin's report: the type, the entries cleared, and for all the object cache and a connected Cloudflare edge, so a log of runs is also a log of what was cleared.
A Hermes server entry has a trust setting. The default, full, adds no approval prompt for that server's tools, so a purge runs as soon as the connection allows writes, because xSpeed Hub has no confirmation of its own. Set trust to untrusted and Hermes asks before every call to a tool without a read-only hint, which for the Hub means every call, reads included, and a scheduled run has no one to answer. To keep writes out of a job instead, list only the tools it needs in the tools include filter. The Hub also tells the agent to confirm a purge across every site, but that is guidance to the model, not a lock, so keep scheduled purges to named sites.
Set up Hermes Agent once
Already connected? Skip to the prompts. Alternatives and troubleshooting are on the Hermes Agent 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 config.yaml
Add this entry under mcp_servers. auth: oauth tells Hermes to handle discovery, dynamic client registration, PKCE and token refresh itself. If you edit the file from inside a running session, Hermes reloads its MCP connections with a 30 second timeout, which is too short for a browser sign-in, so finish the entry and then run the login in the next step.
mcp_servers:
xspeedhub:
url: "https://app.xspeedcache.com/xspeed/mcp"
auth: oauth 3Sign in with hermes mcp login
Run this once. Hermes prints an authorization URL, opens your browser where it can, and waits for the callback on a local loopback port. Sign in to xSpeed Hub and approve. There is no token to paste; Hermes caches the credentials it receives under ~/.hermes/mcp-tokens. On a remote host, paste the redirect URL back into the terminal when Hermes asks, or forward the callback port over SSH.
hermes mcp login xspeedhub hermes mcp test xspeedhub
Full Hermes Agent 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. A Hermes server entry has a trust setting. The default, full, adds no approval prompt for that server's tools, and the approvals setting covers dangerous shell commands, not MCP tools. Set trust: untrusted on the xspeedhub entry and Hermes asks before every call to a tool that lacks a readOnlyHint of true. The Hub does not mark its tools that way, so with untrusted every Hub call asks, reads included. To remove writes instead of prompting, set tools.include on the entry to the read tools; the filter takes globs and include wins over exclude. The Hub itself has no confirmation step.
What do I ask?
Three prompts written for Hermes Agent. More for this job are below.
Run the evening job with xSpeed Hub: purge the page cache on shop, start the preloader, and report how many URLs were queued.
Every Sunday after the plugin update, use xSpeed Hub to purge shop completely and tell me whether the object cache was flushed too.
Each morning, ask xSpeed Hub for the cache status of blog and report it. Do not purge anything.
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 Hermes Agent
Background runs and cron never open a browser, so if the refresh token stops working the server is parked and a scheduled run purges nothing until you sign in again from a terminal, and you only find out when you read the run log. Look at the first runs after you set a job up, and have the prompt say to report plainly when a tool call is refused. Avoid site: all in a scheduled prompt, because the one-time confirmation the Hub asks the agent to seek has no one to answer it; name the sites instead.
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 Hermes Agent
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
- Hermes Agent + xSpeed
- Every AI agent that works with xSpeed
From the blog