Claude Code 接入
160+ AI 模型
通过 Hosted MCP 将 Claude Desktop、Cursor、VS Code 或 Windsurf 连接到 RunAPI,并使用 OAuth 登录。
https://mcp.runapi.ai/mcp
https://mcp.runapi.ai/mcp
https://mcp.runapi.ai/mcp
https://mcp.runapi.ai/mcp
Hosted MCP 在 https://mcp.runapi.ai/mcp 使用 Streamable HTTP。将此 URL 添加到 Claude Desktop、Cursor、VS Code 或 Windsurf,然后在浏览器中完成 RunAPI OAuth 流程。仅在兼容性或无头环境中使用单独的 API Key 回退方式。
API Key 回退方式
仅当客户端无法完成 OAuth 或用于无头环境时使用这些配置。请把 API key 保存在客户端的密钥机制中,不要直接写入 JSON。
{
"mcpServers": {
"runapi": {
"url": "https://mcp.runapi.ai/mcp",
"headers": {
"Authorization": "Bearer ${env:RUNAPI_API_KEY}"
}
}
}
}
macOS GUI:在 Terminal 中运行下方命令,然后用 Cmd+Q 完全退出 Cursor,再从 Finder 或 Dock 打开。登出或重启 macOS 后需重复执行。该方法会让登录会话中之后启动的应用获得密钥,请使用独立、可撤销的 key,并在不再需要时运行 `launchctl unsetenv RUNAPI_API_KEY`。
printf 'RunAPI API key: ' >&2
read -r -s RUNAPI_API_KEY
printf '\n' >&2
launchctl setenv RUNAPI_API_KEY "$RUNAPI_API_KEY"
unset RUNAPI_API_KEY
{
"mcpServers": {
"runapi": {
"serverUrl": "https://mcp.runapi.ai/mcp",
"headers": {
"Authorization": "Bearer ${file:~/.config/runapi/mcp_api_key}"
}
}
}
}
macOS/Linux:运行下方命令一次,创建仅本人可读的 mode 600 密钥文件。保存复制的 JSON 后,完全退出并重新打开 Windsurf,让它重新读取配置。这能避免 GUI 环境变量为空。
install -d -m 700 ~/.config/runapi
umask 077
printf 'RunAPI API key: ' >&2
read -r -s RUNAPI_API_KEY
printf '\n' >&2
printf '%s' "$RUNAPI_API_KEY" > ~/.config/runapi/mcp_api_key
unset RUNAPI_API_KEY
chmod 600 ~/.config/runapi/mcp_api_key
{
"inputs": [
{
"type": "promptString",
"id": "runapi-api-key",
"description": "RunAPI API key",
"password": true
}
],
"servers": {
"runapi": {
"type": "http",
"url": "https://mcp.runapi.ai/mcp",
"headers": {
"Authorization": "Bearer ${input:runapi-api-key}"
}
}
}
}
什么是 RunAPI MCP Server?
RunAPI MCP Server 将兼容 MCP 的编码工具连接到 RunAPI。AI 助手可以在编辑器中浏览模型、查看输入参数、检查定价、搜索可复用提示词、创建媒体任务、轮询任务状态并查看账户余额。Claude Desktop、Cursor、VS Code 和 Windsurf 使用 OAuth;API Key 认证仍作为兼容性和无头环境的独立回退方式。
8 个内置工具
AI 助手发现、定价和运行 AI 模型所需的一切。
list_models
按模态、服务或动作浏览模型。
get_model_info
查看模型的输入参数、约束和定价。
list_actions
按输出模态分组列出端点动作名称。
check_pricing
返回服务 + 动作 + 模型的定价快照。
search_prompts
搜索可复用的提示词示例。
create_task
创建媒体任务并可选轮询至完成。
get_task
获取现有任务的状态和最新数据。
check_balance
返回账户余额和支出指标。
可选的本地安装
Local MCP 是独立的 stdio 方案。偏好本地进程时,可配合 Node.js 和 Local Login 使用;上方 Hosted MCP 无需本地进程。
使用 Node.js 启动本地 stdio server。
npx -y @runapi.ai/mcp
运行 `runapi login` 打开浏览器 Local Login,并将凭据保存到本地配置。
runapi login
在无界面环境中,启动本地进程前设置 RUNAPI_API_KEY。
RUNAPI_API_KEY=runapi_xxx npx -y @runapi.ai/mcp
160+ 模型,4 种模态
列出的每个模型都可通过这个 MCP Server 执行。
| 模态 | 模型 |
|---|---|
| 图像 | Flux Kontext, Nano Banana, GPT Image, Seedream, Ideogram, Qwen |
| 视频 | Kling, Veo, Seedance, Hailuo, Wan, Runway, Luma |
| 音频 | Suno Music, ElevenLabs TTS, Sound Effects, STT, Isolation |
| 实用工具 | Kling AI Avatar, OmniHuman Detection, Seedream Layer Decomposition |
常见问题
Claude Desktop、Cursor、VS Code 和 Windsurf 均在浏览器中完成 RunAPI OAuth。API Key 认证仍作为兼容性和无头环境的独立回退方式。
可以。Local MCP 通过 Node.js 作为独立 stdio 进程运行;交互式使用 Local Login,无界面主机可设置 RUNAPI_API_KEY。