> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hasmcp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect HasMCP MCP Servers to Google Antigravity

> How to connect HasMCP servers to the Google Antigravity editor.

# Connecting to Google Antigravity

Google Antigravity supports the Model Context Protocol (MCP) natively, allowing the editor to securely connect to tools and external services defined in your HasMCP dashboard.

## Setup Instructions

Antigravity manages connections through its built-in **MCP Store**.

### 1. Access the MCP Configuration

<Steps>
  <Step title="Open Agent Panel">
    Open the **Antigravity Editor** and locate the **Agent Panel** in the side
    panel.
  </Step>

  <Step title="Manage Servers">
    Click the **"..." (three dots) dropdown** at the top of the panel and select
    **Manage MCP Servers**.
  </Step>
</Steps>

### 2. Configure Custom HasMCP Server

<Steps>
  <Step title="Edit Config">
    In the Manage MCP Servers view, click on **View raw config**. This will open
    your `mcp_config.json` file.
  </Step>

  <Step title="Add Server">
    Add your HasMCP server to the `mcpServers` object. You can use the `@hasmcp/remote-mcp` bridge for enhanced security, or a direct URL connection:
  </Step>
</Steps>

#### Option A: Direct URL Connection

This is the simplest way to connect if your server supports token-based URL authentication.

```json theme={null}
{
  "mcpServers": {
    "hasmcp-server": {
      "serverUrl": "https://<PROJECT_ID>.mcp.hasmcp.com/mcp?token=<YOUR_TOKEN>"
    }
  }
}
```

#### Option B: Remote Bridge (Recommended for Security)

Uses the `@hasmcp/remote-mcp` bridge to keep your token in environment variables.

```json theme={null}
{
  "mcpServers": {
    "myServer": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://app.hasmcp.com/mcp/<SERVER_ID>",
        "--header",
        "x-hasmcp-key: Bearer ${HASMCP_MCP_ACCESS_TOKEN}"
      ],
      "env": {
        "HASMCP_MCP_ACCESS_TOKEN": "YOUR_TOKEN_VALUE"
      }
    }
  }
}
```

* **PROJECT\_ID / SERVER\_ID**: Your unique project or server identifier from the HasMCP dashboard.
* **YOUR\_TOKEN / YOUR\_TOKEN\_VALUE**: The secure token generated for your server.

### 3. Save and Verify

Save the mcp\_config.json file.

The editor will automatically attempt to initialize the connection.

Resources and tools from your HasMCP server will now be available to the AI agent for real-time context and action execution.

## Troubleshooting

Authentication: Ensure your token is valid and the header is correctly prefixed with Bearer.

Node.js Required: Since the connection uses npx, ensure Node.js is installed on your system.

Manual Refresh: If tools do not appear immediately, try toggling the server off and on within the Manage MCP Servers list.
