RunPod-MCP工具服务器
该模型上下文协议服务器通过Claude或其他与MCP兼容的客户端,实现了与RunPod的REST API的交互,提供了管理pod、端点、模板、网络卷和容器注册表身份验证的工具。
服务介绍
RunPod MCP 服务器
此 Model Context Protocol (MCP) 服务器使您能够通过 Claude 或其他兼容 MCP 的客户端与 RunPod REST API 进行交互。
功能
该服务器提供了管理以下内容的工具:
- Pods:创建、列出、获取详情、更新、启动、停止和删除 Pods
- Endpoints:创建、列出、获取详情、更新和删除无服务器端点
- Templates:创建、列出、获取详情、更新和删除模板
- Network Volumes:创建、列出、获取详情、更新和删除网络卷
- Container Registry Authentications:创建、列出、获取详情和删除认证
设置
先决条件
- Node.js 18 或更高版本
- RunPod 账户和 API 密钥
- Claude for Desktop 或其他兼容 MCP 的客户端
通过 Smithery 安装
要通过 Smithery 自动为 Claude Desktop 安装 runpod-mcp-ts:
npx -y @smithery/cli install @runpod/runpod-mcp-ts --client claude
安装
- 克隆仓库
- 安装依赖项:
npm install - 构建服务器:
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 控制台 获取您的 API 密钥。
运行服务器
启动服务器:
npm start
使用 Claude for Desktop 设置
- 打开 Claude for Desktop
- 编辑配置文件:
~/Library/Application Support/Claude/claude_desktop_config.json(macOS)或%APPDATA%\Claude\claude_desktop_config.json(Windows) - 添加服务器配置:
{
"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"] 替换为仓库中构建文件夹的路径。
- 重启 Claude for Desktop
使用示例
以下是一些使用 Claude 与服务器进行交互的示例:
列出所有 Pods
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 密钥
- 在没有适当安全措施的情况下不要在生产环境中使用
许可证
MIT