RunPod MCP服务器

RunPod MCP服务器是一个通过Claude或其他MCP兼容客户端与RunPod REST API交互的工具,提供对Pods、端点、模板、网络卷和容器注册认证的管理功能。

  • by antonioevans
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 antonioevans/runpod-mcp-ts

使用说明

RunPod MCP服务器

此模型上下文协议(MCP)服务器使您能够通过Claude或其他兼容MCP的客户端与RunPod REST API进行交互。

特性

服务器提供管理工具:

  • 容器组:创建、列出、获取详细信息、更新、启动、停止和删除Pod
  • 端点:创建、列出、获取详细信息、更新和删除无服务器端点
  • 模板:创建、列出、获取详细信息、更新和删除模板
  • 网络卷:创建、列出、获取详细信息、更新和删除网络卷
  • 容器注册表身份验证:创建、列出、获取详细信息和删除身份验证

设置

先决条件

  • Node.js 18或更高版本
  • RunPod帐户和API密钥
  • Claude for Desktop或其他兼容MCP的客户端

通过Smithery安装

通过以下方式自动安装Claude Desktop的runpod mcp-ts 史密瑟里:

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

安装

  1. 克隆存储库
  2. 安装依赖项:
    npm install
    
  3. 构建服务器:
    npm run build
    

配置

将RunPod API键设置为环境变量:

# Linux/macOS
export RUNPOD_API_KEY=your_api_key_here

# Windows (Command Prompt)
set RUNPOD_API_KEY=your_api_key_here

# Windows (PowerShell)
$env:RUNPOD_API_KEY="your_api_key_here"

您可以从 RunPod控制台.

运行服务器

启动服务器:

npm start

使用Claude进行桌面设置

  1. 打开Claude桌面版
  2. 编辑配置文件: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)或 %APPDATA%\Claude\claude_desktop_config.json (Windows)
  3. 添加服务器配置:
{
  "mcpServers": {
    "runpod": {
      "command": "node",
      "args": ["/path/to/runpod-mcp-server/build/index.js"],
      "env": {
        "RUNPOD_API_KEY": "your_api_key_here"
      }
    }
  }
}

确保更换 "args": ["/path/to/runpod-mcp-server/build/index.js"] 存储库中构建文件夹的路径。

  1. 重新启动桌面版的Claude

使用示例

以下是一些如何与Claude一起使用服务器的示例:

列出所有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

安全考虑

此服务器需要您的RunPod API密钥,该密钥授予您对RunPod帐户的完全访问权限。为了安全起见:

  • 永远不要共享您的API密钥
  • 谨慎执行操作
  • 考虑使用有限权限设置单独的API密钥
  • 没有适当的安全措施,不要在生产环境中使用它

许可证

麻省理工学院