# How to Connect Antigravity to xCloud MCP

> Connect Google Antigravity to xCloud with one serverUrl entry in mcp_config.json, then deploy, back up, update and fix servers and sites by asking.

Antigravity is Google's agentic coding product, available as an IDE, a command-line tool and the Antigravity 2.0 app. Connected to xCloud through the MCP server, its agent deploys repositories, takes backups, updates WordPress and diagnoses failures while you stay in the editor.

This guide covers the connection only. For what Antigravity can do once it is connected, with one guide per hosting job, see the [Antigravity and xCloud guide](/agents/antigravity/). The xCloud side is free with every account, including the free plan.

## What you need

- An xCloud account. If you do not have one yet, [sign up for free](https://app.xcloud.host/register).
- Antigravity installed and signed in.
- A browser for the OAuth sign-in. A machine without a browser can use an API key instead; the steps below show both.

The xCloud MCP server lives at one endpoint, `https://app.xcloud.host/mcp`, over the MCP Streamable HTTP transport. The same setup also lives in your dashboard under **Settings → Developers → MCP**.

## Step 1: Add xCloud in View raw config

In the Antigravity IDE, click the three dots at the top of the agent side panel, choose MCP Servers, then Manage MCP Servers, then View raw config. Paste this into mcp_config.json and save. The field is serverUrl: it is the only remote URL property in Antigravity's documented configuration, so do not write url or httpUrl.

```json
{
  "mcpServers": {
    "xcloud": {
      "serverUrl": "https://app.xcloud.host/mcp"
    }
  }
}
```

## Step 2: Sign in, then check the connection

Open Agent settings (Cmd+, on Mac, Ctrl+, on Windows and Linux), go to Customizations and click Authenticate next to xcloud. Approve the teams and the access level in the browser, copy the authorization code it shows, paste it into the settings panel and click Submit. Then ask this in the agent panel.

```text
Who am I on xCloud?
```

## Step 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. Replace YOUR_TOKEN with the token, which contains a pipe character, and never paste it into chat. Keep this file out of git.

```json
{
  "mcpServers": {
    "xcloud": {
      "serverUrl": "https://app.xcloud.host/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_TOKEN"
      }
    }
  }
}
```

## Approve access in your browser

The first time Antigravity reaches for an xCloud tool, your browser opens on the xCloud authorization screen. Tick the teams the connection may act on and choose **Read-only** or **Full access**. Antigravity handles OAuth itself for servers that support dynamic client registration, which xCloud does, so serverUrl is all the setup it needs. Antigravity stores the access token locally and refreshes it. A machine without a browser passes an API key that carries the mcp:invoke scope and the read or write abilities it needs in headers.

![The xCloud authorization screen: the signed-in account, the teams to tick, and the choice between Full access and Read-only](/_landing/docs/how-to-connect-xcloud-mcp-to-ai-agent-oauth-teams.png)

Every connection is listed with your [API keys](https://app.xcloud.host/user/api-tokens), so you can revoke it at any time. Read-only is enough for reports and checks; choose Full access when you want the agent to deploy, update or change things. With Full access, routine actions such as a backup, a cache purge or a service restart run without an xCloud prompt, while creating, deploying, updating, rebooting, deleting or buying still waits for your confirmation.

## Check it worked

Ask Antigravity:

```text
Who am I on xCloud?
```

It should answer with your real account name, email and teams, not a guess. If it says it has no xCloud tools, re-check the step above and restart the client.

## What Antigravity can do on xCloud

On the xCloud side, reads run straight away, and anything that creates, deploys, updates, reboots, deletes or buys is previewed first and waits for your confirmation. Antigravity's own approval prompts, where it has them, apply on top of that. A few prompts to start with:

```text
Use xCloud to list my servers and show which ones are running low on disk space.
```

```text
Deploy https://github.com/acme/shop to my Frankfurt server and show me the dry run before you create anything.
```

```text
The last deploy of the API site failed. Diagnose it, fix the build command and retry on the same site.
```

There is a guide for each hosting job, from deploying a repository to fixing a 502, on the [Antigravity and xCloud guide](/agents/antigravity/), and a longer prompt library in [What You Can Ask xCloud MCP to Do](/what-you-can-ask-xcloud-mcp-to-do/).

## Good to know

- Use serverUrl. Antigravity's documented remote property is serverUrl, so an entry written with url or httpUrl, as other clients use, is not the form to rely on.
- OAuth in Antigravity ends with a pasted authorization code: copy the code from the browser tab and submit it under Settings, Customizations. The sign-in is not complete until you do.
- Antigravity's permission policy can allow tools with patterns such as mcp(xcloud/tool_name). Allow read tools one by one; a wildcard like mcp(xcloud/*) would also skip the prompt for changes.
- Hosting Antigravity on an xCloud server is a different product. This page is about Antigravity managing your hosting.

## Frequently asked questions

### How do I connect Antigravity to xCloud?

In the Antigravity IDE, open the three-dot menu in the agent side panel, choose MCP Servers, Manage MCP Servers and View raw config. Add an xcloud entry under mcpServers with serverUrl set to https://app.xcloud.host/mcp, save, then click Authenticate next to xcloud under Settings, Customizations and approve access in the browser.

### Why does Antigravity use serverUrl instead of url?

Because serverUrl is the property Antigravity's MCP documentation defines for remote Streamable HTTP and SSE servers. Write serverUrl for xCloud, not url or httpUrl, which other clients use. If the server does not connect, check that field name first.

### How does sign-in work, and do I need an API key?

Antigravity supports servers that use dynamic client registration, and xCloud does, so no client ID is needed. You click Authenticate, approve the teams and access level in the browser, then paste the authorization code back into settings. An API key is only for machines without a browser, sent as an Authorization header with the mcp:invoke scope and the abilities it needs.

### Where is mcp_config.json?

Globally at ~/.gemini/config/mcp_config.json, or per project at .agents/mcp_config.json. The View raw config button in the IDE opens the global file. Both use the same mcpServers format.

## Next steps

- [Antigravity and xCloud: every job guide](/agents/antigravity/)
- [How to connect xCloud MCP to your AI agent](/docs/how-to-connect-xcloud-mcp-to-ai-agent/) for the other clients
- [Multi-team API tokens and MCP access](/docs/multi-team-api-tokens-and-mcp-access/)

If you run into any issues connecting, feel free to reach out to our [support team](/docs/access-built-in-support-portal-in-xcloud/).
