Content
# AutoDL MCP Server
Manage AutoDL GPU cloud instances with MCP Server, supporting instance lifecycle management, SSH remote operations, file transfer, and GPU monitoring.
## Features
### Instance Management
- `autodl_list_instances` — List all elastic deployments
- `autodl_get_instance` — Get instance details
- `autodl_stop_instance` — Stop instance (release GPU)
- `autodl_start_instance` — Start instance (allocate GPU)
- `autodl_delete_instance` — Delete instance
- `autodl_set_replicas` — Set replica count (0=stop, >0=start)
### Container Management
- `autodl_list_containers` — List containers under deployment
- `autodl_stop_container` — Stop specific container
- `autodl_get_container_events` — View container event logs
### GPU Inventory and Images
- `autodl_get_gpu_stock` — Query regional GPU inventory
- `autodl_list_images` — List private images
- `autodl_get_regions` — List available regions
### SSH Remote Operations
- `autodl_ssh_connect` — SSH connect to remote instance
- `autodl_ssh_disconnect` — Disconnect SSH connection
- `autodl_run_command` — Run command remotely
- `autodl_upload_file` — Upload file (SCP)
- `autodl_download_file` — Download file (SCP)
- `autodl_check_gpu` — Check GPU status (nvidia-smi)
- `autodl_check_logs` — View log files
- `autodl_list_ssh_connections` — List active SSH connections
## Installation
### 1. Clone Repository
```bash
git clone https://github.com/ygh11231/autodl-mcp-server.git
cd autodl-mcp-server
```
### 2. Install Dependencies
```bash
pip install -r requirements.txt
```
### 3. Set API Token
Obtain from [AutoDL Console](https://www.autodl.com) → Settings → Developer Token.
```bash
export AUTODL_API_TOKEN="your_token_here"
```
### 4. Test Run
```bash
python server.py
```
Normal startup will have no output; MCP protocol communicates via stdin/stdout.
## Configure in Hermes
Edit `~/.hermes/config.yaml`, add:
```yaml
mcp_servers:
autodl:
command: "/path/to/your/python"
args: ["/path/to/autodl-mcp-server/server.py"]
env:
AUTODL_API_TOKEN: "your_token_here"
```
Restart Hermes, and all tools will automatically register as `mcp_autodl_*`.
## Configure in Claude Code
Edit `~/.claude/.mcp.json`:
```json
{
"mcpServers": {
"autodl": {
"type": "stdio",
"command": "/path/to/venv/bin/python",
"args": ["/path/to/autodl-mcp-server/server.py"],
"env": {
"AUTODL_API_TOKEN": "your_token_here"
}
}
}
}
```
## Usage Examples
```
> List all my instances
> Stop instance xxxx-xxxx-xxxx
> Start instance xxxx-xxxx-xxxx, set 2 replicas
> Query GPU inventory in Northwest Enterprise Zone
> SSH connect to my instance, check GPU status
> Upload my code to remote instance
```
## Project Structure
```
autodl-mcp-server/
├── server.py # MCP Server entry
├── autodl_api.py # AutoDL REST API client
├── ssh_manager.py # SSH Connection Manager
├── requirements.txt # Python dependencies
├── README.md # This file
└── LICENSE # MIT License
```
## License
MIT