vultr-mcp/README.md

89 lines
2.3 KiB
Markdown

# Vultr MCP Server
A [Model Context Protocol](https://modelcontextprotocol.io/) server for the [Vultr](https://www.vultr.com/) VPS API.
## Tools
| Tool | Description |
|------|-------------|
| `list_regions` | List all available Vultr regions |
| `list_plans` | List plans, optionally filtered by region |
| `list_os` | List available OS images |
| `list_instances` | List all instances on the account |
| `get_instance` | Get details for a specific instance |
| `create_instance` | Create a new instance |
| `destroy_instance` | Permanently destroy an instance |
| `start_instance` | Power on an instance |
| `stop_instance` | Power off an instance |
| `reboot_instance` | Reboot an instance |
| `list_ssh_keys` | List SSH keys on the account |
| `create_ssh_key` | Add a new SSH key |
| `list_firewalls` | List firewall groups |
| `get_firewall` | Get rules for a firewall group |
| `create_firewall` | Create a new firewall group |
| `create_firewall_rule` | Add a rule to a firewall group |
| `get_account` | Get account info and current balance |
## Setup
### 1. Install dependencies
```bash
cd /tmp/vultr-mcp
pip install -r requirements.txt
```
### 2. Set the API key
Get your API key from the [Vultr control panel](https://my.vultr.com/settings/#settingsapi).
```bash
export VULTR_API_KEY=your_api_key_here
```
Or copy `.env.example` to `.env` and fill it in, then source it:
```bash
cp .env.example .env
# edit .env
source .env
```
### 3. Run the server
```bash
python server.py
```
## Adding to Claude Code
Add the following to your Claude Code MCP config (typically `~/.claude/claude_desktop_config.json` or via `claude mcp add`):
```json
{
"mcpServers": {
"vultr": {
"command": "python",
"args": ["/tmp/vultr-mcp/server.py"],
"env": {
"VULTR_API_KEY": "your_api_key_here"
}
}
}
}
```
Or using the Claude Code CLI:
```bash
claude mcp add vultr \
--command "python /tmp/vultr-mcp/server.py" \
--env VULTR_API_KEY=your_api_key_here
```
## Notes
- `destroy_instance` is irreversible — double-check the instance ID before calling it.
- Newly created instances may show `pending` as their main IP for a minute or two while they provision.
- Firewall rules default to inbound IPv4 (`ip_type: v4`, `direction: in`). Use `0.0.0.0` with `subnet_size: 0` to match all sources.