Skip to main content
Glama
runpod

RunPod MCP Server

Official
by runpod

Runpod MCP 服务器

此模型上下文协议 (MCP) 服务器允许你通过任何兼容 MCP 的客户端管理 Runpod 基础设施。它提供了用于处理 Pod、无服务器端点、模板、网络卷和容器注册表身份验证的工具。

快速入门

要求

使用 npx 运行

你可以直接运行服务器而无需安装:

RUNPOD_API_KEY=YOUR_API_KEY npx @runpod/mcp-server@latest

通过 Smithery 安装

要通过 Smithery 自动为 Claude Desktop 安装:

npx -y @smithery/cli install @runpod/runpod-mcp-ts --client claude

Related MCP server: Quickbase MCP Server

使用你的客户端进行设置

大多数 MCP 客户端使用具有相同通用结构的 JSON 配置文件。以下示例展示了 npx 方法(推荐给大多数用户)和本地构建方法(用于开发)。将 YOUR_API_KEY 替换为你实际的 Runpod API 密钥。

Claude Code

全局添加 MCP 服务器,以便在所有项目中可用:

claude mcp add runpod -s user \
  -e RUNPOD_API_KEY=YOUR_API_KEY \
  -- npx -y @runpod/mcp-server@latest

或者将其添加到特定项目中(创建一个你可以提交的 .mcp.json 文件):

claude mcp add runpod -s project \
  -e RUNPOD_API_KEY=YOUR_API_KEY \
  -- npx -y @runpod/mcp-server@latest

使用 claude mcp list 验证服务器是否已连接。如果你处于活动会话中,输入 /mcp 即可重新连接而无需重启。

Claude Desktop

编辑 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) 或 %APPDATA%\Claude\claude_desktop_config.json (Windows) 处的配置文件:

{
  "mcpServers": {
    "runpod": {
      "command": "npx",
      "args": ["-y", "@runpod/mcp-server@latest"],
      "env": {
        "RUNPOD_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

保存后重启 Claude Desktop。

Cursor

将以下内容添加到项目目录中的 .cursor/mcp.json,或添加到 ~/.cursor/mcp.json 以实现全局访问:

{
  "mcpServers": {
    "runpod": {
      "command": "npx",
      "args": ["-y", "@runpod/mcp-server@latest"],
      "env": {
        "RUNPOD_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Windsurf

打开 Windsurf 设置(Cmd+Shift+P → “Open Windsurf Settings”),导航到 Cascade 部分,并启用 MCP。然后编辑 ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "runpod": {
      "command": "npx",
      "args": ["-y", "@runpod/mcp-server@latest"],
      "env": {
        "RUNPOD_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

VS Code (GitHub Copilot)

MCP 在 VS Code 的代理模式下工作(需要 VS Code 1.101+)。将以下内容添加到工作区中的 .vscode/mcp.json

{
  "mcpServers": {
    "runpod": {
      "command": "npx",
      "args": ["-y", "@runpod/mcp-server@latest"],
      "env": {
        "RUNPOD_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

点击服务器条目旁边的“Start”按钮进行连接。

Cline

在 VS Code 中打开 Cline,点击汉堡菜单 (☰),然后转到 MCP Servers。你可以通过市场添加服务器,或者使用上面显示的相同 JSON 结构在 Cline 的设置中手动配置。

JetBrains IDEs

~/.junie/mcp.json(全局)或项目中的 .junie/mcp/ 创建一个 mcp.json 文件:

{
  "mcpServers": {
    "runpod": {
      "command": "npx",
      "args": ["-y", "@runpod/mcp-server@latest"],
      "env": {
        "RUNPOD_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

其他客户端

此服务器使用 stdio 传输,并适用于任何兼容 MCP 的客户端。所有客户端的配置模式都是相同的——将命令指向 npx 并以 @runpod/mcp-server@latest 作为参数,并在环境中设置 RUNPOD_API_KEY。有关 MCP 客户端的完整列表,请参阅 官方 MCP 客户端页面

使用本地构建

如果你想从仓库的本地克隆运行(用于开发或测试未发布的更改):

git clone https://github.com/runpod/runpod-mcp.git
cd runpod-mcp
pnpm install
pnpm build

然后将上述任何配置中的 commandargs 替换为:

{
  "command": "node",
  "args": ["/absolute/path/to/runpod-mcp/dist/index.mjs"]
}

对源代码进行更改后,重新运行 pnpm build 并重启或重新连接 MCP 服务器以使更改生效。

使用示例

列出所有 Pod

Can you list all my Runpod Pods?

创建一个新 Pod

Create a new Runpod Pod with the following specifications:
- Name: test-pod
- Image: runpod/pytorch:2.1.0-py3.10-cuda11.8.0-devel-ubuntu22.04
- GPU Type: NVIDIA GeForce RTX 4090
- GPU Count: 1

创建一个无服务器端点

Create a Runpod Serverless endpoint with the following configuration:
- Name: my-endpoint
- Template ID: 30zmvf89kd
- Minimum workers: 0
- Maximum workers: 3

贡献

要开始本地开发,请克隆仓库并构建:

git clone https://github.com/runpod/runpod-mcp.git
cd runpod-mcp
pnpm install
pnpm build

更改后,使用 pnpm build 重新构建。在 Claude Code 中,输入 /mcp 即可重新连接到更新后的服务器,而无需重启会话。你也可以使用 pnpm build:watch 在开发过程中进行自动重新构建。

所有工具都位于 src/index.ts 中。服务器使用两个后端:用于经过身份验证的 CRUD 操作的 REST API (runpodRequest()),以及用于公共只读查询(如 GPU 类型和数据中心)的 GraphQL API (graphqlRequest())。在添加新工具时遵循现有模式——kebab-case 命名、带有 .describe() 的 Zod 模式以及 JSON 字符串化响应。

该项目使用 changesets 进行版本控制和 npm 发布。每个包含用户可见更改的 PR 都需要在 .changeset/DESCRIPTIVE_NAME.md 处有一个 changeset 文件:

---
"@runpod/mcp-server": minor
---

Description of what changed and why.

使用 patch 进行错误修复,minor 用于新工具或功能,major 用于重大更改。.changeset/ 目录已被 git 忽略,因此请使用 git add -f 来暂存 changeset 文件。

请参阅 CLAUDE.md 获取完整的开发指南,包括架构细节、工具约定和已知问题。

安全注意事项

此服务器需要你的 Runpod API 密钥,该密钥授予对你 Runpod 账户的完全访问权限。切勿共享你的 API 密钥。请谨慎执行操作,并考虑设置一个权限受限的单独 API 密钥。在没有适当安全措施的情况下,请勿在生产环境中使用此服务器。

许可证

Apache-2.0

Install Server
A
security – no known vulnerabilities
F
license - not found
-
quality - not tested

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

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/runpod/runpod-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server