Vast.ai MCP Server
An MCP (Model Context Protocol) server that exposes Vast.ai cloud operations as tools: list GPUs, search offers, create volumes, create instances, and view billing.
Setup
Installed as a package via pip (recommended):
pip install vastai-mcp
export VAST_API_KEY=your_api_key_here
Or from source, for local development:
pip install -e .
Get an API key at https://cloud.vast.ai (Settings -> API Keys).
Run (stdio, for MCP clients)
Installing the package puts a vastai-mcp command on your PATH:
vastai-mcp
Claude Desktop config example
{
"mcpServers": {
"vastai": {
"command": "vastai-mcp",
"env": { "VAST_API_KEY": "your_api_key" }
}
}
}
(See mcp.json.example in this repo for a copy-pasteable template — copy it to
mcp.json and fill in your key; mcp.json itself is gitignored since it holds
a real secret.)
Tools
| Tool | Description |
|---|---|
search_offers |
Search rentable machine offers (filter by GPU, price, disk, country). |
create_volume |
Rent a new standalone persistent volume (finds a GPU offer's free volume slot and rents it). |
list_volumes |
List your rented volumes. |
delete_volume |
Delete a rented volume by id, stopping its billing. |
create_instance |
Rent a machine by offer id (requires max_hourly_price as a spend cap), optionally creating/attaching a volume. |
destroy_instance |
Terminate a rented instance by id, stopping its billing. |
billing_summary |
Per-instance hourly cost breakdown (GPU, disk, storage, total) plus recent charges. |
Typical workflow
search_offers(gpu_name="RTX 4090", max_price=1.0, limit=10)to find a machine.billing_summaryto check current spend.create_instance(offer_id=123, max_hourly_price=1.0, volume={"size_gb": 100, "mount_path": "/data"})to launch (refuses if the offer's live price exceedsmax_hourly_price).destroy_instance(instance_id=...)/delete_volume(volume_id=...)to tear down when done.
Release files for vastai-mcp 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vastai_mcp-0.1.3.tar.gz | 22.9 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vastai_mcp-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.0 MB
Release files / vastai_mcp-0.1.3.tar.gz
| Download URL | vastai_mcp-0.1.3.tar.gz |
|---|---|
| Size | 22.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cdee8898e2855e98cee892ee10aaa9594a23d45e4325e1e4f181cecec53790b9
|
|
BLAKE2b-256 checksum How to use checksums |
18cc2369f6937079b6a853063ad29dc4f3a6b33ff472216a1e244ce3d7ed1775
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / vastai_mcp-0.1.3-py3-none-any.whl
| Download URL | vastai_mcp-0.1.3-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f048dbca8dc156fd906d1824544478b840cd851c02e67f9565d3faa4ed794b0b
|
|
BLAKE2b-256 checksum How to use checksums |
18403a7f08b12f1db6859efcea6750a8ed3217029f51bc65a7de2d6633cedd92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|