---
title: &quot;RunAPI MCP Server — Claude Code / Codex 中转接入 130+ AI 模型&quot;
url: &quot;https://runapi.ai/zh-CN/mcp.md&quot;
canonical: &quot;https://runapi.ai/zh-CN/mcp&quot;
locale: &quot;zh-CN&quot;
---

# RunAPI MCP Server

一条命令安装 MCP Server，Claude Code、Codex、Cursor 直接调用大模型、图像生成、视频生成和音乐 API。无需手动改 base_url，无需管理多个 API key。

## What Is RunAPI MCP Server?

RunAPI MCP Server 将 MCP 兼容的编码工具连接到 RunAPI 平台。你的 AI 助手可以浏览 18 个提供方的 130+ 模型、查看输入参数、检查实时定价、创建图像/视频/音乐生成任务、轮询任务状态、查看账户余额和调用大模型 API — 全部在编辑器内完成。发现工具无需 API key 即可使用，认证操作需要 RunAPI API key。

## Tools

| Tool | Auth | Purpose |
|---|---|---|
| list_models | No | Browse models by modality, service, or action. |
| get_model_info | No | Inspect input params, constraints, and pricing for a model. |
| list_actions | No | Group endpoint action names by output modality. |
| check_pricing | No | Return pricing snapshot for a service + action + model. |
| create_task | Yes | Create a media task and optionally poll until completion. |
| get_task | Yes | Fetch status and latest payload for an existing task. |
| check_balance | Yes | Return account balance and spending metrics. |
| chat | Yes | Send messages to a RunAPI LLM endpoint. |

## Quick Start

Choose the command for your MCP client.

### Claude Code

```bash
claude mcp add runapi -s user -- npx -y @runapi.ai/mcp
export RUNAPI_API_KEY="runapi_xxx"
claude
```

Use project scope when you want the repo to share `.mcp.json`:

```bash
claude mcp add runapi -s project -- npx -y @runapi.ai/mcp
```

### Codex

```bash
codex plugin install runapi-mcp@agents
export RUNAPI_API_KEY="runapi_xxx"
codex
```

### Cursor

```bash
npx @runapi.ai/mcp init cursor
export RUNAPI_API_KEY="runapi_xxx"
cursor .
```

### Windsurf

```bash
npx @runapi.ai/mcp init windsurf
export RUNAPI_API_KEY="runapi_xxx"
windsurf .
```

### VS Code

```bash
npx @runapi.ai/mcp init vscode
export RUNAPI_API_KEY="runapi_xxx"
code .
```

### Roo Code

```bash
npx @runapi.ai/mcp init roo
export RUNAPI_API_KEY="runapi_xxx"
code .
```

Free catalog tools work without a key.
Set `RUNAPI_API_KEY` for `create_task`, `check_balance`, and `chat`.
For GUI-launched clients, add the variable in the client's environment settings.

## Model Coverage

- **Image** — Flux Kontext, Nano Banana, GPT Image, Seedream, Ideogram, Qwen
- **Video** — Kling, Veo, Seedance, Hailuo, Wan, Runway, Luma
- **Music** — Suno v4 / v4.5 / v5 / v5.5
- **Audio** — ElevenLabs TTS, Sound Effects, STT, Isolation
- **LLM** — Claude, GPT, Gemini, DeepSeek

## FAQ

### 可以在 CI 或无界面环境中使用 MCP Server 吗？

可以。设置 RUNAPI_API_KEY 环境变量并在 Agent 或 CI 管道中配置 MCP Server。服务器以 stdio 进程运行，不需要浏览器或 GUI。

### MCP Server 支持哪些编码工具？

RunAPI MCP Server 兼容所有支持 MCP 协议的主机：Claude Code、Codex、Cursor、VS Code（通过 GitHub Copilot）、Windsurf 和 Roo Code。也可配置到任何支持 MCP 协议的工具。


## Links

- [Model catalog](https://runapi.ai/zh-CN/models)
- [CLI](https://runapi.ai/zh-CN/cli)
- [SDKs](https://runapi.ai/zh-CN/sdk)
- [Skills](https://runapi.ai/zh-CN/skills)
- [Pricing](https://runapi.ai/zh-CN/pricing)
- [API docs](https://runapi.ai/zh-CN/docs)
- [GitHub](https://github.com/runapi-ai/mcp)
- [npm](https://www.npmjs.com/package/@runapi.ai/mcp)
