RunPod映像MCP服务器
MCP服务器提供 克劳德代码 和 光标 使用RunPod的Seedream V4和Nano Banana Pro API生成和编辑图像的能力。
先决条件
设置
克劳德代码
快速启动(一个命令):
claude mcp add runpod-image-apis \
-e RUNPOD_API_KEY=your_api_key \
-- uvx runpod-mcp-server重新启动Claude Code,工具可用。
手动设置 (克隆并在本地运行):添加到 .mcp.json (项目级或 ~/.claude/.mcp.json 全球):
{
"mcpServers": {
"runpod-image-apis": {
"command": "uv",
"args": ["run", "--directory", "/path/to/runpod-image-mcp", "runpod-mcp-server"],
"env": {
"RUNPOD_API_KEY": "your_api_key"
}
}
}
}替换 /path/to/runpod-image-mcp 带有克隆仓库的绝对路径。
光标
快速入门: 创建或编辑MCP配置并添加服务器。
- 仅项目: 创造
.cursor/mcp.json在您的项目根目录中。 - 所有项目: 创造
~/.cursor/mcp.json在您的主目录中。
如果使用uvx (无需克隆):
{
"mcpServers": {
"runpod-image-apis": {
"command": "uvx",
"args": ["runpod-mcp-server"],
"env": {
"RUNPOD_API_KEY": "your_api_key"
}
}
}
}如果从克隆的仓库运行:
git clone https://github.com/jashwanth0712/runpod-image-mcp.git
cd runpod-image-mcp然后使用以下配置之一。
在 项目 .cursor/mcp.json (使用 ${workspaceFolder} 因此,它适用于任何包含克隆的项目):
{
"mcpServers": {
"runpod-image-apis": {
"command": "uv",
"args": ["run", "--directory", "${workspaceFolder}", "runpod-mcp-server"],
"env": {
"RUNPOD_API_KEY": "your_api_key"
}
}
}
}在 全球 ~/.cursor/mcp.json,使用仓库的绝对路径:
{
"mcpServers": {
"runpod-image-apis": {
"command": "uv",
"args": ["run", "--directory", "/path/to/runpod-image-mcp", "runpod-mcp-server"],
"env": {
"RUNPOD_API_KEY": "your_api_key"
}
}
}
}替换 /path/to/runpod-image-mcp 与实际路径。重新启动Cursor(或重新加载窗口),以便拾取新的MCP服务器。
可用工具
| 工具 | 说明 |
|---|---|
generate_image | 根据文本提示生成图像(Seedream V4 T2I)。支持高达4096x4096的尺寸、否定提示和种子控制。 |
edit_image | 编辑/转换现有图像(Nano Banana Pro编辑)。接受1-10个具有1k/2k/4k分辨率选项的图像URL。 |
check_job_status | 检查以前提交的生成或编辑作业的状态。 |
get_api_info | 获取有关支持的参数、尺寸、定价和功能的参考信息。 |
用法示例
配置后,自然地询问Claude或Cursor:
Generate a photorealistic sunset over snow-capped mountains with dramatic cloudsEdit this product photo to have a white background and studio lighting: https://example.com/photo.jpgCheck the status of job abc123-def456 from SeedreamWhat sizes does the Seedream API support?故障排除
- 服务器无法启动 --验证您的
RUNPOD_API_KEY是正确的。 - 作业超时 --增加
max_wait_seconds或使用check_job_status手动投票。大图像需要更长的时间。 - 响应中没有图像URL --检查RunPod控制台以了解作业详细信息和端点运行状况。
许可证
麻省理工学院
