Codex + xCloud
Speed up a slow site with Codex on xCloud
Speeding up a slow site with Codex means telling OpenAI's coding agent which domain feels slow and letting it read xCloud's monitoring samples, cache layers, PageSpeed result and traffic before it names a cause.
- Skill: xcloud:performance
- Toolsets: pagespeed, sites, servers, broken-links
- Free with every xCloud account
YouDiagnose why shop.example.com is slow. Read only.
sites_showread-only
servers_servicesread-only
sites_cacheSettingsread-only
AgentRedis is stopped on the server, but the site's object cache reads as on, so cache misses fall through to the database. Page cache is on. The latest mobile PageSpeed run shows a slow server response. Restarting Redis is a routine action I can do after you say so. Want that?
. Keep a human in the loop: xCloud stops and asks before anything that creates, deploys, updates, reboots, deletes or buys.
Setup
How Do You Set Up Codex to Speed up a slow site on xCloud?
Connect Codex once; every job on this account uses the same connection. Then ask in plain words.
Add the xCloud MCP server
Run this in your terminal. This form comes from xCloud's connect guide; OpenAI's Codex page documents codex mcp add for local commands, so if your version rejects --url, use the config.toml step below.
codex mcp add xcloud --url https://app.xcloud.host/mcpOr write it in config.toml
Codex reads ~/.codex/config.toml. Add a table for the server with its url. A Streamable HTTP server needs only the url, and the same file is where you set a bearer_token_env_var if you use an API key instead of OAuth.
[mcp_servers.xcloud] url = "https://app.xcloud.host/mcp"Sign in and check
Run the login command, approve the teams and choose Read-only or Full access in the browser, then type /mcp in Codex to see xcloud and its tools. Optional: Codex is also listed for the xCloud Agent Plugins package, which adds the xCloud skills.
codex mcp login xcloudCheck it worked
Then ask Codex for the job itself, for example:
Diagnose why shop.example.com is slow. Read only. Monitoring, cache layers, PageSpeed, services.
In practice
How Does Performance Work from Codex?
Codex starts in a repository, but a slow site is not tied to one, so the first thing worth typing is the domain: diagnose why shop.example.com is slow, read only, no purges. Codex resolves it with the site read, which returns the server it runs on, the stack and the dashboard link, and then works through the chain. The terminal output stays compact: one line per reading, with the time the sample was taken, because a monitoring sample carries a sampled_at and Codex should not call a ten-minute-old figure right now.
The reads it uses are sites_monitoring and sites_monitoring_history for the site, servers_monitoring for the machine, sites_cacheSettings for page cache, Redis or Object Cache Pro and Cloudflare edge cache, sites_pagespeed_latest for the last mobile and desktop run, and servers_services for php-fpm, the web server, Redis and the database. A stopped Redis beside an object cache that reads as on is the kind of line you want in the reply. After the xCloud reads, Codex can use its own shell to look at the repository or to time a request, but that is extra evidence, not a replacement for the samples.
Because Codex runs in your terminal or an IDE extension, a session often ends with a patch rather than a message. If the cause is a missing cache, there is no patch: the answer is the dashboard path Site, WordPress, Caching and the link. If the cause is in the code, Codex can propose the change and you redeploy afterwards. Keep the xCloud connection at Read-only for the diagnosis, and reconnect with Full access only when you decide you want it to purge a cache or start a scan.
Codex specific: The repository's Git remote does not identify the slow site. The same repository can feed a production site and a staging site on different servers, so name the domain, and add the team when your account has several, or Codex may measure the wrong one. If /mcp shows no xcloud tools at the start of the session, run codex mcp login xcloud again before you suspect the data.
What xCloud does for performance
xCloud reads the site's and the server's CPU, RAM and disk samples, which cache layers are on, the latest PageSpeed result, traffic in the access log, service health and the site's PHP version. The agent names the cause from that data, then hands you the switches that only the dashboard can flip.
- Resolve the site and its server. The agent looks up the site and the server it runs on, because the answer often comes from both. A slow site is frequently slow because a neighbour on the same server is.
- Check status and monitoring history. A site that is mid-deploy or failed explains slowness without any measurement. Otherwise the agent reads the site's and the server's samples, and a 24-hour or 7-day series to tell whether the slowdown is new. Disk comes early: a nearly full disk slows everything, the database first.
- Read the cache layers. The agent reads the cache settings before saying anything about caching: whether page cache, Redis or Object Cache Pro object cache and Cloudflare edge cache are on, and which server stack the site runs. It never reports that no cache configuration is readable without calling it.
- Read PageSpeed and traffic. The latest completed PageSpeed run is free to read. A new scan is worth starting only when there is no result or the site changed since, and the agent tells you it is spending a scan. The access log shows spikes, a crawl or one client hammering a path.
- Check services and PHP. The agent checks that PHP, the web server, Redis and the database are running, and reads the site's PHP version and pending updates. A stopped Redis next to an object cache that reads as on is a found answer.
- Name the cause and hand off. You get the most likely cause with its numbers. The fix is either something the agent can do, such as a purge after you agree, or a dashboard switch it names with the path and the site's dashboard link. If every number looks normal, it says so instead of inventing a cause.
Reference
Performance Settings and Limits on xCloud
The facts Codex works within when it speeds up a slow site. Where a row names the dashboard, that step stays yours to take there.
| Setting or limit | What applies |
|---|---|
| Monitoring history | Site and server CPU, RAM and disk samples as a 24-hour or 7-day series. History is not available on the free plan, and the agent says that is a plan limit rather than reporting no data |
| Cache state | Read through sites.cacheSettings: page cache, object cache (Redis, Object Cache Pro) and Cloudflare edge cache. It returns settings only, never cache contents |
| Enabling a cache layer | Dashboard-only: Site, WordPress, Caching. The API reads the layers and purges them, and cannot switch one on for an existing site |
| Page cache details | Cache duration, URL and cookie exclusions and ignored query parameters are dashboard-only and are not returned by the cache settings read |
| PageSpeed | The latest mobile and desktop results and the history are read for free. One scan runs both strategies |
| Scan conflicts | A 409 while a scan is running means it is still pending or scanning. The agent polls it instead of starting another, and it is not a cooldown |
| Cache purge | Purging runs without a confirmation stop but throws away a warm cache, so the agent asks first on a live site and reports each layer as queued or skipped |
| Traffic | The access log shows spikes and bots. It is read over SSH, so the agent asks for a bounded window |
| PHP version | Read from the site's status. Changing one site's PHP version is a dashboard step: Site, Site Settings |
| Server PHP default | Changing the server default PHP changes only the command-line php and the version new sites get. It does not move any existing site |
| Broken links | A broken-link scan on a WordPress site returns findings grouped by source page, and a truncated scan is reported as partial |
Rules Codex has to follow
- The agent diagnoses from measurements, not guesses, and it calls the cache settings read before it says anything about caching.
- It never offers to turn on Redis or any other cache layer itself. Enabling a layer is a dashboard step, and the agent gives you the path and the dashboard link.
- It never presents a change of server PHP default as a substitute for changing one site's PHP version.
- A cache purge on a live site, a new PageSpeed scan and any server-level PHP change are announced first. Server-level changes also need your explicit yes.
- A site that errors rather than loads slowly goes to troubleshooting, and a failed deploy goes to deploy.
Example prompts
What Can You Ask Codex to Do for Performance?
Type these as written and swap in your own repository, site and server names. Reads and routine actions such as backups, cache purges, PageSpeed scans and vulnerability scans run straight away; creating, deploying, updating, rebooting, deleting, buying or starting a broken-link scan stops and asks first.
Diagnose why shop.example.com is slow. Read only. Monitoring, cache layers, PageSpeed, services.Which PHP version is blog.example.com on, and how many updates are pending?Is the shop.example.com server short on disk, and since when? Use the 7-day history.Why is shop.example.com slow? Check the cache, the server load and the latest PageSpeed result.Is Redis object cache on for the shop site? If it is off, tell me where to switch it on.Show CPU, RAM and disk for the shop site over the last 24 hours and tell me whether the slowdown is new.Run a PageSpeed scan on the shop site and compare the score with the previous scans.Look at the access log of the shop site for a traffic spike or a bot hammering one path.Which PHP version is the blog site running, and are there pending updates I should apply?Purge all caches on the shop site.Scan the shop site for broken links and list the pages with the most.Codex and Performance: Frequently Asked Questions
What people ask before they let Codex speed up a slow site through xCloud.
Does Codex need Full access to diagnose a slow site?
No. Choose Read-only on the approval screen that codex mcp login opens, and every read in the diagnosis works. Reconnect with Full access later only if you want Codex to start a PageSpeed scan or purge a cache after you agree.
Why does Codex quote a time next to the monitoring figures?
Each monitoring sample carries the time it was taken, and the latest one may be minutes old. Codex quotes that time and uses the 24-hour or 7-day series to show whether a slowdown is new, instead of presenting a sample as how the site is right now.
Can the agent turn on caching for my slow site?
No. It can read which cache layers are on and purge them, but switching page cache, Redis object cache or Cloudflare edge cache on for an existing site is a dashboard step under Site, WordPress, Caching. The agent tells you the path and gives you the site's dashboard link.
What does a 409 mean when the agent starts a PageSpeed scan?
It means a scan for that site is still pending or running. The agent polls the existing scan instead of starting another, and it is not a cooldown period. A new scan is only worth starting when there is no recent result or the site has changed.
Will changing the server's PHP default speed up my site?
No. The server default changes only the command-line php and the version new sites get, and it does not move any existing site. The PHP version of one site is changed in the dashboard under Site, Site Settings.
Why does the agent say monitoring history is unavailable?
Monitoring history is a paid-plan feature, so on the free plan the request is refused as a plan limit. The agent reports it that way rather than saying there is no data, and it falls back to the samples and measurements the plan does include.
Does purging the cache ask for my confirmation?
xCloud itself runs a purge without a confirmation stop, because it is a routine action. The agent still asks you first on a live site, since a purge throws away a warm cache and the next visitors wait while it rebuilds.
Other agents
Performance with Other Agents
The same job, the same xCloud tools, a guide for each client.
- Speed up a slow site with Claude CodeAnthropic's terminal coding agent. One claude mcp add command, plus the xCloud skills plugin with nine skills on top.
- Speed up a slow site with ClaudeAnthropic's chat assistant on the web and desktop. Add xCloud as a custom connector, no terminal needed.
- Speed up a slow site with Claude CoworkAnthropic's desktop agent for delegated work. Add the xCloud connector, then hand off hosting jobs.
- Speed up a slow site with CursorThe AI code editor. One mcp.json entry with the compact URL, because Cursor stops at 40 tools.
- Speed up a slow site with OpenCodeThe open-source terminal coding agent. One remote MCP entry, then opencode mcp auth xcloud.
- Speed up a slow site with Hermes AgentNous Research's agent with memory and a built-in scheduler. An mcp_servers entry in config.yaml and one login.
- Speed up a slow site with OpenClawThe open-source agent runtime with chat apps and automations. ClawHub skill plus the MCP client.
- Speed up a slow site with WindsurfThe Cognition editor, now Devin Desktop. devin mcp add for the Devin Local agent, a serverUrl entry for legacy Cascade.
- Speed up a slow site with GitHub CopilotCopilot agent mode in VS Code. One .vscode/mcp.json entry, or the Agent Plugins package.
- Speed up a slow site with Gemini CLIGoogle's terminal agent. One gemini mcp add command, OAuth found automatically.
- Speed up a slow site with ChatGPTOpenAI's chat assistant. A developer-mode app with the xCloud MCP URL and OAuth.
- Speed up a slow site with ChatGPT dotsOpenAI's always-on agent in ChatGPT. Uses the xCloud MCP plugin you add in ChatGPT, with custom rules and scheduled tasks.
- Speed up a slow site with GrokxAI's terminal agent, Grok Build. One grok mcp add command or a config.toml entry.
- Speed up a slow site with Grok BotxAI's always-on Bots on a cloud computer. One Remote HTTPS MCP plugin, OAuth sign-in, routines on a schedule.
- Speed up a slow site with KiroAWS's agentic IDE. One url entry in .kiro/settings/mcp.json, plus the portable xCloud Agent Plugins package.
- Speed up a slow site with AntigravityGoogle's agentic IDE. One serverUrl entry in mcp_config.json and a browser sign-in.
- Speed up a slow site with ZedThe Zed editor's Agent Panel. One context_servers entry in settings.json and a browser sign-in.
More Codex guides
- Codex and xCloud overview
- Deploy from Git with Codex
- Run Docker apps with Codex
- Install one-click apps with Codex
- Manage WordPress with Codex
- Back up and stage sites with Codex
- Manage SSL and domains with Codex
- Manage servers with Codex
- Troubleshoot a broken site with Codex
- Secure sites and servers with Codex
Run Your Hosting from Codex
xCloud MCP, the Agent Skills and the Public API are free with every account. Connect once and ask.