# Hostkey MCP server

> Allows an AI client to manage Hostkey cloud infrastructure, including servers, DNS, S3 storage, billing, and network configurations.

- Repository: https://github.com/hostkey-cloud/mcp-server
- Page: https://hostedmcp.org/servers/hostkey-cloud/mcp-server
- Transport: stdio, remote
- Stars: 1
- License: MIT
- Latest version: 1.0.8

## Install

### Claude Code

```sh
claude mcp add --env 'HOSTKEY_API_KEY=<YOUR_HOSTKEY_API_KEY>' mcp-server -- npx -y hostkey-mcp-server
```

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

```json
{
  "mcpServers": {
    "mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "hostkey-mcp-server"
      ],
      "env": {
        "HOSTKEY_API_KEY": "<YOUR_HOSTKEY_API_KEY>"
      }
    }
  }
}
```

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

```json
{
  "servers": {
    "mcp-server": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "hostkey-mcp-server"
      ],
      "env": {
        "HOSTKEY_API_KEY": "<YOUR_HOSTKEY_API_KEY>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"mcp-server","type":"stdio","command":"npx","args":["-y","hostkey-mcp-server"],"env":{"HOSTKEY_API_KEY":"<YOUR_HOSTKEY_API_KEY>"}}'
```

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

```json
{
  "mcpServers": {
    "mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "hostkey-mcp-server"
      ],
      "env": {
        "HOSTKEY_API_KEY": "<YOUR_HOSTKEY_API_KEY>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add mcp-server --env 'HOSTKEY_API_KEY=<YOUR_HOSTKEY_API_KEY>' -- npx -y hostkey-mcp-server
```

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

```toml
[mcp_servers.mcp-server]
command = "npx"
args = ["-y", "hostkey-mcp-server"]

[mcp_servers.mcp-server.env]
HOSTKEY_API_KEY = "<YOUR_HOSTKEY_API_KEY>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'HOSTKEY_API_KEY=<YOUR_HOSTKEY_API_KEY>' mcp-server npx -- -y hostkey-mcp-server
```

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

```json
{
  "mcpServers": {
    "mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "hostkey-mcp-server"
      ],
      "env": {
        "HOSTKEY_API_KEY": "<YOUR_HOSTKEY_API_KEY>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `HOSTKEY_API_KEY` | yes | yes | InvAPI API key for the .com portal (invapi.hostkey.com); per-server keys supported |
| `HOSTKEY_ALLOW_DESTRUCTIVE` | no | no | Set to 1 to allow destructive operations (OS reinstall, PXE cycle, service cancellation) |
| `HOSTKEY_TOKEN_TTL` | no | no | Session token TTL in seconds (default 3600) |

## FAQ

### How can I prevent accidental changes during server operations?

Every write call requires `confirm=true` to execute, and the `order_server` tool defaults to a dry run unless explicit consent is given.

### What permissions are needed for DNS modifications?

To perform DNS writes, your API key must have the `pdns/edit` permission.

### How do I handle long-running tasks like server deployment?

Long jobs return a callback key which you can use to poll the status with the `check_task` tool.
