OpenCode + xCloud

Manage Your Hosting from OpenCode with xCloud

OpenCode is an open-source AI coding agent that runs in your terminal and can use remote MCP servers alongside its built-in tools. Connected to xCloud through the MCP server, it deploys repositories, takes backups, updates WordPress and diagnoses failures from the session you already have open.

  • One config entry and one auth command
  • OAuth sign-in with no client ID to paste
  • Free with every xCloud account

YouMake a staging copy of blog.example.com so I can test a theme update.

xcloud_sites_showread-only

Agentblog.example.com is a WordPress site on your Frankfurt server. Create a staging site on a new hostname?

YouYes.

xcloud_sites_stagingSites_createneeds approval

AgentStaging is ready and https://blog-staging.example.xcloud.site answers 200.

. Keep a human in the loop: xCloud stops and asks before anything that creates, deploys, updates, reboots, deletes or buys.

Setup

How Do I Connect OpenCode to xCloud?

Point OpenCode at the xCloud MCP server, approve access in your browser, then ask. The whole thing takes a couple of minutes.

  1. Add the xCloud MCP server

    Run this from the project that should use xCloud, or add --global to make it available everywhere. OpenCode writes the entry under mcp.servers in its config (OpenCode v2 no longer accepts server names directly under mcp). Remote servers use OAuth by default, so there is nothing else to fill in; the equivalent hand-written entry is shown below.

    Terminal
    opencode mcp add xcloud --url https://app.xcloud.host/mcp
    
    # the entry it writes to opencode.jsonc
    {
      "$schema": "https://opencode.ai/config.json",
      "mcp": {
        "servers": {
          "xcloud": {
            "type": "remote",
            "url": "https://app.xcloud.host/mcp"
          }
        }
      }
    }
  2. Sign in with OAuth

    This opens your browser on the xCloud approval screen, where you tick the teams and choose Read-only or Full access. Inside OpenCode, /mcps does the same: pick xcloud and sign in. Then opencode mcp list should show xcloud as connected.

    Terminal
    opencode mcp auth xcloud
    opencode mcp list
  3. No browser? Use an API key

    For a headless or CI machine, 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 export it as XCLOUD_TOKEN. Setting oauth to false turns off the automatic sign-in, and the {env:XCLOUD_TOKEN} reference keeps the token out of the file. The entry still lives under mcp.servers.

    JSON
    {
      "mcp": {
        "servers": {
          "xcloud": {
            "type": "remote",
            "url": "https://app.xcloud.host/mcp",
            "oauth": false,
            "headers": {
              "Authorization": "Bearer {env:XCLOUD_TOKEN}"
            }
          }
        }
      }
    }
  4. Check it worked

    opencode mcp auth signs you in with OAuth, and OpenCode stores the tokens locally. A headless machine can send an API key that carries the mcp:invoke scope and the read or write abilities it needs as an Authorization header instead.

    Prompt
    Who am I on xCloud?

Three surfaces

Which Way Should I Connect OpenCode to xCloud?

The MCP server exposes one tool per customer-facing xCloud operation and leaves out eleven internal ones that only the Public API carries; the skills add workflow know-how on top of an MCP connection and, on their own, only read access. All three are free with every account and differ in what you set up and what holds the credentials.

xCloud MCP serverxCloud Agent SkillsPublic API
Terminal neededNo (recommended for OpenCode)Yes for the plugin or ClawHub installYes
AuthenticationOAuth sign-in, or an API key with mcp:invoke plus read or write abilities (recommended for OpenCode)The MCP connection, or a read-scoped API tokenAPI token with scoped abilities
What it addsOne tool per customer-facing xCloud operation (188 today) (recommended for OpenCode)Workflow know-how: routing, dry run, confirm, poll, diagnoseRaw REST for your own code
Changes to your infrastructureYes, after confirmation (recommended for OpenCode)Only through a connected MCP tool, after confirmationYes, with write scopes
Best forMost people; every MCP client (recommended for OpenCode)Agents that run shell commands and read skillsCI jobs, dashboards and long-running loops

Background

What Is OpenCode?

OpenCode is an open-source AI coding agent that runs in the terminal. You configure it with an opencode config file, and it works with both local and remote MCP servers: the tools a server exposes show up next to OpenCode's built-in tools and the model can call them in the same session.

For a remote server that asks you to sign in, OpenCode detects the authentication request, starts the OAuth flow and uses dynamic client registration when the server supports it. xCloud does, so you never create an OAuth app or paste a client ID. The tokens are stored locally and reused on later runs.

That makes xCloud one more set of tools in a terminal you already use for code. You push a branch, ask OpenCode to deploy it, and it hands the work to xCloud, which stops for your approval before it creates anything.

Why OpenCode with xCloud?

Hosting next to your code

OpenCode already has your repository open. Ask it to deploy, back up or update and it calls xCloud from the same session, so you do not switch to a dashboard to run a routine job.

OAuth with nothing to register

OpenCode handles the sign-in and xCloud supports dynamic client registration, so one opencode mcp auth command replaces creating an app, copying secrets and editing a token into a file.

Choose which agents see xCloud

OpenCode can switch a server's tools off globally and turn them on for a single agent. Keep xcloud out of your everyday coding agent and enable it only for an agent you set up for operations.

Guides

What Can OpenCode Do on xCloud?

One guide per hosting job, each with the OpenCode setup, the xCloud tools involved, a settings reference, example prompts and the limits that apply.

Example prompts

What Can You Ask OpenCode to Do on xCloud?

Type these as written and swap in your own 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
Deploy https://github.com/example/shop to my Frankfurt server and show me the dry run before you create anything.
Prompt
Which of my sites have pending WordPress updates? Back each one up first, then update and check the homepages.
Prompt
The last deploy of the API site failed. Read the logs, find the cause and propose a fix before you retry.
Prompt
Is example.com up, is its SSL certificate healthy and does it have any known vulnerabilities?
Prompt
List my servers with disk and memory use, and tell me which one is closest to its limit.

Good to know

  • MCP tools add to the model's context. xCloud exposes 188 operations plus two search tools, so connect the compact URL, https://app.xcloud.host/mcp?profile=compact, if you want the five-tool profile, or scope the toolsets with ?toolsets=sites,servers.
  • OpenCode prefixes each MCP tool with the server name, so every xCloud tool appears as xcloud_ followed by its name. The same prefix lets you allow or deny the whole set with a pattern such as xcloud*.
  • OpenCode keeps the xCloud sign-in in its own local credential store, outside the config file. Run opencode mcp logout xcloud to remove it, and keep API tokens in an environment variable rather than in the config file.

More prompts, grouped by job: What you can ask xCloud MCP to do.

OpenCode and xCloud: Frequently Asked Questions

Short answers about connecting OpenCode, what it may change and what it costs.

How do I connect OpenCode to xCloud?

Run opencode mcp add xcloud --url https://app.xcloud.host/mcp, which writes a remote entry under mcp.servers in your OpenCode config. Then run opencode mcp auth xcloud, approve access in the browser tab that opens, and ask who am I on xCloud to confirm.

Do I need to create an OAuth app or client ID for OpenCode?

No. OAuth is on by default for remote servers, and OpenCode uses dynamic client registration when the server supports it, which xCloud does. Configure only the URL and OpenCode registers itself during the sign-in.

Where does OpenCode keep the xCloud sign-in?

OpenCode keeps the tokens in its own local store, outside the config file. Run opencode mcp list to see the connection status of each server, and opencode mcp logout xcloud to remove the stored credentials and sign in again.

How do I stop xCloud from filling OpenCode's context?

Connect the compact URL, https://app.xcloud.host/mcp?profile=compact, which exposes five tools, or limit the toolsets with ?toolsets=sites,servers. You can also turn the xcloud tools off globally in the OpenCode config and enable them for one agent only.

Can I use an API key instead of OAuth with OpenCode?

Yes. 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, set oauth to false on the xcloud entry and send the token in an Authorization header. Reference it as {env:XCLOUD_TOKEN} so the token itself never lands in the config file.

Can OpenCode change my servers without asking?

Not for the operations xCloud gates. Reads run straight away, and routine actions such as cache purges, backups, PageSpeed and vulnerability scans run without a prompt. Creating a site or server, deploying, updating plugins, rebooting, deleting or buying is refused by xCloud unless the call carries an explicit confirmation, so OpenCode asks you first.

Can I limit OpenCode to read-only access on xCloud?

Yes. On the xCloud approval screen choose Read-only instead of Full access. OpenCode can then look at servers, sites, logs and backups, and any tool that would change something is refused.

Is it free to use OpenCode with xCloud?

The xCloud side is free: the MCP server and the Public API are included with every xCloud account, including the free plan. Any model usage is billed by the provider you set up in OpenCode.

Other agents

Also Works With

The same xCloud account, the same operations, a guide for each client.

Run Your Hosting from OpenCode

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