vastai-host-mcp
Click on "Install 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-host-mcplist my hosted machines and their current status"
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.
vastai-host-mcp
Production-ready Model Context Protocol (MCP) server for Vast.ai host/provider operations using FastMCP and TypeScript.
This project is the host/provider counterpart to renter-focused tools. For renting GPUs as a customer, use CryDevOk/vastai-mcp.
Table of contents
Related MCP server: Vast.ai MCP Server
What this server is for
This MCP server is purpose-built for Vast.ai providers (hosts who own and operate machines). It focuses on host-side workflows including:
Viewing and managing hosted machines.
Updating default jobs, pricing, and offer settings.
Running verification and self-test operations.
Inspecting reliability, uptime, and host operational signals.
Managing host scripts and daemon restart workflows.
Feature summary
TypeScript-first server implementation with strict compiler settings.
FastMCP tool definitions with rich tool metadata and strict Zod schemas.
Singleton Vast.ai host client with:
Bearer token API auth
/api/v0/...endpoint targetingrobust error handling
timestamped logging via Pino
API-first execution with optional Vast CLI fallback for host commands.
stdio and httpStream transport support.
Host automation helper rules for pricing and reliability recommendations.
Getting started
Prerequisites
Node.js 20+
pnpm 9+
Vast.ai API key with host/provider permissions
Install and run
Install dependencies:
pnpm installCopy environment file and edit values:
cp .env.example .envSet at least
VAST_API_KEYin.env.Start development server (FastMCP dev mode):
pnpm devInspect tools interactively:
pnpm inspectBuild and run production bundle:
pnpm build
pnpm startEnvironment variables
Variable | Required | Default | Purpose |
| Yes | none | Vast.ai API token for host/provider operations |
| No |
| Vast.ai API base URL |
| No |
| Transport mode: |
| No |
| Host bind for |
| No |
| Port for |
| No |
| API and CLI timeout in milliseconds |
| No |
| Enable CLI fallback for host operations |
| No |
| Vast CLI executable path |
| No |
| Toggle automation hints for price workflows |
| No |
| Toggle automation hints for reliability workflows |
| No |
| Pino log level |
Development workflow
Default local development workflow (warning-free in pnpm-managed environments):
pnpm devFastMCP terminal harness workflow (optional):
pnpm dev:fastmcp
pnpm inspectCodespaces inspector workflow:
# If you had a prior inspector run, free default ports first
pkill -f mcp-inspector || true
# Start inspector with Codespaces-safe host and origin settings
pnpm inspect:codespaces
# If token/auth forwarding is problematic, use no-auth mode in dev only
pnpm inspect:codespaces:noauthIf the browser opens but cannot connect, ensure both forwarded ports are active:
6274 (Inspector UI)
6277 (Inspector proxy)
If the UI still shows Disconnected, use these manual values in Inspector:
Transport Type:
STDIOCommand:
pnpmArguments:
exec tsx src/index.tsThen click
Connect
If auth is enabled, open Auth Settings and paste the MCP_PROXY_AUTH_TOKEN printed in terminal.
Production build workflow:
pnpm build
pnpm startKey host tools currently implemented:
vastai_host_show_machinesvastai_host_set_defjobvastai_host_upsert_offervastai_host_set_min_bidvastai_host_verification_statusvastai_host_self_test_machinevastai_host_get_statsvastai_host_recommend_pricingvastai_host_update_scriptvastai_host_restart_daemonvastai_host_search_offersvastai_host_show_logsvastai_host_network_statusvastai_host_reliability_actions
Connect from MCP clients
Use stdio transport for desktop tools unless you specifically need network transport.
Claude Desktop example
{
"mcpServers": {
"vastai-host": {
"command": "pnpm",
"args": ["start"],
"cwd": "/absolute/path/to/vastai-host-mcp",
"env": {
"VAST_API_KEY": "YOUR_VAST_API_KEY",
"VAST_SERVER_URL": "https://console.vast.ai",
"MCP_TRANSPORT": "stdio"
}
}
}
}Cursor example
{
"mcpServers": {
"vastai-host": {
"command": "pnpm",
"args": ["start"],
"cwd": "/absolute/path/to/vastai-host-mcp",
"env": {
"VAST_API_KEY": "YOUR_VAST_API_KEY",
"MCP_TRANSPORT": "stdio"
}
}
}
}VS Code MCP example
{
"servers": {
"vastai-host": {
"type": "stdio",
"command": "pnpm",
"args": ["start"],
"cwd": "/absolute/path/to/vastai-host-mcp",
"env": {
"VAST_API_KEY": "YOUR_VAST_API_KEY"
}
}
}
}Use with GitHub Copilot
For GitHub Copilot Chat in VS Code, this repository already includes a workspace MCP config at .vscode/mcp.json.
Recommended flow:
Set your real
VAST_API_KEYin.vscode/mcp.json.Stop any manually running local server process (
pnpm dev) so VS Code can own the MCP process lifecycle.In VS Code, reload MCP servers from the Command Palette.
In Copilot Chat, test a tool call such as
vastai_host_show_machines.
Note: For VS Code MCP usage, you usually do not need to run pnpm dev manually.
Where to check Vast API
Use these sources to validate endpoint existence and request format:
API docs index: llms.txt
API intro: Vast API Reference
Machines: show machines
Machines: set min-bid
Machines: set defjob
Machines: list machine
Search: search offers
The current endpoint mapping used by this MCP server is implemented in src/client/VastAIHostClient.ts.
Quick local checks:
pnpm build
pnpm inspectWhen using the Inspector, a command returning HTTP 404 is usually a route mismatch, while HTTP 400/403/500 generally means the route exists and your payload, permissions, or backend state should be checked.
Run on Vast.ai machines
When deploying this MCP server inside a Vast.ai instance:
Keep API keys in environment variables only. Never hardcode secrets.
Use
stdiomode for local desktop tunneling workflows.Use
httpStreamonly behind trusted network boundaries or a reverse proxy.Install Vast CLI in the runtime if you want CLI fallback behavior.
Monitor logs with your preferred process manager (systemd, pm2, supervisord).
For onboarding guidance, see Building your first MCP server on Vast.ai.
Project layout
.
├── src/
│ ├── client/
│ │ └── VastAIHostClient.ts
│ ├── rules/
│ │ └── MCPRules.ts
│ ├── tools/
│ │ └── hostTools.ts
│ ├── config.ts
│ ├── index.ts
│ └── logger.ts
├── .env.example
├── package.json
├── tsconfig.json
└── README.mdContributing
Open an issue describing the host/provider workflow or API gap.
Keep additions host-focused (not renter workflow features).
Add or update tool descriptions so they remain LLM-friendly and explicit.
Run local checks before opening a PR.
Repository-wide conventions and agent behavior are documented in AGENTS.md.
License
This project is licensed under the MIT License. See LICENSE.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Cogni-AI-OU/vastai-host-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server