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

# API and MCP

> Programmatically deploy and manage Ubuntu VPS instances through the RepoCloud REST API or any MCP-compatible AI agent

## Overview

The RepoCloud API lets you deploy, manage, and destroy Ubuntu VPS instances programmatically. Every operation available through the dashboard is accessible through the API, making it ideal for:

* **AI coding agents** (Cursor, Claude Code, Codex) that need to provision servers on demand
* **Automation scripts** that deploy infrastructure as part of CI/CD pipelines
* **Custom dashboards** that manage RepoCloud instances alongside other services

The API is available at `https://repocloud.io/api/v1/` and follows REST conventions with JSON request and response bodies.

## MCP Integration

The same API powers the **Model Context Protocol (MCP)** integration. MCP-compatible AI agents can connect to RepoCloud as a tool server, enabling them to deploy servers, check instance status, and manage infrastructure through natural language.

<CardGroup>
  <Card title="Authentication" icon="key" href="/api/authentication">
    Create API keys and authenticate requests
  </Card>

  <Card title="Deploy Instances" icon="rocket" href="/api/deploy">
    Deploy new Ubuntu VPS instances
  </Card>

  <Card title="List and Get Instances" icon="list" href="/api/instances">
    List, inspect, and delete instances
  </Card>

  <Card title="Instance Actions" icon="bolt" href="/api/actions">
    Power on/off, reboot, and resize instances
  </Card>

  <Card title="API Key Management" icon="lock" href="/api/keys">
    Create and revoke API keys programmatically
  </Card>

  <Card title="MCP Setup" icon="robot" href="/api/mcp-setup">
    Configure AI agents to use RepoCloud as an MCP server
  </Card>
</CardGroup>

## Quick Start

<Steps>
  <Step title="Get an API Key">
    Go to the [API / MCP tab](https://repocloud.io/mcp) in your dashboard. A key is auto-generated on your first visit (requires a \$1 minimum deposit).
  </Step>

  <Step title="Deploy a VPS">
    ```bash theme={null}
    curl -X POST https://repocloud.io/api/v1/instances \
      -H "Authorization: Bearer rcmcp_your_key_here" \
      -H "Content-Type: application/json" \
      -d '{"project_name": "my-server", "flavor": "s-1vcpu-2gb"}'
    ```
  </Step>

  <Step title="Check Status">
    ```bash theme={null}
    curl https://repocloud.io/api/v1/instances/123 \
      -H "Authorization: Bearer rcmcp_your_key_here"
    ```
  </Step>
</Steps>

## Scope

The API currently supports **Ubuntu VPS instances only**. Container App deployment and management are available through the web dashboard. Other VPS templates (Coolify, Dokploy, etc.) are deployed through the dashboard or [AI Deploy](/deployment/ai-deploy).

## Base URL

All API endpoints use the base URL:

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

## Response Format

All responses are JSON. Successful responses return the requested data directly. Errors return a JSON object with an `error` field and an optional `detail` field:

```json theme={null}
{
  "error": "Insufficient balance",
  "detail": "Balance must be greater than \$3 to deploy. Deposit at /billing."
}
```

## Rate Limits

| Scope                      | Limit                                  |
| -------------------------- | -------------------------------------- |
| General (all endpoints)    | 60 requests per 60 seconds per API key |
| Deploy (`POST /instances`) | 5 requests per hour per API key        |

When rate-limited, the API returns HTTP 429 with a `Retry-After` header indicating how many seconds to wait.
