Content
# kyun-mcp
MCP server for [kyun.sh](https://kyun.sh) — privacy-focused cloud hosting API.
Provisions and manages **Danbo** (KVM VMs) and **Mesa** (Linux containers) via Claude Code or any MCP client.
## Setup
### 1. Clone & build
```bash
git clone https://github.com/kypwny/kyun-mcp.git
cd kyun-mcp
bun install # or: npm install
bun run build # produces dist/
```
### 2. Get an API key
Log in to kyun.sh → Account → API Keys → Create.
### 3. Add to your MCP client
Replace `/path/to/kyun-mcp` with your clone location.
```json
{
"mcpServers": {
"kyun": {
"command": "node",
"args": ["/path/to/kyun-mcp/dist/index.js"],
"env": {
"KYUN_API_TOKEN": "your-api-key-here"
}
}
}
}
```
For Claude Code: drop into `.claude/settings.json` (project) or `~/.claude/settings.json` (global).
For Claude Desktop: edit `claude_desktop_config.json` in your platform's app-support directory.
Dev mode (no build, runs TypeScript via Bun):
```json
{
"command": "bun",
"args": ["run", "/path/to/kyun-mcp/src/index.ts"]
}
```
## Usage examples
**Provision a VM:**
```
1. list_datacenters → pick a datacenterId
2. resolve_offer(datacenterId, "danbo", cores=2, ram=2, disk=40, ipv4Count=1) → check price
3. create_danbo(datacenterId=..., cores=2, ram=2, disk=40, ipv4Count=1)
4. confirm_order(orderId=...) → VM is created
5. cloud_init_install(danboId=..., imageUrl="https://...", authorizedKeys="ssh-ed25519 ...")
6. get_task to monitor installation progress
```
**Provision a container host:**
```
1. create_mesa(datacenterId=..., cores=2, ram=4, disk=20, mnemonic="cool-fast-node", ipv4Enabled=true)
2. confirm_order(orderId=...)
3. list_container_registries → find images
4. provision_mesa(mesaId=..., stack={...}) or use a recipeId
5. get_container_status, get_container_logs to monitor
```
## Tools
| Group | Tools |
|-------|-------|
| Account | `get_account`, `list_ssh_keys`, `create_ssh_key`, `delete_ssh_key` |
| Datacenters | `list_datacenters`, `get_datacenter`, `get_unit_prices`, `resolve_offer` |
| Orders | `get_order`, `confirm_order` |
| Services | `list_services`, `get_service`, `update_service`, `delete_service`, `get_service_stats`, `get_service_specs`, `resize_service` |
| Power | `start_service`, `stop_service`, `shutdown_service`, `reboot_service` |
| Tasks | `list_active_tasks`, `list_task_history`, `get_task`, `cancel_task`, `retry_task` |
| Network | `get_ips`, `add_ip`, `remove_ip`, `get_ipv6_settings`, `get_subdomains`, `create_subdomain`, `delete_subdomain`, `get_rdns`, `add_rdns`, `remove_rdns` |
| Danbo (VMs) | `create_danbo`, `get_danbo_runtime`, `get_danbo_os`, `cloud_init_install`, `get_danbo_authorized_keys`, `set_danbo_authorized_keys`, `get_danbo_host_keys`, `create_vnc_session`, `list_cd_drives`, `mount_cd_from_url`, `unmount_cd`, `boot_from_cd`, `prepare_os_install` |
| Mesa (Containers) | `create_mesa`, `get_mesa_runtime`, `get_mesa_stack`, `get_mesa_configuration`, `provision_mesa`, `update_mesa_stack`, `update_mesa_configuration` |
| Containers | `get_container`, `get_container_status`, `get_container_stats`, `start_container`, `stop_container`, `restart_container`, `get_container_logs`, `search_container_logs` |
| Container Files | `read_container_file`, `write_container_file`, `delete_container_file`, `list_container_directory` |
| Updates | `check_container_updates`, `list_container_updates`, `apply_container_update`, `apply_batch_updates` |
| Snapshots | `list_snapshots`, `restore_snapshot` |
| Macros | `list_macros`, `run_macro` |
| Catalog | `list_container_registries`, `search_registry`, `get_image_tags`, `get_image_metadata` |
| Bricks (Storage) | `create_brick`, `list_attached_bricks`, `attach_brick`, `detach_brick`, `get_brick_used_space`, `grow_brick` |
| Utilities | `get_available_domains`, `get_mesa_domain` |
## Authentication
All API calls use `x-auth-token` header. Set `KYUN_API_TOKEN` env var.
## API
Base URL: `https://api.kyun.sh/v2`
Docs: `https://api.kyun.sh/endpoints`
Spec: `https://api.kyun.sh/endpoints/v2/json`