# Manage Your Hosting from OpenCode with xCloud

> Connect OpenCode to xCloud with one remote MCP entry and opencode mcp auth, then deploy, back up, update and fix servers and sites by asking in your terminal.

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

## How do I connect OpenCode to xCloud?

### 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.

```bash
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.

```bash
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}"
        }
      }
    }
  }
}
```

**Authentication:** 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.

Verify with: "Who am I on xCloud?"

### Example session

**You:** Make a staging copy of blog.example.com so I can test a theme update.
→ `xcloud_sites_show` (read-only)
**Agent:** blog.example.com is a WordPress site on your Frankfurt server. Create a staging site on a new hostname?
**You:** Yes.
→ `xcloud_sites_stagingSites_create` (needs approval)
**Agent:** Staging is ready and https://blog-staging.example.xcloud.site answers 200.

## Which way should I connect OpenCode to xCloud?

|  | xCloud MCP server | xCloud Agent Skills | Public API |
|---|---|---|---|
| Terminal needed | No | Yes for the plugin or ClawHub install | Yes |
| Authentication | OAuth sign-in, or an API key with mcp:invoke plus read or write abilities | The MCP connection, or a read-scoped API token | API token with scoped abilities |
| What it adds | One tool per customer-facing xCloud operation (188 today) | Workflow know-how: routing, dry run, confirm, poll, diagnose | Raw REST for your own code |
| Changes to your infrastructure | Yes, after confirmation | Only through a connected MCP tool, after confirmation | Yes, with write scopes |
| Best for | Most people; every MCP client | Agents that run shell commands and read skills | CI jobs, dashboards and long-running loops |

## 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.

## 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.

## What can you ask OpenCode to do on xCloud?

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

## OpenCode guides by job

- [Deploy from Git with OpenCode](https://xcloud.host/agents/opencode/deploy-from-git/): Turn a GitHub, GitLab or Bitbucket repository into a live site on a server you already have.
- [Run Docker apps with OpenCode](https://xcloud.host/agents/opencode/docker-apps/): Run a Dockerfile or Docker Compose app on a Docker server, keep it backed up and recover it when a deploy fails.
- [Install one-click apps with OpenCode](https://xcloud.host/agents/opencode/one-click-apps/): Pick an app from the xCloud catalogue, check it fits your server, install it and get the login details.
- [Manage WordPress with OpenCode](https://xcloud.host/agents/opencode/wordpress/): Keep WordPress sites updated, scanned and healthy, and create new ones, by asking in plain words.
- [Back up and stage sites with OpenCode](https://xcloud.host/agents/opencode/backups-and-staging/): Check that your sites are backed up, take a backup before a risky change, and open a staging copy to test it on.
- [Manage SSL and domains with OpenCode](https://xcloud.host/agents/opencode/ssl-and-domains/): Check a site's certificate and DNS, install or renew HTTPS, and see which domains point at it.
- [Manage servers with OpenCode](https://xcloud.host/agents/opencode/server-management/): See how your servers are doing, change services and runtimes, tighten security and reboot with proof it worked.
- [Troubleshoot a broken site with OpenCode](https://xcloud.host/agents/opencode/troubleshooting/): Find out why a site returns a 500, 502 or 503, shows a critical error or has stopped answering.
- [Speed up a slow site with OpenCode](https://xcloud.host/agents/opencode/performance/): Find out why a site is slow, from real numbers, and learn which fix is a dashboard switch.
- [Secure sites and servers with OpenCode](https://xcloud.host/agents/opencode/security/): Find vulnerable sites, manage server firewall rules and banned IPs, and see which protections are on.

## Frequently asked questions

### 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.

## Also works with

- [Claude Code](https://xcloud.host/agents/claude-code/): Anthropic's terminal coding agent. One claude mcp add command, plus the xCloud skills plugin with nine skills on top.
- [Claude](https://xcloud.host/agents/claude/): Anthropic's chat assistant on the web and desktop. Add xCloud as a custom connector, no terminal needed.
- [Claude Cowork](https://xcloud.host/agents/claude-cowork/): Anthropic's desktop agent for delegated work. Add the xCloud connector, then hand off hosting jobs.
- [Cursor](https://xcloud.host/agents/cursor/): The AI code editor. One mcp.json entry with the compact URL, because Cursor stops at 40 tools.
- [Codex](https://xcloud.host/agents/codex/): OpenAI's coding agent for the terminal. A codex mcp add command or a config.toml entry, then codex mcp login.
- [Hermes Agent](https://xcloud.host/agents/hermes-agent/): Nous Research's agent with memory and a built-in scheduler. An mcp_servers entry in config.yaml and one login.
- [OpenClaw](https://xcloud.host/agents/openclaw/): The open-source agent runtime with chat apps and automations. ClawHub skill plus the MCP client.
- [Windsurf](https://xcloud.host/agents/windsurf/): The Cognition editor, now Devin Desktop. devin mcp add for the Devin Local agent, a serverUrl entry for legacy Cascade.
- [GitHub Copilot](https://xcloud.host/agents/github-copilot/): Copilot agent mode in VS Code. One .vscode/mcp.json entry, or the Agent Plugins package.
- [Gemini CLI](https://xcloud.host/agents/gemini-cli/): Google's terminal agent. One gemini mcp add command, OAuth found automatically.
- [ChatGPT](https://xcloud.host/agents/chatgpt/): OpenAI's chat assistant. A developer-mode app with the xCloud MCP URL and OAuth.
- [ChatGPT dots](https://xcloud.host/agents/chatgpt-dots/): OpenAI's always-on agent in ChatGPT. Uses the xCloud MCP plugin you add in ChatGPT, with custom rules and scheduled tasks.
- [Grok](https://xcloud.host/agents/grok/): xAI's terminal agent, Grok Build. One grok mcp add command or a config.toml entry.
- [Grok Bot](https://xcloud.host/agents/grok-bot/): xAI's always-on Bots on a cloud computer. One Remote HTTPS MCP plugin, OAuth sign-in, routines on a schedule.
- [Kiro](https://xcloud.host/agents/kiro/): AWS's agentic IDE. One url entry in .kiro/settings/mcp.json, plus the portable xCloud Agent Plugins package.
- [Antigravity](https://xcloud.host/agents/antigravity/): Google's agentic IDE. One serverUrl entry in mcp_config.json and a browser sign-in.
- [Zed](https://xcloud.host/agents/zed/): The Zed editor's Agent Panel. One context_servers entry in settings.json and a browser sign-in.

## Related

- [How to connect xCloud MCP to your AI agent](https://xcloud.host/docs/how-to-connect-xcloud-mcp-to-ai-agent/)
- [Deploy Git projects with the xCloud API and MCP](https://xcloud.host/docs/deploy-git-projects-with-xcloud-public-api-and-mcp/)
- [Multi-team API tokens and MCP access](https://xcloud.host/docs/multi-team-api-tokens-and-mcp-access/)

Setup checked against:
- [OpenCode MCP servers documentation](https://opencode.ai/docs/mcp-servers/)

Canonical: https://xcloud.host/agents/opencode/
Last updated: October 2026. Keep a human in the loop: xCloud stops and asks before anything that creates, deploys, updates, reboots, deletes or buys.
Every agent guide: https://xcloud.host/agents/ · xCloud MCP: https://xcloud.host/mcp/ · Agent Skills: https://xcloud.host/ai-agent-skills/ · Setup script for agents: https://xcloud.host/agent-setup/prompt.md
