runpod-mcp
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRunpod MCP
Runpod MCP
The Runpod MCP server exposes Runpod's control plane as structured tool calls,
so an MCP-capable agent can manage infrastructure without shelling out. It is the
same Runpod REST API that uses — pick MCP when its tools are
connected (typed params, structured errors, no shell quoting).
runpodctlRunpod MCP服务器将Runpod的控制平面以结构化工具调用的形式暴露出来,因此支持MCP的Agent无需调用外部shell即可管理基础设施。它使用与相同的Runpod REST API——当MCP工具已连接时选择使用它(具备类型化参数、结构化错误、无需shell转义)。
runpodctlConnect
连接
Connect the hosted server with your API key as a Bearer header if you also use runpodctl/flash — that one key auths the MCP and the CLIs (the 80% path):
bash
claude mcp add --transport http runpod -s user https://mcp.getrunpod.io/ \
--header "Authorization: Bearer $RUNPOD_API_KEY"Plain OAuth ("Sign in with Runpod", via ) is MCP-only — the CLIs stay unauthed, so use it only for MCP-only work. Local stdio runs the server as a subprocess with your key. Those variants + the key-vs-OAuth tradeoff: reference/connect.md. After connecting, reconnect the client (in Claude Code, ) so the tools load.
npx @runpod/mcp-server@latest add/mcpVerify it's live (do this before relying on MCP): in Claude Code run —
should show Connected, not Needs authentication (if it's the latter,
sign in there first; the bundled plugin server registers the URL but stays inert
until you authenticate). Confirm a real call works by asking for .
If the tools aren't present at all, the server isn't connected — (re)run the
install above, or fall back to runpodctl for this task.
/mcprunpodlist-endpointsrunpodCheck the server version (which REST API it drives): the MCP handshake
returns it in . in Claude Code shows it, or probe the hosted
server directly:
initializeserverInfo.version/mcpbash
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"probe","version":"0"}}}' \
| curl -s -X POST https://mcp.getrunpod.io/ -H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" -H "Authorization: Bearer $RUNPOD_API_KEY" -d @-如果您同时使用runpodctl/flash,请使用您的API密钥作为Bearer头连接托管服务器:同一个密钥可同时认证MCP和CLI(这是80%场景的通用方案):
bash
claude mcp add --transport http runpod -s user https://mcp.getrunpod.io/ \
--header "Authorization: Bearer $RUNPOD_API_KEY"纯OAuth(“使用Runpod登录”,通过)仅适用于MCP——CLI仍未认证,因此仅在仅需MCP工作时使用。本地stdio方式会以子进程形式运行服务器并使用您的密钥。这些变体以及密钥与OAuth的权衡:reference/connect.md。连接后,重新连接客户端(在Claude Code中执行)以加载工具。
npx @runpod/mcp-server@latest add/mcp验证连接状态(依赖MCP前请执行此操作):在Claude Code中运行——应显示已连接,而非需要认证(如果是后者,请先在此处登录;捆绑的插件服务器会注册URL,但在您认证前处于非活动状态)。通过请求确认实际调用可用。如果完全没有工具,则服务器未连接——重新运行上述安装命令,或回退到runpodctl完成此任务。
/mcprunpodlist-endpointsrunpod**检查服务器版本(它驱动的REST API版本):**MCP的握手会在中返回版本信息。在Claude Code中执行即可查看,或直接探测托管服务器:
initializeserverInfo.version/mcpbash
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"probe","version":"0"}}}' \
| curl -s -X POST https://mcp.getrunpod.io/ -H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" -H "Authorization: Bearer $RUNPOD_API_KEY" -d @-→ serverInfo.version e.g. "3.0.0 [RUNPOD_REST_VERSION=v2]" (verified 2026-07-29)
→ serverInfo.version 示例:"3.0.0 [RUNPOD_REST_VERSION=v2]" (2026-07-29验证)
The MCP server drives Runpod's **REST v2** internally (`RUNPOD_REST_VERSION=v2`), so most
tools avoid the buggy **public `rest.runpod.io/v1`** control API. Two exceptions worth
knowing: the Hub, public-endpoint and `set-endpoint-gpus` tools go through GraphQL (so they
work under either REST version), and **CPU serverless endpoints are not creatable through
MCP** — v2 has no CPU-endpoint concept at all (`create-endpoint` requires `gpuPoolIds`), so
use `runpodctl serverless create --compute-type CPU` for those.
**Prefer MCP or `runpodctl` over hand-rolled `rest.runpod.io/v1` calls for creating endpoints.**
MCP服务器内部驱动Runpod的**REST v2**版本(`RUNPOD_REST_VERSION=v2`),因此大多数工具可避免使用存在bug的**公开`rest.runpod.io/v1`**控制API。有两个值得注意的例外:Hub、公开端点和`set-endpoint-gpus`工具通过GraphQL实现(因此在任一REST版本下均可工作),且**CPU无服务器端点无法通过MCP创建**——v2完全没有CPU端点的概念(`create-endpoint`需要`gpuPoolIds`),因此请使用`runpodctl serverless create --compute-type CPU`创建此类端点。
**对于创建端点,优先使用MCP或`runpodctl`,而非自行编写的`rest.runpod.io/v1`调用。**Tool surface
工具范围
Structured tools, grouped by resource:
- Pods — list, get, create, update, start, stop, restart, delete, stream logs.
- Serverless endpoints — list, get, create, update, delete; list workers; list releases; stream worker logs.
- takes
create-endpoint(default) orendpointType: QUEUE— see golden path 14. The routing type is fixed at creation;LOAD_BALANCERcannot change it.update-endpoint - Read an endpoint's invoke URLs from on the get/list reply instead of assembling them.
requestUrls - To pin a specific GPU SKU on an existing endpoint use ;
set-endpoint-gpus/create-endpointexpose onlyupdate-endpointand can't express a SKU (gpuPoolIdscan pin one at deploy time viadeploy-hub-repoexclusions).gpuIds
- Jobs (serverless runtime) — run, runsync, status, stream, cancel, retry, health, purge queue.
- Hub — (public catalog of prebuilt Serverless workers and Pod templates: vLLM, ComfyUI, …) and
list-hub-repos, which deploys a repo's listed release as an endpoint — the same as clicking Deploy on the Hub.deploy-hub-repo - Public endpoints — : managed pay-per-use model APIs (text/image/video/audio) that need no deployment. Call the returned endpointId with
list-public-endpoints/run-endpoint.runsync-endpoint - Templates — list, get, create, update, delete.
- Network volumes — list, get, create, update, delete. takes
create-network-volume(volumeType|STANDARD) and a size of 10–4096 GB; omitHIGH_PERFORMANCEto get the data center's default tier. The tier is immutable after creation —volumeTypecan't change it.update-network-volume - Container registry auth — list, get, create, delete. A username + password for any registry; pass the resulting id as on create-pod/create-endpoint.
containerRegistryAuthId - ECR delegations (/
list-/create-) — AWS ECR only, v2 only, and stores no credentials: you register a repository ARN and Runpod gets scoped pull access instead. Prefer it over a stored username/password for ECR. The reply carries adelete-registry-delegation— that's the image URI to deploy with.dockerRegistryUri - Catalog — list/get GPU types, list/get CPU types, list/get data centers.
- Billing — scoped usage/cost breakdowns ().
get-billing
The tool list above is a map, not a contract. The server is the source of truth —(or your client's tool list) shows exactly what the connected version exposes, and each tool carries its own parameter descriptions. Check there before assuming a capability exists or doesn't./mcp
Delete tools (,delete-template, …) can returndelete-podwith "Unexpected end of JSON input" even on success — the Runpod REST API returns 204 No Content. Don't treat it as failure; confirm with a follow-upisError: true/get-(a deleted resource then 404s).list-
结构化工具按资源分组:
- Pods——列表、获取、创建、更新、启动、停止、重启、删除、流式传输日志。
- 无服务器端点——列表、获取、创建、更新、删除;列出工作节点;列出版本;流式传输工作节点日志。
- 接受
create-endpoint(默认)或endpointType: QUEUE——参见黄金路径14。路由类型在创建时固定;LOAD_BALANCER无法更改它。update-endpoint - 从get/list回复的中读取端点的调用URL,而非自行组装。
requestUrls - 要在现有端点上固定特定GPU SKU,请使用;
set-endpoint-gpus/create-endpoint仅暴露update-endpoint,无法指定SKU(gpuPoolIds可在部署时通过deploy-hub-repo排除项固定SKU)。gpuIds
- 任务(无服务器运行时)——运行、同步运行、状态、流式传输、取消、重试、健康检查、清除队列。
- Hub——(预构建无服务器工作节点和Pod模板的公开目录:vLLM、ComfyUI等)和
list-hub-repos,用于将仓库的指定版本部署为端点——与在Hub上点击部署操作相同。deploy-hub-repo - 公开端点——:托管的按使用付费模式API(文本/图像/视频/音频),无需部署。使用
list-public-endpoints/run-endpoint调用返回的endpointId。runsync-endpoint - 模板——列表、获取、创建、更新、删除。
- 网络卷——列表、获取、创建、更新、删除。接受
create-network-volume(volumeType|STANDARD)和10–4096 GB的大小;省略HIGH_PERFORMANCE将使用数据中心的默认层级。层级在创建后不可变——volumeType无法更改它。update-network-volume - 容器注册表认证——列表、获取、创建、删除。适用于任意注册表的用户名+密码;将生成的id作为传入create-pod/create-endpoint。
containerRegistryAuthId - ECR委托(/
list-/create-)——仅适用于AWS ECR,仅v2支持,且不存储凭证:您注册仓库ARN,Runpod将获得范围化的拉取权限。对于ECR,优先使用此方式而非存储用户名/密码。回复中包含delete-registry-delegation——这是用于部署的镜像URI。dockerRegistryUri - 目录——列出/获取GPU类型、列出/获取CPU类型、列出/获取数据中心。
- 账单——范围化的使用/成本明细()。
get-billing
上述工具列表是参考而非契约。服务器是权威来源——(或您客户端的工具列表)会准确显示已连接版本暴露的工具,每个工具都带有自己的参数说明。在假设某项功能存在或不存在之前,请先在此处查看。/mcp
删除工具(、delete-template等)即使在成功时也可能返回delete-pod并附带“Unexpected end of JSON input”——这是因为Runpod REST API返回204 No Content。请勿将其视为失败;通过后续的isError: true/get-操作确认(已删除的资源会返回404)。list-
Use MCP vs runpodctl
使用MCP vs runpodctl
- Use runpod-mcp when the tools are connected AND the task is infra CRUD or a serverless job call the server exposes. Cap large job/log output to a file.
- Use runpodctl instead for: /
sendfile transfer, SSH key management,receivesetup, model cache — or any shell-only agent, or when the user wants a reproducible command.doctor - Hand pod creation to runpodctl for a multi-GPU priority list (MCP's v2
create-pod takes one GPU type; extra are dropped with a
gpuTypeIdson success), or for a template + CPU pod together —_warningrejects that combination, since a template deploy is GPU-and-v2-only. Each alone is fine in MCP:create-pod(v2-only,templateIdthen optional, and each field you pass replaces the template's whole value rather than merging) orimageName.computeType: "CPU" - Not this lane: writing/deploying your own Python (→ flash); downloading models or building/pushing images (→ companion-clis).
For concepts (pods vs serverless, GPU selection, storage), read
.
../runpod-usage/- 使用runpod-mcp:当工具已连接且任务为基础设施CRUD或服务器暴露的无服务器任务调用时。将大型任务/日志输出限制到文件中。
- 改用runpodctl:用于**/
send文件传输、SSH密钥管理、receive**设置、模型缓存——或任何仅支持shell的Agent,或当用户需要可复现的命令时。doctor - 将pod创建交给runpodctl:用于多GPU优先级列表(MCP的v2 create-pod仅接受一种GPU类型;额外的会在成功时被丢弃并附带
gpuTypeIds),或模板+CPU组合的pod——_warning会拒绝这种组合,因为模板部署仅支持GPU和v2。单独使用模板或CPU在MCP中是可行的:create-pod(仅v2支持,templateId为可选,您传入的每个字段会替换模板的整个值而非合并)或imageName。computeType: "CPU" - 不属于此范畴:编写/部署您自己的Python代码(→ flash);下载模型或构建/推送镜像(→ companion-clis)。
如需了解概念(pod vs 无服务器、GPU选择、存储),请阅读。
../runpod-usage/Source & docs
源码与文档
- Server source: https://github.com/runpod/runpod-mcp
- Package (npm): https://www.npmjs.com/package/@runpod/mcp-server
- Hosted endpoint: https://mcp.getrunpod.io/
- Docs: https://docs.runpod.io