vastai-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@vastai-mcpFind an RTX 4090 for under $1 per hour"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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_hereOr from source, for local development:
pip install -e .Get an API key at https://cloud.vast.ai (Settings -> API Keys).
Related MCP server: Massed Compute MCP Server
Run (stdio, for MCP clients)
Installing the package puts a vastai-mcp command on your PATH:
vastai-mcpClaude 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 |
| Current GPU supply/demand/pricing snapshot. |
| Search rentable machine offers (filter by GPU, price, disk, country). |
| Rent a new persistent volume (searches a matching volume offer and rents it). |
| List your rented volumes. |
| Rent a machine by offer id (requires |
| Per-instance hourly cost breakdown (GPU, disk, storage, total) plus recent charges. |
Typical workflow
list_gpusto see what's available.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).
Available Tools
6 toolsbilling_summaryA
Overall billing: per-instance hourly cost breakdown (GPU, disk, storage, total $/hr) plus the most recent charges. days limits the charge lookback window.
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Look back this many days for charges (default 30). | |
| limit | No | Max charges to return (default 50). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses that the tool returns a cost breakdown and recent charges and that `days` controls the lookback window. With no annotations, it would benefit from explicitly stating that this is a read-only operation with no side effects on billing or instances. It adds useful output and scope detail but not complete behavioral disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences front-load the overall purpose and then clarify the relevant parameter. There is no filler, redundancy, or buried context. This is an appropriately sized and well-structured description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description does explain the main return values: hourly cost breakdown plus most recent charges. Optional and default parameter behavior is covered by the schema, and the tool's complexity is low. It is complete enough for an agent to select and call the tool, though read-only status is only implied.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3, and the description mostly restates the `days` meaning already in the schema. The `limit` parameter is not mentioned in the description but is fully documented by the schema. This meets but does not exceed the baseline.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies a billing-summary resource with specific output elements: per-instance hourly cost breakdown, GPU/disk/storage, total $/hr, and recent charges. This distinguishes it from sibling tools that deal with GPU listings, offers, volumes, and instances. It lacks an explicit verb like 'get' or 'view', so it stops just short of a top score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'Overall billing' provides clear context that this tool is for billing inquiries rather than resource management, and no sibling tool covers billing. However, it does not explicitly state when not to use it or name an alternative. This is clear context without exclusions, which matches a 4.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
create_instanceA
Create (rent) a new instance on a specific machine offer (ask id from search_offers), optionally creating and attaching a new volume. Returns the new contract/instance id. Requires max_hourly_price as a spend guardrail: the offer's live price is checked against it and the rental is refused if the price exceeds the cap or can't be verified.
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | Docker flags, e.g. '-e HF_TOKEN=hf_xxx -p 8000:8000'. | |
| image | No | Docker image (default: vastai/base-image). | |
| label | No | Friendly instance name. | |
| volume | No | Volume to attach, created on the fly if volume_id is omitted. | |
| disk_gb | No | Local disk in GB (min 8). | |
| runtype | No | Run type (default: ssh). | |
| offer_id | Yes | Offer/ask id returned by search_offers. | |
| target_state | No | State to bring the instance to (default: running). | |
| max_hourly_price | Yes | Required spend cap in $/hr. The offer's current dph_total is checked against this before renting; if it exceeds the cap (or can't be fetched), the request is refused. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden — and it delivers: it discloses the refusal behavior (rental is refused if price exceeds the cap or can't be verified), the on-the-fly volume creation side-effect, and the return value (contract/instance id). The main gaps are that it doesn't warn about ongoing hourly billing exposure beyond the cap or explain what happens after creation (lifecycle management).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three compact sentences with zero filler: core action first, return value second, mandatory guardrail behavior third. The spend-cap explanation is slightly redundant with the schema's max_hourly_price text, but its placement in the description is justified because it is a required behavioral contract an agent must honor.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite having no output schema, the return value is disclosed ('Returns the new contract/instance id'), and the operational flow from search_offers → create_instance is complete. With 9 parameters and a conditional nested object, the description adequately covers the volume logic. The only real omission is post-creation context — the created instance is a billable, persistent resource with no mention of how to stop/destroy it.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema fully documents all 9 parameters and the nested volume object — the baseline of 3 applies. The description mostly echoes schema content (offer_id from search_offers, max_hourly_price as a guardrail) rather than adding net-new meaning, so it neither improves nor degrades the parameter understanding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb and resource — 'Create (rent) a new instance on a specific machine offer' — and anchors the offer id to the search_offers sibling tool. It also mentions optional volume creation/attachment, which cleanly separates it from create_volume and list_volumes. An agent can tell exactly what this tool does without needing to open the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It states the prerequisite sequencing ('ask id from search_offers') and notes that volume attachment is optional, implying the create_volume/list_volumes path is an alternative. However, it never explicitly names alternatives or states when not to use this tool (e.g., 'if you only need a volume, use create_volume'), so some routing logic is left to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
create_volumeA
Rent a new persistent volume on Vast.ai. The volume is billed separately from instances. Returns the new volume name/id.
| Name | Required | Description | Default |
|---|---|---|---|
| size_gb | Yes | Volume size in GB (default 15). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the behavioral burden; it does disclose that the operation creates a separately billed persistent resource and returns a name/id. It does not, however, mention permissions, cancellation/deletion, or any other side effects beyond rental, leaving some uncertainty for an agent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short, front-loaded sentences convey the resource, billing distinction, and return value with no filler or redundant information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a one-parameter creation tool with no output schema, the description covers the key facts: what is created, that it incurs separate billing, and what is returned. It is slightly incomplete only in not giving explicit when-to-use guidance compared with sibling tools.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and the only parameter, size_gb, is already documented with its default in the input schema. The description adds no parameter-level meaning, so the baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Rent') and resource ('persistent volume on Vast.ai'), and distinguishes the action from instance creation by noting the volume is billed separately from instances. An agent can immediately tell this tool creates storage rather than listing or launching instances.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The billing note ('billed separately from instances') implies this is for persistent storage rather than instances, but the description never states when to choose this over alternatives such as create_instance or list_volumes. Selection context is inferred from the resource name rather than explicitly routed.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_gpusA
Show the current snapshot of all available GPUs on Vast.ai: total supply, available count, and 10th/median/90th percentile pricing per GPU model.
| Name | Required | Description | Default |
|---|---|---|---|
| verified | No | Filter by host verification (default: yes). | |
| hosting_type | No | Filter by hosting type (default: all). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden of explaining behavior, and it does so by specifying the output is a current snapshot with total supply, available count, and percentile pricing per GPU model. The verb 'Show' and the aggregate fields make the read-only nature clear, though it does not mention pagination, ordering, or how filter defaults affect 'all'.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One dense sentence front-loads the action and resource before enumerating exactly what the response contains, with no filler or repetition of schema details. Every phrase earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite lacking an output schema, the description enumerates the essential return fields and the input schema covers both filters and defaults. It is slightly incomplete by not acknowledging the optional filters or stating any pagination/limits expectations, but this is a minor gap for a simple snapshot tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage for both optional parameters, so the baseline is 3; the description adds no specific parameter details. It contributes no additional semantic meaning beyond the schema, but none is strictly needed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific action ('Show the current snapshot') and resource ('all available GPUs on Vast.ai') with explicit output details: total supply, available count, and percentile pricing. This clearly distinguishes it from sibling search_offers, which implies offer-level searching rather than an aggregate market snapshot.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'current snapshot' implies this is for a high-level market overview, and the sibling list includes search_offers for more detailed searching, so the intended niche is weakly indicated. However, the description never explicitly states when to use this tool over search_offers or what it should not be used for, leaving routing to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_volumesA
List all volumes currently rented by you.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. The verb 'List' signals a read-only operation and 'by you' communicates user scoping, which is useful. However, it does not disclose potential pagination, ordering, status filtering, or fields returned, though these gaps are minor for a simple listing tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no filler. Every word adds meaning: 'List' gives the action, 'all volumes' gives the object, and 'currently rented by you' gives the scope.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a no-parameter list operation, the description is largely complete: it states the action, the resource, and the user scoping. It does not describe the return payload, but since there is no output schema and the tool is simple, an agent has enough to know when and how to call it.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There are zero parameters and the schema describes an empty object, so the description has no parameter meaning to add. Per the baseline for 0-parameter tools, a 4 is appropriate; the schema already fully covers this dimension.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('List') and resource ('volumes'), and adds the scope qualifier 'currently rented by you.' This clearly distinguishes it from siblings like list_gpus (different resource) and create_volume (different operation) without needing to open any schemas.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The intended use is implied: an agent should call this when it needs to see the user's currently rented volumes. However, there is no explicit guidance about when not to use it or when a sibling like list_gpus or search_offers would be more appropriate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_offersA
Search rentable GPU machine offers on Vast.ai. Returns offers with id (ask_id), gpu_name, num_gpus, price per hour (dph_total), disk, region, bandwidth, verification and reliability. Use the returned offer id with create_instance.
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | Sort order (default: score). | |
| limit | No | Max offers to return (default 20). | |
| country | No | Country code, e.g. 'US'. | |
| gpu_name | No | Exact GPU model, e.g. 'RTX 4090'. | |
| min_disk | No | Minimum local disk in GB. | |
| num_gpus | No | Minimum number of GPUs per machine. | |
| max_price | No | Max total price per hour ($). | |
| allocated_storage | No | Assumed storage in GB used for pricing (default 8). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full behavioral burden. It implies a read-only search operation and specifies the output fields, which aids the agent. However, it does not explicitly state that it has no side effects, requires no special permissions, or has rate limits, leaving some ambiguity for an AI agent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences with no wasted words. The first sentence states the action and scope; the second lists the key outputs and the integration path to create_instance. All information is relevant and front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description compensates for the missing output schema by enumerating the primary returned fields, which is essential for an agent to use the result. It also connects the tool to create_instance, completing a workflow. Minor gaps include pagination or edge behavior (e.g., empty results), but these are secondary given the schema covers parameters.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so all 8 parameters are already documented with types and descriptions. The description adds no extra parameter-level meaning beyond restating the resource type, so it meets the baseline but does not elevate it.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Search') and resource ('rentable GPU machine offers on Vast.ai'), and distinguishes itself by listing the exact returned fields (id, gpu_name, num_gpus, etc.) and referencing create_instance as the next step. This clearly separates it from sibling tools like list_gpus or billing_summary.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly states that the returned offer id should be used with create_instance, indicating a clear workflow context. However, it does not mention when not to use this tool or direct users to an alternative like list_gpus for GPU type discovery, so it lacks explicit exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
6 tool updates
v0.1.1- First observed
billing_summary - First observed
create_instance - First observed
create_volume - First observed
list_gpus - First observed
list_volumes - First observed
search_offers
TDQS
Scored across 6 tools
Each tool targets a distinct resource or action: GPU pricing snapshots, rentable offers, volume creation, volume listing, instance creation, and billing. list_gpus and search_offers are related but clearly differ in granularity, and the descriptions prevent confusion.
Most tool names follow a clear verb_noun pattern such as list_gpus, create_volume, and create_instance. billing_summary is the only real outlier, being a noun phrase rather than a verb-led action, but the overall convention remains predictable.
Six tools is well within the ideal scope for a focused rental-management server. Each tool serves a necessary step in the core workflow, and there is no obvious bloat or redundancy.
The tool set covers discovery, creation, volume listing, and billing, but it lacks essential lifecycle operations such as listing instances, terminating instances, and deleting volumes. This creates significant dead ends: resources can be created but not managed or cleaned up.
Maintenance
Related MCP Connectors
Massed Compute MCP — GPU inventory, VM lifecycle, billing, SSH keys, and setup recipes.
MCP commerce surface for compute credits, API keys, GPU instances, and cloud storage.
Provides capabilities that let LLM agents perform a range of infrastructure management tasks.
Manage CloudPepper servers, Odoo instances, backups, and deployments over MCP.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceEnables comprehensive management of Vast.ai GPU cloud instances, including searching for GPU offers, creating and managing instances, executing remote commands via SSH, and monitoring background tasks for ML training workflows.12MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to manage Massed Compute GPU instances, including browsing inventory, launching and managing VMs, and auditing billing.1MIT

paraloncloud-rentalsofficial
AlicenseAqualityBmaintenanceEnables MCP clients to rent GPUs from ParalonCloud using natural language, including browsing available GPUs, starting and stopping rentals, and retrieving connection URLs.610 npm2MIT- FlicenseAqualityBmaintenanceMCP server that wraps the Vast.ai REST API to enable LLM agents to search GPU marketplace, rent machines, manage instance lifecycle, run commands, and inspect billing.201-