vast-gpu-mcp
Provides text generation with Hugging Face models kept in GPU VRAM, including gated-model access via Hugging Face authentication and unloading models to free GPU memory.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
vast-gpu-mcp
An MCP server that turns a rented GPU machine into a remote workstation for AI agents such as Claude. The agent can run commands, start training jobs that keep running in the background, watch the GPU, read logs, and run quick LLM inference, all on the GPU box while you chat from your own computer.
It was built and tested on Vast.ai PyTorch instances, but it works on any Linux machine with an NVIDIA GPU that you can reach over SSH (RunPod, Lambda, a lab server, a box under your desk).
Unofficial. This project is not affiliated with or endorsed by Vast.ai.
Tools
Tool | What it does |
| Memory, power draw, temperature, clocks, a |
| CPU, RAM, disk, uptime, Python environment |
| Run a bash command and return exit code, stdout, stderr (short tasks) |
| Run a long command in the background (training, downloads, servers) |
| State, exit code, runtime and log tail of a job |
| All jobs, including ones started before a server restart |
| Stop a job and all of its child processes |
| Put scripts and configs on the machine, read logs and results |
| Text generation with a Hugging Face model kept in VRAM (optional |
| Unload that model so training gets the whole card |
Commands run in bash with the machine's Python venv active, so python, pip, torchrun,
accelerate and nvcc work as-is. Background jobs are detached from the server: they keep
running if the server restarts or your connection drops, and their state is saved to disk.
Related MCP server: mcp-ssh-terminal
Security: read this first
This server executes arbitrary commands and has no authentication. That is the point of it, and it is only safe because nobody but you can reach it:
In
httpmode it binds to127.0.0.1and refuses any other address unless you pass--allow-public. Do not. Reach it through an SSH tunnel instead (below).In
stdiomode it has no network port at all; your MCP client starts it over SSH.
Your SSH key is the only lock. Anyone who can talk to the server can do anything on the machine.
Install (on the GPU machine)
pip install "git+https://github.com/Abdulaziz-97/vast-gpu-mcp" # core
pip install "vast-gpu-mcp[llm] @ git+https://github.com/Abdulaziz-97/vast-gpu-mcp" # + llm_generate (needs PyTorch, which GPU images ship)On Vast.ai PyTorch images, install into the image's venv: /venv/main/bin/pip install "git+https://github.com/Abdulaziz-97/vast-gpu-mcp".
Connect it to your MCP client
You can choose between two ways.
Option A: stdio over SSH (simplest, nothing to keep running)
Your MCP client starts the server over SSH for each session. With Claude Code:
claude mcp add vast-gpu --scope user -- \
ssh -o BatchMode=yes -p 40022 root@1.2.3.4 /venv/main/bin/vast-gpu-mcp --transport stdioUse the SSH port and address your provider shows. Your SSH key must load without a prompt
(use ssh-agent). Jobs and their logs survive between sessions; a model loaded by
llm_generate does not.
Option B: HTTP server plus SSH tunnel (server stays up)
On the GPU machine, start the server in the background:
curl -fsSLO https://raw.githubusercontent.com/Abdulaziz-97/vast-gpu-mcp/main/scripts/start_server.sh
bash start_server.shOr run it yourself: vast-gpu-mcp --transport http (listens on 127.0.0.1:8765).
On your computer, keep a tunnel open. The script reconnects on its own and alternates between the routes you give it (Vast.ai offers a direct route and a proxy route, and either can drop):
bash scripts/tunnel.sh root@1.2.3.4:40022 root@ssh5.vast.ai:27389 # macOS / Linux.\scripts\tunnel.ps1 root@1.2.3.4:40022 root@ssh5.vast.ai:27389 # WindowsThen register it:
claude mcp add --transport http --scope user vast-gpu http://localhost:8765/mcpOptions
Flag | Env var | Default |
|
|
|
|
|
|
|
|
|
|
| home directory |
|
| the server's own venv, else |
|
|
|
Job metadata and logs go to <workdir>/mcp_jobs/. On machines with a /workspace disk,
HF_HOME defaults to /workspace/.hf_home.
Things worth knowing
GPU utilization reads 0% on many cloud containers. The container cannot see it. Power draw and memory used are reliable, and
gpu_statussetsbusyfrom them.The overhead is small. On an RTX 5090, a matmul benchmark run through the server reached the same speed as one run directly over SSH (215 vs 214 TFLOPS fp16), and an MCP round trip took about 0.2 s.
Gated models (Llama, Mistral) need
hf auth loginon the machine first.Stop the instance when you are done. The server does not watch your bill.
Examples
examples/gpu_bench.py: matmul TFLOPS and memory bandwidth.examples/train_cifar.py: ResNet-18 on CIFAR-10 with bf16 and the data held on the GPU. Ask your agent tostart_job("pip install datasets && python train_cifar.py --epochs 20").
Development
pip install -e ".[dev]"
pytest # runs on any Linux machine; no GPU neededLicense
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
On-demand GPU nodes for agents: create nodes, run commands, and submit jobs, billed by the minute.
GPU compute for agents: run commands on an L4/A100/H100, watch logs, billed per second.
Rent cloud GPUs from AI agents: live prices, VRAM estimates, launch, logs and stop.
Persistent cloud workspaces for AI agents: run commands, edit files, use git and a browser.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to autonomously manage Google Colab GPU sessions, submit and monitor training jobs, and debug/fix issues via an encrypted tunnel without requiring a browser tab.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to have persistent, fully interactive SSH sessions into remote hosts, behaving like a local terminal.9 npm2MIT
- AlicenseAqualityBmaintenanceEnables an AI agent to take full control of a machine — running shell commands, editing files, managing git, packages and processes, and reaching the network — with batched execution, server-side variables and selectable tool profiles that keep token usage low. It also speaks HTTP so the same agent can operate a remote build box, NAS or VPS.261MIT
- AlicenseAqualityCmaintenanceEnables AI coding tools to read, write, search, and list files on remote machines and run commands there, including background long-running jobs and TTY-based interaction, all through a single persistent SSH connection. Bypasses the cost of establishing a new SSH session on every call, cutting typical multi-step remote operations from seconds to milliseconds.12MIT