cloudgpu-mcp

中文文档
0.2.0发布于 2026/11/03MITES Module构建来源已验证

MCP server and command-line tool for cloudgpu.app: let Claude Code, Cursor, Cline, opencode, goose and other MCP clients (or you, from a terminal) rent a GPU per minute, run a job, fetch the results and shut it down, with spending limits the platform enfo

原始使用文档
文档目录11 节
  1. Install
  2. Agent Skill
  3. Tools
  4. Guardrails
  5. Configuration
  6. Model API on the same balance
  7. Without MCP
  8. Command-line tool
  9. Links
  10. Development
  11. License

CloudGPU MCP

CloudGPU MCP server: let an AI agent rent a GPU by the minute, run a job, bring the results back and shut the GPU down. The same API key and balance also cover CloudGPU's OpenAI-compatible model API, so an agent can call a hosted model without renting anything.

"Fine-tune a 7B base model with LoRA on data/train.jsonl and put the adapter in ./outputs."

The agent checks live prices and quotes you, rents the GPU once you say yes, uploads your code and data, starts training in the background, watches the logs, downloads the adapter and destroys the instance. You get the files and the final cost.

It is a local (stdio) MCP server. It works with any MCP client that can start one: Claude Code, Cursor, Cline, opencode, goose, VS Code, Windsurf and others.

Install

  1. Create an API key at cloudgpu.app/api and add a prepaid balance (card or USDT).
  2. Add the server to your client. Node.js 18 or newer is required. The key goes in the environment variable CLOUDGPU_API_KEY.
Claude Code
claude mcp add cloudgpu --env CLOUDGPU_API_KEY=cgw-sk-... -- npx -y cloudgpu-mcp
Cursor (~/.cursor/mcp.json or .cursor/mcp.json)
{
  "mcpServers": {
    "cloudgpu": {
      "command": "npx",
      "args": ["-y", "cloudgpu-mcp"],
      "env": { "CLOUDGPU_API_KEY": "cgw-sk-..." }
    }
  }
}
Cline (MCP Servers → Configure MCP Servers → cline_mcp_settings.json)
{
  "mcpServers": {
    "cloudgpu": {
      "command": "npx",
      "args": ["-y", "cloudgpu-mcp"],
      "env": { "CLOUDGPU_API_KEY": "cgw-sk-..." }
    }
  }
}
opencode (opencode.json)
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "cloudgpu": {
      "type": "local",
      "command": ["npx", "-y", "cloudgpu-mcp"],
      "environment": { "CLOUDGPU_API_KEY": "cgw-sk-..." },
      "enabled": true
    }
  }
}
goose (~/.config/goose/config.yaml, or goose configure → Add Extension → Command-line Extension)
extensions:
  cloudgpu:
    name: cloudgpu
    type: stdio
    cmd: npx
    args: ["-y", "cloudgpu-mcp"]
    envs:
      CLOUDGPU_API_KEY: "cgw-sk-..."
    enabled: true
    timeout: 300
  1. Optional but recommended: copy rules/cloudgpu.md into your project as AGENTS.md, .cursor/rules/cloudgpu.md or .clinerules/cloudgpu.md. It tells the agent to quote before renting, download before shutting down, and never leave a GPU running. The server also exposes the same text as the resource cloudgpu://rules.

To check the install, ask your agent: "List the GPUs available, then estimate the cost for a 24 GB GPU for one hour. Do not create anything." You should see list_gpus and estimate_cost calls and a quote, and nothing is rented.

Agent Skill

The same guidance is available as two Agent Skills:

  • skills/cloudgpu/SKILL.md: renting and using a GPU. Claude Code loads it on demand when you ask for a GPU job. It expects the cloudgpu MCP tools to be installed (see above).

  • skills/cloudgpu-model-api/SKILL.md: calling the OpenAI-compatible model API at https://cloudgpu.app/v1 without renting a GPU. It works with the MCP tools or with just a CLOUDGPU_API_KEY.

  • Claude plugin: both skills are included automatically when you install the CloudGPU Claude plugin from this repo's marketplace:

    /plugin marketplace add mrhy7176/cloudgpu-mcp
    /plugin install cloudgpu@cloudgpu
    
  • Claude Code, personal install: copy skills/cloudgpu/ and skills/cloudgpu-model-api/ to ~/.claude/skills/.

  • Claude Code, project install: copy skills/cloudgpu/ and skills/cloudgpu-model-api/ to .claude/skills/ in your project.

  • Cursor, Codex, Cline, Amp and other agents that read Agent Skills: install both skills with the skills CLI:

    npx skills add mrhy7176/cloudgpu-mcp
    

Tools

ToolWhat it does
get_accountBalance, and how many instances the account may run at once
list_gpusGPU models with VRAM, live price per GPU-hour and availability
list_templatesReady-made images: JupyterLab, Ollama, ComfyUI, LLaMA-Factory, …
estimate_costLive quote for a GPU and a number of hours, plus your balance afterwards; returns a quote_id
create_instanceRents from an approved quote, with a budget, a time limit and an idle limit
get_status / list_instancesStatus, minutes run, cost so far, auto-shutdown limits
run_commandRuns a command on the instance; background=true for long jobs
tail_logsLatest log lines, whether the job finished, GPU utilisation
upload / downloadFiles and folders between your computer and the instance (SFTP)
stop_instanceDestroys the instance and stops billing
list_modelsModels on the OpenAI-compatible API, for inference without renting a GPU

The server also provides a train_on_cloudgpu prompt.

Guardrails

  • A quote first. create_instance only takes a quote_id from estimate_cost and user_confirmed=true.
  • Server-side limits. Every instance is created with max_spend_usd, max_hours and an idle limit (60 minutes by default). CloudGPU's servers check them and destroy the instance when one is hit, even if your client has disconnected or your laptop is asleep.
  • Your own ceiling. CLOUDGPU_MAX_SPEND_USD and CLOUDGPU_MAX_HOURS cap what the agent may set.
  • Results before shutdown. After commands have run, stop_instance refuses until something has been downloaded, unless the user confirms force=true.
  • Secrets stay out of the chat. The instance's SSH login is used inside this process and never returned to the model. Tool output is scrubbed of the API key and login details. Uploading .ssh, .env, key files or your whole home directory needs allow_sensitive=true.
  • The instance stays manageable. Commands that change the root password, SSH configuration, firewall or the platform's monitoring agent are refused. CloudGPU shuts down instances that it can no longer monitor.
  • Read-only mode. CLOUDGPU_READ_ONLY=1 registers only the look-up tools.

Configuration

EnvDefault
CLOUDGPU_API_KEY(required)From https://cloudgpu.app/api
CLOUDGPU_MAX_SPEND_USD50Highest budget the agent may set for one instance
CLOUDGPU_MAX_HOURS24Longest time limit the agent may set
CLOUDGPU_READ_ONLYoff1 = look-up tools only
CLOUDGPU_BASE_URLhttps://cloudgpu.appOverride the API host

Model API on the same balance

The key also works with the OpenAI-compatible API at https://cloudgpu.app/v1. Call list_models (or GET /v1/models) to see the available model IDs. Model prices are on cloudgpu.app/api.

Without MCP

The server wraps CloudGPU's public REST API, which any agent or script can call with the same key:

curl https://cloudgpu.app/v1/gpu/offers -H "Authorization: Bearer $CLOUDGPU_API_KEY"

Command-line tool

The package also installs a cloudgpu command for using the same API from a terminal (Node.js 18.3 or newer, no extra dependencies):

npm install -g cloudgpu-mcp      # or run it once with: npx -p cloudgpu-mcp cloudgpu --help
cloudgpu login                   # saves your key to ~/.config/cloudgpu/config.json (mode 0600)
cloudgpu offers                  # GPU models with live price and availability
cloudgpu up --gpu "RTX 4090" --template comfyui --max-minutes 120 --max-spend 5 --wait
cloudgpu ssh <id>                # opens your system ssh to the instance
cloudgpu down <id>               # destroys it and stops billing (asks first; --yes to skip)
CommandWhat it does
loginSave an API key (input hidden, or piped on stdin); checked against the API first
offers [--template ID]GPU models, VRAM, live price per GPU-hour, availability
templatesReady-made images and the GPU each recommends
up --gpu MODEL [--template ID] [--count N] [--max-minutes N] [--max-spend USD] [--idle-minutes N] [--wait]Rent an instance; --wait polls until it is running or failed, then prints the SSH command and URL
ls / status <id>Instances with status, minutes run and cost so far
ssh <id> [-- ARGS]Run ssh with the instance's host, port and user; --show-password prints the password if there is one
down <id> [--yes]Destroy the instance; its disk is erased, so download results first
balanceBalance and how many instances the account may run

CLOUDGPU_API_KEY takes precedence over the saved key, and CLOUDGPU_BASE_URL overrides the API host. Read commands accept --json; SSH passwords are left out of JSON unless you pass --show-password. Every command has --help. Errors print the API's message and exit non-zero (2 for usage errors).

CloudGPU here means cloudgpu.app. Prepaid balance, billed per minute; when the balance runs out, running instances are destroyed and their disks erased, so keep enough balance for the job and download results as you go.

Development

npm install
npm test
node src/index.js   # stdio server; set CLOUDGPU_API_KEY first
node src/cli.js --help

License

MIT, see LICENSE.

版本与发布记录

cloudgpu-mcp 共发布 5 个版本,首次发布于 2026/10/27;过去 12 个月发布了 5 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.2.0latest2026/11/03今天
0.1.22026/11/021 天前
0.1.12026/10/286 天前
0.1.02026/10/277 天前
0.0.0-stage2026/10/277 天前

关于 cloudgpu-mcp 的常见问题

cloudgpu-mcp 是什么?

MCP服务器和cloudgpu命令行工具。app:让Claude Code, Cursor, Cline, opencode, goose和其他MCP客户端(或者你,从终端)每分钟租用一个GPU,运行一个作业,获取结果并关闭它,并限制平台的支出

如何安装 cloudgpu-mcp?

在项目目录运行 npm install cloudgpu-mcp,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 cloudgpu、cloudgpu-mcp,可以用 npx cloudgpu 直接运行。

cloudgpu-mcp 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/cloudgpu-mcp 是否存在。

cloudgpu-mcp 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

cloudgpu-mcp 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.3。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

cloudgpu-mcp 可以商用吗?

cloudgpu-mcp 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

cloudgpu-mcp 还在维护吗?

最新版本 0.2.0 发布于 2026/11/03(今天);至今共发布 5 个版本,其中过去 12 个月发布了 5 个;首次发布于 2026/10/27。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。