# Kastell MCP server

> Audits, hardens, and manages server fleets across multiple cloud providers using an AI-native MCP interface.

- Repository: https://github.com/kastelldev/kastell
- Page: https://hostedmcp.org/servers/kastelldev/kastell
- Transport: stdio
- Stars: 59
- License: Apache-2.0
- Latest version: 1.14.0

## Install

### Claude Code

```sh
claude mcp add --env 'DIGITALOCEAN_TOKEN=<YOUR_DIGITALOCEAN_TOKEN>' --env 'HETZNER_TOKEN=<YOUR_HETZNER_TOKEN>' --env 'LINODE_TOKEN=<YOUR_LINODE_TOKEN>' --env 'VULTR_TOKEN=<YOUR_VULTR_TOKEN>' kastell -- npx -y kastell
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "kastell": {
      "command": "npx",
      "args": [
        "-y",
        "kastell"
      ],
      "env": {
        "DIGITALOCEAN_TOKEN": "<YOUR_DIGITALOCEAN_TOKEN>",
        "HETZNER_TOKEN": "<YOUR_HETZNER_TOKEN>",
        "LINODE_TOKEN": "<YOUR_LINODE_TOKEN>",
        "VULTR_TOKEN": "<YOUR_VULTR_TOKEN>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "kastell": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "kastell"
      ],
      "env": {
        "DIGITALOCEAN_TOKEN": "<YOUR_DIGITALOCEAN_TOKEN>",
        "HETZNER_TOKEN": "<YOUR_HETZNER_TOKEN>",
        "LINODE_TOKEN": "<YOUR_LINODE_TOKEN>",
        "VULTR_TOKEN": "<YOUR_VULTR_TOKEN>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"kastell","type":"stdio","command":"npx","args":["-y","kastell"],"env":{"DIGITALOCEAN_TOKEN":"<YOUR_DIGITALOCEAN_TOKEN>","HETZNER_TOKEN":"<YOUR_HETZNER_TOKEN>","LINODE_TOKEN":"<YOUR_LINODE_TOKEN>","VULTR_TOKEN":"<YOUR_VULTR_TOKEN>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "kastell": {
      "command": "npx",
      "args": [
        "-y",
        "kastell"
      ],
      "env": {
        "DIGITALOCEAN_TOKEN": "<YOUR_DIGITALOCEAN_TOKEN>",
        "HETZNER_TOKEN": "<YOUR_HETZNER_TOKEN>",
        "LINODE_TOKEN": "<YOUR_LINODE_TOKEN>",
        "VULTR_TOKEN": "<YOUR_VULTR_TOKEN>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add kastell --env 'DIGITALOCEAN_TOKEN=<YOUR_DIGITALOCEAN_TOKEN>' --env 'HETZNER_TOKEN=<YOUR_HETZNER_TOKEN>' --env 'LINODE_TOKEN=<YOUR_LINODE_TOKEN>' --env 'VULTR_TOKEN=<YOUR_VULTR_TOKEN>' -- npx -y kastell
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.kastell]
command = "npx"
args = ["-y", "kastell"]

[mcp_servers.kastell.env]
DIGITALOCEAN_TOKEN = "<YOUR_DIGITALOCEAN_TOKEN>"
HETZNER_TOKEN = "<YOUR_HETZNER_TOKEN>"
LINODE_TOKEN = "<YOUR_LINODE_TOKEN>"
VULTR_TOKEN = "<YOUR_VULTR_TOKEN>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'DIGITALOCEAN_TOKEN=<YOUR_DIGITALOCEAN_TOKEN>' -e 'HETZNER_TOKEN=<YOUR_HETZNER_TOKEN>' -e 'LINODE_TOKEN=<YOUR_LINODE_TOKEN>' -e 'VULTR_TOKEN=<YOUR_VULTR_TOKEN>' kastell npx -- -y kastell
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "kastell": {
      "command": "npx",
      "args": [
        "-y",
        "kastell"
      ],
      "env": {
        "DIGITALOCEAN_TOKEN": "<YOUR_DIGITALOCEAN_TOKEN>",
        "HETZNER_TOKEN": "<YOUR_HETZNER_TOKEN>",
        "LINODE_TOKEN": "<YOUR_LINODE_TOKEN>",
        "VULTR_TOKEN": "<YOUR_VULTR_TOKEN>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `DIGITALOCEAN_TOKEN` | no | yes | DigitalOcean API token (optional — only for DigitalOcean servers) |
| `HETZNER_TOKEN` | no | yes | Hetzner Cloud API token (optional — only for Hetzner servers) |
| `LINODE_TOKEN` | no | yes | Linode API token (optional — only for Linode servers) |
| `VULTR_TOKEN` | no | yes | Vultr API token (optional — only for Vultr servers) |

## FAQ

### Can I use AI to manage my servers with Kastell?

Yes, Kastell is AI-native and includes a built-in MCP server that allows AI agents like Claude or Cursor to manage your servers directly.

### Does Kastell provide automated security fixes?

Yes, it offers an interactive fix mode that allows you to apply security fixes based on audit results.

### Can I preview changes before they are applied?

Yes, many destructive commands support a --dry-run flag to preview actions without executing them.
