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

# MCP Setup

> Configure Cursor, Claude Code, Codex, and other MCP-compatible AI agents to deploy and manage RepoCloud VPS instances

## What is MCP?

The **Model Context Protocol (MCP)** is an open standard that lets AI agents use external tools. When you connect RepoCloud as an MCP server, your AI coding agent can:

* Deploy Ubuntu VPS instances on demand
* Check server status and get connection credentials
* Power on, power off, and reboot servers
* Resize instances to different resource tiers
* Delete instances when they are no longer needed

All actions use your API key and count against your RepoCloud balance — the AI agent acts on your behalf.

## Prerequisites

1. A RepoCloud account with email verified
2. A minimum \$1 deposit (go to [Billing](https://repocloud.io/billing))
3. An API key from the [API / MCP tab](https://repocloud.io/mcp) in your dashboard

## Setup by Agent

<Tabs>
  <Tab title="Cursor">
    Add the following to your Cursor MCP configuration file (`.cursor/mcp.json` in your project, or the global settings):

    ```json theme={null}
    {
      "mcpServers": {
        "repocloud": {
          "url": "https://repocloud.io/api/v1/mcp",
          "headers": {
            "Authorization": "Bearer rcmcp_your_key_here"
          }
        }
      }
    }
    ```

    After adding the configuration, restart Cursor. The RepoCloud tools will appear in the agent's available tool list.
  </Tab>

  <Tab title="Claude Code">
    Add RepoCloud to your Claude Code MCP configuration:

    ```json theme={null}
    {
      "mcpServers": {
        "repocloud": {
          "url": "https://repocloud.io/api/v1/mcp",
          "headers": {
            "Authorization": "Bearer rcmcp_your_key_here"
          }
        }
      }
    }
    ```
  </Tab>

  <Tab title="Other MCP Agents">
    Any MCP-compatible agent can connect to RepoCloud. Use the following server configuration:

    * **Server URL**: `https://repocloud.io/api/v1/mcp`
    * **Authentication**: Bearer token in the `Authorization` header
    * **Token format**: `Bearer rcmcp_your_key_here`
  </Tab>
</Tabs>

## Available Tools

Once connected, the AI agent has access to these tools:

| Tool              | Description                          | Maps to API Endpoint                  |
| ----------------- | ------------------------------------ | ------------------------------------- |
| `deploy_instance` | Deploy a new Ubuntu VPS              | `POST /api/v1/instances`              |
| `list_instances`  | List all API-created instances       | `GET /api/v1/instances`               |
| `get_instance`    | Get instance details and live status | `GET /api/v1/instances/{id}`          |
| `delete_instance` | Destroy an instance                  | `DELETE /api/v1/instances/{id}`       |
| `instance_action` | Power on/off, reboot, or resize      | `POST /api/v1/instances/{id}/actions` |

## Example Conversations

Here are examples of what you can ask your AI agent after connecting RepoCloud:

### Deploy a server

> "Deploy a new 4 GB Ubuntu VPS called 'staging-api' and give me the SSH credentials when it's ready."

The agent will call `deploy_instance` with the appropriate flavor, poll for readiness, and return the connection details.

### Check server status

> "What's the status of all my RepoCloud servers?"

The agent will call `list_instances` and summarize the results.

### Resize a server

> "Resize my staging-api server to 8 GB RAM."

The agent will identify the instance, call `instance_action` with `type: resize` and the `s-4vcpu-8gb` flavor.

### Clean up

> "Delete all my RepoCloud servers that are currently powered off."

The agent will list instances, filter for paused ones, and call `delete_instance` for each.

## Security

* Your API key gives full control over your Ubuntu VPS instances — treat it like a password
* The AI agent can deploy instances (which costs money) and delete instances (which is irreversible)
* Rate limits apply: 60 requests per minute, 5 deploys per hour
* Revoke the key immediately from the [API / MCP tab](https://repocloud.io/mcp) if you suspect it has been compromised

## OpenAPI Specification

The full API schema is available as an OpenAPI 3.0 specification:

```
https://repocloud.io/api/v1/openapi.json
```

This spec is served dynamically and always reflects the current API. MCP agents that support OpenAPI can use this URL directly for tool discovery.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Agent says 'tool not found' or 'server unreachable'">
    Verify the server URL is exactly `https://repocloud.io/api/v1/mcp` (no trailing slash issues). Restart your editor or agent after adding the configuration.
  </Accordion>

  <Accordion title="Agent gets 401 Unauthorized">
    Check that your API key starts with `rcmcp_` and is active. Go to the [API / MCP tab](https://repocloud.io/mcp) to verify.
  </Accordion>

  <Accordion title="Agent gets 402 when deploying">
    Your balance is \$3 or less. Add funds at [Billing](https://repocloud.io/billing).
  </Accordion>

  <Accordion title="Agent gets 429 Too Many Requests">
    Rate limit exceeded. The `Retry-After` header indicates how long to wait. The deploy limit is 5 per hour.
  </Accordion>
</AccordionGroup>
