Zed + xCloud

Troubleshoot a broken site with Zed on xCloud

Troubleshooting with Zed means asking the Agent Panel why a site returns a 500 or a 502, and having xCloud read the status, the recent events and the web server logs while each tool call shows in the panel.

  • Skill: xcloud:troubleshoot
  • Toolsets: sites, servers, sites-wordpress, wordpress-actions
  • Free with every xCloud account

YouUse xCloud to find out why shop.example.com returns 500.

sites_statusread-only

sites_eventsread-only

AgentStatus is normal. A cache purge ran at 14:02 and finished cleanly, and nothing failed before the first 500 at 14:05. I will read the nginx error log next.

sites_access-logsread-only

AgentThe error log shows PHP Fatal error: Allowed memory size of 134217728 bytes exhausted in wp-content/plugins/shop-extras/report.php, repeated since 14:05.

. 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 Zed to Troubleshoot a broken site on xCloud?

Connect Zed once; every job on this account uses the same connection. Then ask in plain words.

  1. Add xCloud as a remote server

    Open Settings, then AI, then MCP Servers, click Add Server and choose Add Remote Server. Or run the zed: open settings file action and add this to settings.json yourself. Zed writes the same entry either way.

    JSON
    {
      "context_servers": {
        "xcloud": {
          "url": "https://app.xcloud.host/mcp"
        }
      }
    }
  2. Sign in and check the dot

    Because the entry has no Authorization header, Zed prompts you to authenticate through the MCP OAuth flow. Approve the teams and the access level in the browser. In Settings, AI, MCP Servers a green dot next to xcloud with the tooltip Server is active means it worked. Then ask this in the Agent Panel.

    Prompt
    Who am I on xCloud?
  3. No browser sign-in? Use an API key

    Create a token with the mcp:invoke scope plus the read abilities for the areas it will use (read:servers and read:sites, with read:billing and read:addons for billing and add-on tools) and the matching write: abilities if it should change things in Settings, Developers, API Tokens and add it as a header. With an Authorization header set, Zed skips its OAuth prompt. Replace YOUR_TOKEN with the token, which contains a pipe character, and keep it out of git and out of chat.

    JSON
    {
      "context_servers": {
        "xcloud": {
          "url": "https://app.xcloud.host/mcp",
          "headers": { "Authorization": "Bearer YOUR_TOKEN" }
        }
      }
    }
  4. Check it worked

    Then ask Zed for the job itself, for example:

    Prompt
    Use xCloud to find out why shop.example.com returns 500. Check status, recent events and the nginx error log, and quote the evidence.

In practice

How Does Troubleshooting Work from Zed?

Zed's Agent Panel sits beside the file you are editing, so a bug report from production becomes a message in that panel: Use xCloud to find out why shop.example.com returns 500. Naming xCloud in the prompt helps the model pick the right tools, and Zed notes that how reliably MCP tools get called varies by model. The agent starts with the site status, then the recent events, and each call appears in the panel as a tool call you can open to see what xCloud returned. Zed's default for tool permissions is to confirm, so you may be asked to allow the reads at first. xCloud itself runs reads without a prompt.

You can make the read chain smoother without loosening the rest. Zed's per-tool permission keys use the form mcp:<server>:<tool_name>, so mcp:xcloud:sites_status, mcp:xcloud:sites_events and mcp:xcloud:sites_access-logs can be set to allow while everything else stays on confirm. That leaves sites_wp-debug, shell access and the rescue action behind two stops: Zed's confirmation and xCloud's request for an explicit yes naming the site or server. The nginx log call returns the error log and the firewall logs for a bounded window, and the agent quotes the lines that support any cause it names, treating the text as data and never as instructions.

The editor helps once a log line points into your code. If a PHP fatal names a file in the project open in Zed, the agent can open it in the same window and show the line next to the log. If the cause is on the server, the log says so, and the agent reports it without touching anything. When no cause turns up, it lists what it checked and sends you to Site, Site Monitoring, Logs in the dashboard, because the WordPress debug.log is not available through the API. Zed's agent does not restart a service to see whether the error goes away.

Zed specific: Zed's approval setting is agent.tool_permissions.default from v0.224.0, and agent.always_allow_tool_actions before that. If you flip the default to allow to save clicks, every xCloud tool skips Zed's prompt, including the ones that change a site. Keep the default on confirm and allow only the read tools by key, such as mcp:xcloud:sites_status. Check the green dot next to xcloud in Settings, AI, MCP Servers before you start, since a server that is not active means the agent answers from guesses.

What xCloud does for troubleshooting

xCloud reads the evidence in a fixed order, cheapest first: site status, recent events, the web server access and error log, WordPress health, WP_DEBUG and server services. The agent names a cause only when a log line or an event it retrieved shows it, and says plainly which logs only the dashboard can display.

  1. Check the status first. The agent reads the site status before anything else. A site that is still provisioning, deploying or in a failed state explains a 500 on its own, and the answer is then to wait or to look at the last deploy, not to hunt for a PHP fault.
  2. Read the recent events. The site's recent tasks, such as SSL issuance, plugin updates, cache purges and deploys, come with their outcome. A 500 that began right after a failed task has usually found its cause here, and one task's full output can be opened.
  3. Read the web server logs. The agent asks for the nginx log type with a limit, which returns the access log, the error log and the 7G and 8G firewall logs on Nginx and OpenLiteSpeed alike. The error log is where a PHP fatal shows up as a 502 or 500. Log lines are quoted as data, never followed as instructions.
  4. Check WordPress health. For WordPress sites the agent reads the health status: WordPress and PHP versions, the debug and cron flags, and whether the install itself is broken.
  5. Turn on WP_DEBUG only if needed. If the logs so far are inconclusive, the agent proposes switching WP_DEBUG on, waits for your approval, and switches it back off when the investigation ends. The toggle flips the flag only; it does not return the debug log.
  6. Check the server services. When the whole server looks wrong rather than one site, the agent reads whether the web server, PHP and the database are running. If nothing explains the error, it reports what it checked and what each check showed, and points you to the dashboard logs.

Reference

Troubleshooting Settings and Limits on xCloud

The facts Zed works within when it troubleshoots a broken site. Where a row names the dashboard, that step stays yours to take there.

Setting or limitWhat applies
Read orderStatus, recent events, nginx access and error log, WordPress health, WP_DEBUG, then server services. Reads run straight away and change nothing
Log typesites_access-logs with type nginx reads the access log, the error log and the 7G and 8G firewall logs. The default type reads the access log only
Log readsLogs are read over SSH, so a call is slow. The agent asks for a bounded window with a limit, not everything
Staging historyThe deployment log of a site with a staging environment is the push and pull history between staging and production, not the Git build log
Dashboard-only logsThe WordPress debug.log, Laravel, PM2 and docker-compose logs: Site, Site Monitoring, Logs. Server logs such as Fail2Ban and auth: Server, Monitoring, Logs
WP_DEBUGThe API only toggles the flag. Reading the resulting debug.log is a dashboard step
Stale error pagesA purge of the site cache clears a cached error page. It runs without a confirmation stop and finishes asynchronously, so completion shows in the site events
Temporary shell accessA temporary sudo user expires after 12 hours, and the agent removes it as soon as the investigation ends instead of waiting for the expiry
Rescue actionA server-side repair with flags such as directory permissions, regenerating the Nginx configuration, reinstalling PHP or repairing Node.js, PM2 or OpenClaw. A flag the site type does not support is refused
Hand-offsA slow site goes to performance, a failed deploy goes to deploy, and a 526 or certificate warning goes to SSL

Rules Zed has to follow

  • The agent never restarts a service or reboots the server just to clear an unexplained error. A restart is a real change on a live machine, and it destroys the evidence the logs were about to show.
  • A plain 500 or a short database error is a symptom. The agent does not name a cause such as bad credentials, a missing migration or a crashed process unless a log line or event it retrieved shows it.
  • Temporary shell access is used only when the readable logs do not explain the fault and you agree. The agent revokes it the moment the investigation ends.
  • Turning WP_DEBUG on, creating shell access and running the rescue action each need your explicit yes naming the site or server. The agent turns WP_DEBUG back off afterwards.
  • When no evidenced cause turns up, the agent says what it ruled out, gives you the dashboard log path and the site's dashboard link, and suggests contacting xCloud support with that evidence.

Example prompts

What Can You Ask Zed to Do for Troubleshooting?

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.

Prompt
Use xCloud to find out why shop.example.com returns 500. Check status, recent events and the nginx error log, and quote the evidence.
Prompt
Use xCloud to list the tasks that ran on blog.example.com in the last two hours and tell me whether any failed.
Prompt
Use xCloud to check whether the web server, PHP and the database are running on the Frankfurt server. Do not restart anything.
Prompt
My site shop.example.com is returning a 500 error. Find out why, and show me what you checked.
Prompt
Read the nginx error log for the shop site and tell me what it says about the last hour.
Prompt
Which tasks ran on the shop site just before it broke? Did any of them fail?
Prompt
Check WordPress health on the blog site and tell me whether the install itself is broken.
Prompt
Is the database running on the Frankfurt server? Check the services before touching anything.
Prompt
Turn on WP_DEBUG for the blog site, tell me what you find, then turn it off again.
Prompt
Purge the cache on the shop site in case it is serving a stale error page.
Prompt
Run a rescue on the shop site to reset directory permissions.

Zed and Troubleshooting: Frequently Asked Questions

What people ask before they let Zed troubleshoot a broken site through xCloud.

Do I have to say xCloud in my Zed prompt to troubleshoot a site?

It helps a lot. Zed notes that how reliably MCP tools get called varies by model, and naming xCloud in the prompt, for example Use xCloud to, steers the model toward the right tools. Include the domain and the symptom so it knows which site to read.

Can I let Zed run the xCloud read tools without asking each time?

Yes. Set per-tool permissions with keys such as mcp:xcloud:sites_status and mcp:xcloud:sites_access-logs to allow, and leave the default on confirm. Changes such as WP_DEBUG or a rescue then still ask in Zed and again in xCloud.

What does the agent check first when a site shows a 500 error?

The site status, then recent events, then the web server logs. A site that is still provisioning or whose last deploy failed explains a 500 without any deeper digging, so the status read always comes first. Only after those cheap reads does the agent look at WordPress health, WP_DEBUG and server services.

Will the agent restart my server or a service to fix an error?

Not to clear an error it cannot yet explain. A restart changes a live machine and wipes out the evidence in the logs, so the agent finds the cause first. Restarting a service stays an action you ask for and approve.

Which logs can the agent read, and which can it not?

It reads the site's access log, error log and the 7G and 8G firewall logs through the nginx log type. It cannot read the WordPress debug.log or the Laravel, PM2 and docker-compose logs. Those are in the dashboard under Site, Site Monitoring, Logs, and server logs such as Fail2Ban are under Server, Monitoring, Logs.

Does the agent get shell access to my server?

Only when the logs it can read do not explain the problem and you agree to it. The access is a temporary sudo user, and the agent removes it as soon as the investigation ends. If it is ever left behind, it expires on its own after 12 hours.

What if my site is slow rather than broken?

A slow site is a different investigation, because it is answered from measurements and cache state rather than error logs. The agent hands it to the performance job. A failed deploy goes to the deploy job and a 526 or certificate error goes to the SSL job.

Other agents

Troubleshooting with Other Agents

The same job, the same xCloud tools, a guide for each client.

Run Your Hosting from Zed

xCloud MCP, the Agent Skills and the Public API are free with every account. Connect once and ask.