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

# MCP

> Connect AI agents to machine0 using the Model Context Protocol.

```
POST https://app.machine0.io/mcp
```

Streamable HTTP transport, stateless, JSON responses. Gives agents the same capabilities as the CLI.

## Authentication

**OAuth** (interactive clients) -- MCP clients supporting [RFC 9728](https://www.rfc-editor.org/rfc/rfc9728) discover endpoints automatically. Claude Desktop and Claude Code handle this out of the box.

**API key** (programmatic) -- pass in the `x-api-key` header. Generate keys from your account settings.

## Setup

### Claude Desktop

Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:

```json theme={"theme":"css-variables"}
{
  "mcpServers": {
    "machine0": {
      "url": "https://app.machine0.io/mcp"
    }
  }
}
```

### Claude Code

```bash theme={"theme":"css-variables"}
claude mcp add machine0 https://app.machine0.io/mcp
```

### Other clients

Any MCP client with Streamable HTTP transport support. Point at `https://app.machine0.io/mcp` with OAuth or an API key header.

## Tools

| Category                  | Tools                               |
| ------------------------- | ----------------------------------- |
| [Machines](/mcp/machines) | 9 -- create, manage, destroy VMs    |
| [Images](/mcp/images)     | 10 -- snapshot VMs, manage versions |
| [SSH Keys](/mcp/keys)     | 7 -- public and managed keys        |
| [SSH Exec](/mcp/ssh)      | 1 -- run commands on VMs remotely   |
| [Sizes](/mcp/sizes)       | 1 -- list sizes and pricing         |

## Managed keys

To use `ssh_exec`, VMs must be created with a managed key (server-side keypair). Create one with `ssh_key_create_managed`, then pass its ID when creating VMs. VMs with public keys cannot use `ssh_exec`.
