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

# Model Context Protocol (MCP)

> Let AI agents manage your Latitude.sh infrastructure through our hosted MCP server

The Latitude.sh MCP server lets AI agents and chat-based IDEs interact with the Latitude.sh API in natural language — list servers, deploy bare metal, manage networking, and more.

It runs as a **hosted remote server** — for most clients there's nothing to install or run locally; you just point your MCP client at the URL below and connect. (Claude Desktop is the exception: it installs a small bundle.)

<Columns cols={2}>
  <Card title="MCP server repository" href="https://github.com/latitudesh/latitudesh-mcp" icon="github" horizontal />

  <Card title="Live server" href="https://mcp.latitude.sh" icon="globe" horizontal />
</Columns>

## How authentication works

There are two ways to connect, depending on what your client supports:

* **OAuth (recommended)** — Clients that support remote MCP over OAuth (Claude, Claude Code, Gemini CLI) connect to `https://mcp.latitude.sh/mcp` with **no API key in the config**. On first connect you're sent to your Latitude dashboard to approve the connection, and the server uses the key it mints for you.
* **API key header** — Clients without OAuth send your Latitude.sh API key in the **`bearer`** header to the `/sse` endpoint. Grab a key from your [dashboard](https://www.latitude.sh/dashboard/api-keys).

## Server URL

<CodeGroup>
  ```text OAuth (Streamable HTTP) theme={null}
  https://mcp.latitude.sh/mcp
  ```

  ```text API key (SSE) theme={null}
  https://mcp.latitude.sh/sse
  ```
</CodeGroup>

<Note>
  `/mcp` is OAuth-protected. For key-based clients use `/sse` (or
  `/direct/mcp` for Streamable HTTP) and send the `bearer` header. The optional
  `latitude-api-key` and `server-index` headers are also accepted.
</Note>

## Connect your client

<Tabs>
  <Tab title="Claude Code">
    Connect over OAuth — no API key needed. Run:

    ```bash theme={null}
    claude mcp add --transport http Latitudesh https://mcp.latitude.sh/mcp
    ```

    On first use, Claude Code opens your browser to approve the connection in your Latitude dashboard.
  </Tab>

  <Tab title="Gemini CLI">
    Connect over OAuth — no API key needed. Run:

    ```bash theme={null}
    gemini mcp add --transport http Latitudesh https://mcp.latitude.sh/mcp
    ```

    Approve the connection in your Latitude dashboard when prompted.
  </Tab>

  <Tab title="Cursor">
    Open **Settings → Tools and Integrations → New MCP Server** and paste (replace `YOUR_LATITUDE_API_KEY`):

    ```json theme={null}
    {
      "mcpServers": {
        "Latitudesh": {
          "command": "npx",
          "args": [
            "-y",
            "mcp-remote@latest",
            "https://mcp.latitude.sh/sse",
            "--header",
            "bearer:${BEARER}"
          ],
          "env": {
            "BEARER": "YOUR_LATITUDE_API_KEY"
          }
        }
      }
    }
    ```
  </Tab>

  <Tab title="VS Code (Copilot)">
    Open the Command Palette → **MCP: Open User Configuration** and add:

    ```json theme={null}
    {
      "servers": {
        "Latitudesh": {
          "command": "npx",
          "args": [
            "-y",
            "mcp-remote@latest",
            "https://mcp.latitude.sh/sse",
            "--header",
            "bearer:${BEARER}"
          ],
          "env": {
            "BEARER": "YOUR_LATITUDE_API_KEY"
          }
        }
      }
    }
    ```

    Restart VS Code and enable Agent mode in Copilot Chat.
  </Tab>

  <Tab title="Windsurf">
    Go to **Settings → Cascade → Manage MCPs → View raw config** and add:

    ```json theme={null}
    {
      "mcpServers": {
        "Latitudesh": {
          "command": "npx",
          "args": [
            "-y",
            "mcp-remote@latest",
            "https://mcp.latitude.sh/sse",
            "--header",
            "bearer:${BEARER}"
          ],
          "env": {
            "BEARER": "YOUR_LATITUDE_API_KEY"
          }
        }
      }
    }
    ```
  </Tab>

  <Tab title="Codex">
    Add to your Codex configuration (replace `YOUR_LATITUDE_API_KEY`):

    ```toml theme={null}
    [mcp_servers.Latitudesh]
    url = "https://mcp.latitude.sh/sse"
    http_headers = { "bearer" = "YOUR_LATITUDE_API_KEY" }
    ```
  </Tab>

  <Tab title="Claude Desktop">
    One-click install via the MCP bundle:

    <Steps>
      <Step title="Download the bundle">
        Get `mcp-server.mcpb` from the [GitHub releases](https://github.com/latitudesh/latitudesh-mcp/releases).
      </Step>

      <Step title="Open Extensions">
        In Claude Desktop, go to **Settings → Extensions**.
      </Step>

      <Step title="Install">
        Drag the bundle onto the Extensions page and follow the prompts.
      </Step>
    </Steps>
  </Tab>
</Tabs>

<Note>
  For any key-based client not listed above, use the same `mcp-remote`
  configuration shown in the tabs: run `npx -y mcp-remote@latest
      https://mcp.latitude.sh/sse --header bearer:${BEARER}` and keep your API key
  in a `BEARER` env var rather than inlining it.
</Note>

## What you can do

Be explicit in your prompts (e.g. *"List my servers on Latitude.sh"*) so the agent uses the MCP tools rather than searching locally.

* 🔎 List and inspect servers, projects, SSH keys, and events
* ⚙️ Create, reinstall, lock, or delete bare-metal servers
* 🖥️ Manage virtual machines and Kubernetes clusters
* 💾 Provision block, filesystem, and object storage
* 📡 Configure private networks, VPN sessions, elastic IPs, and firewalls
* 👥 Manage teams, members, roles, tags, and API keys
* 📊 Check traffic, bandwidth, and billing usage

The server exposes tools across **API Keys, Billing, Servers, Virtual Machines, Kubernetes, Projects, SSH Keys, Storage, Private Networks, VPN Sessions, Elastic IPs, IP Addresses, Firewalls, Plans, Regions, Roles, Tags, Teams, Traffic, User Data, and Events**.

## Contributing

The Latitude.sh MCP server is open source. Visit the [GitHub repository](https://github.com/latitudesh/latitudesh-mcp) to open issues or submit pull requests.
