内容
# Crazyrouter MCP 服务器 — 一个 API 访问 627+ AI 模型
> **一个密钥。627+ 模型。文本、图像、视频、音频、音乐、3D — 全部通过 MCP。**
[](https://www.npmjs.com/package/crazyrouter-mcp)
[](LICENSE)
[](https://nodejs.org/)
[](https://modelcontextprotocol.io)
[](https://www.npmjs.com/package/crazyrouter-mcp)
Crazyrouter MCP 服务器是一个标准的 MCP(模型上下文协议)服务器,让你的 AI 助手(如 Claude Desktop、Cursor、VS Code 等)通过 [Crazyrouter AI API 网关](https://crazyrouter.com?utm_source=github&utm_medium=mcp&utm_campaign=dev_community) 访问 627+ AI 模型。
## ✨ 功能
- 🌐 **627+ 模型,一个 API** — GPT-5, Claude Opus 4.6, Gemini 3, DeepSeek R1, Llama 4, Qwen3, Grok 4, 以及数百种更多模型
- 🎨 **图像生成** — DALL-E 3, Midjourney, Flux, Stable Diffusion, Nano Banana Pro
- 🎬 **视频生成** — Sora 2, Kling V2, Veo 3, Seedance, Pika
- 🎵 **音乐生成** — Suno V4, Chirp
- 🗣️ **文本转语音 & 语音转文本** — 多种 TTS/STT 引擎
- 💰 **竞争性定价** — 大多数模型低于官方价格
- 🌍 **7 个全球边缘节点** — 全球范围低延迟
- 🔄 **OpenAI + Anthropic + Gemini 协议兼容** — 直接替换
- ⚡ **积分永不过期** — 充值一次,随时使用
## 🚀 快速开始
### 1. 获取 API 密钥
在 [crazyrouter.com](https://crazyrouter.com?utm_source=github&utm_medium=mcp&utm_campaign=dev_community) 注册并获取你的 API 密钥。
### 2. 安装
```bash
git clone https://github.com/xujfcn/crazyrouter-mcp.git
cd crazyrouter-mcp
npm install
npm run build
```
### 3. 配置 AI 客户端
<details>
<summary><strong>Claude Desktop</strong></summary>
编辑 `~/Library/Application Support/Claude/claude_desktop_config.json`(macOS)或 `%APPDATA%\Claude\claude_desktop_config.json`(Windows):
```json
{
"mcpServers": {
"crazyrouter": {
"command": "node",
"args": ["/path/to/crazyrouter-mcp/dist/index.js"],
"env": {
"CRAZYROUTER_API_KEY": "your-api-key-here"
}
}
}
}
```
</details>
<details>
<summary><strong>Cursor</strong></summary>
编辑项目根目录下的 `.cursor/mcp.json`:
```json
{
"mcpServers": {
"crazyrouter": {
"command": "node",
"args": ["/path/to/crazyrouter-mcp/dist/index.js"],
"env": {
"CRAZYROUTER_API_KEY": "your-api-key-here"
}
}
}
}
```
</details>
<details>
<summary><strong>VS Code (Copilot)</strong></summary>
添加到 VS Code 的 `settings.json`:
```json
{
"mcp": {
"servers": {
"crazyrouter": {
"command": "node",
"args": ["/path/to/crazyrouter-mcp/dist/index.js"],
"env": {
"CRAZYROUTER_API_KEY": "your-api-key-here"
}
}
}
}
}
```
</details>
<details>
<summary><strong>Windsurf</strong></summary>
编辑 `~/.codeium/windsurf/mcp_config.json`:
```json
{
"mcpServers": {
"crazyrouter": {
"command": "node",
"args": ["/path/to/crazyrouter-mcp/dist/index.js"],
"env": {
"CRAZYROUTER_API_KEY": "your-api-key-here"
}
}
}
}
```
</details>
<details>
<summary><strong>OpenClaw</strong></summary>
添加到 OpenClaw MCP 配置:
```json
{
"mcpServers": {
"crazyrouter": {
"command": "node",
"args": ["/path/to/crazyrouter-mcp/dist/index.js"],
"env": {
"CRAZYROUTER_API_KEY": "your-api-key-here"
}
}
}
}
```
</details>
## 🛠️ 可用工具
| 工具 | 描述 | 关键参数 |
|------|-------------|----------------|
| `chat` | 与任意 AI 模型聊天 | `model`, `messages`, `temperature` |
| `list_models` | 按类别列出可用模型 | `category`(chat/image/video/audio/music) |
| `generate_image` | 使用 AI 生成图像 | `prompt`, `model`, `size` |
| `generate_video` | 使用 AI 生成视频 | `prompt`, `model` |
### 使用示例
**与任意模型聊天:**
> "使用 chat 工具询问 GPT-5 解释量子计算"
**生成图像:**
> "使用 generate_image 创建日落山景与 DALL-E 3"
**生成视频:**
> "使用 generate_video 与 Kling V2 创建 5 秒海洋波浪视频"
**发现模型:**
> "使用 list_models 显示所有可用的图像生成模型"
## 📋 支持的模型
### 💬 聊天 / 文本模型
| 提供商 | 模型 |
|----------|--------|
| OpenAI | GPT-5, GPT-5-mini, GPT-4.1, GPT-4o, o3, o4-mini |
| Anthropic | Claude Opus 4.6, Claude Sonnet 4, Claude Haiku 3.5 |
| Google | Gemini 3 Pro, Gemini 2.5 Flash, Gemini 2.0 |
| DeepSeek | DeepSeek R1, DeepSeek V3 |
| Meta | Llama 4 Scout, Llama 4 Maverick |
| Alibaba | Qwen3 235B, Qwen3 32B, Qwen3 Coder |
| xAI | Grok 4, Grok 3 |
| Mistral | Mistral Large, Codestral |
| 以及更多... | 600+ 聊天模型可用 |
### 🎨 图像生成模型
| 模型 | 描述 |
|-------|-------------|
| DALL-E 3 | OpenAI 的最新图像模型 |
| Midjourney | 行业领先的艺术图像生成 |
| Flux Pro 1.1 Ultra | Black Forest Labs 的旗舰模型 |
| Flux Kontext Pro/Max | 上下文图像生成 |
| Stable Diffusion 3.5 Large | Stability AI 的开放模型 |
| Stable Diffusion XL | 经典高质量生成 |
| Imagen 4.0 | Google 的最新图像模型 |
| Imagen 3.0 | Google 的成熟图像模型 |
### 🎬 视频生成模型
| 模型 | 描述 |
|-------|-------------|
| Sora 2 | OpenAI 的视频生成模型 |
| Kling V2 | Kuaishou 的电影视频模型 |
| Veo 3 | Google 的视频生成模型 |
| Seedance 1.5 Pro | ByteDance 的舞蹈视频模型 |
| Pika 1.5 | 创意视频生成 |
| Runway VIP | 专业视频合成 |
| MiniMax Hailuo 2.3 | MiniMax 的视频模型 |
### 🎵 音乐 & 音频模型
| 模型 | 描述 |
|-------|-------------|
| Suno Music | AI 音乐创作 |
| Suno V3 | 音乐生成模型 |
| TTS-1 / TTS-1-HD | OpenAI 文本转语音 |
| GPT-4o Mini TTS | 最新 OpenAI TTS |
| Gemini TTS | Google 文本转语音 |
| Whisper-1 | 语音转文本转录 |
> 📖 完整模型列表:[crazyrouter.com/models](https://crazyrouter.com/models?utm_source=github&utm_medium=mcp&utm_campaign=dev_community)
## 🔧 配置
### 环境变量
| 变量 | 必需 | 描述 |
|----------|----------|-------------|
| `CRAZYROUTER_API_KEY` | ✅ | 你的 Crazyrouter API 密钥 |
### API 端点
Crazyrouter **兼容 OpenAI**,意味着任何与 OpenAI 兼容的工具或库都可以直接与 Crazyrouter 配合使用,只需更改基准 URL:
```
基准 URL:https://crazyrouter.com/v1
```
此 MCP 服务器使用以下端点:
- `POST /v1/chat/completions` — 聊天补全
- `GET /v1/models` — 列出可用模型
- `POST /v1/images/generations` — 图像生成
## 🏗️ 开发
```bash
# 克隆仓库
git clone https://github.com/xujfcn/crazyrouter-mcp.git
cd crazyrouter-mcp
# 安装依赖
npm install
# 编译
npm run build
# 运行
CRAZYROUTER_API_KEY=your-key node dist/index.js
```
### 项目结构
```
crazyrouter-mcp/
├── src/
│ └── index.ts # MCP 服务器实现
├── dist/ # 编译输出
├── package.json
├── tsconfig.json
├── LICENSE
└── README.md
```
## 🤔 为什么选择 Crazyrouter?
| 功能 | Crazyrouter | 直接 API |
|---------|------------|------------|
| 可用模型 | 627+ | 1 个提供商 |
| 需要的 API 密钥 | 1 | 多个 |
| 协议支持 | OpenAI + Anthropic + Gemini | 各不相同 |
| 定价 | 低于官方价格 | 官方价格 |
| 积分过期 | 永不过期 | 各不相同 |
| 全球边缘节点 | 7 | 各不相同 |
**一个 API 密钥。所有提供商。更优惠的价格。**
👉 [在 crazyrouter.com 上开始使用](https://crazyrouter.com?utm_source=github&utm_medium=mcp&utm_campaign=dev_community)
## 📄 许可证
[MIT](LICENSE) — 随意使用。
## 🔗 链接
- 🌐 [Crazyrouter 网站](https://crazyrouter.com?utm_source=github&utm_medium=mcp&utm_campaign=dev_community)
- 📖 [API 文档](https://crazyrouter.com/docs?utm_source=github&utm_medium=mcp&utm_campaign=dev_community)
- 💬 [Discord 社区](https://discord.gg/crazyrouter)
- 🐛 [报告问题](https://github.com/xujfcn/crazyrouter-mcp/issues)
## 🌏 中文说明
### Crazyrouter MCP 服务器 — 一个 API 访问 627+ AI 模型
Crazyrouter MCP 服务器是一个标准的 MCP(模型上下文协议)服务器,让你的 AI 助手(如 Claude Desktop、Cursor、VS Code 等)通过 [Crazyrouter AI API 网关](https://crazyrouter.com?utm_source=github&utm_medium=mcp&utm_campaign=dev_community) 访问 627+ AI 模型。
**核心功能:**
- 🌐 627+ AI 模型,一个 API Key 搞定
- 🎨 图片生成(DALL-E 3, Midjourney, Flux, Stable Diffusion)
- 🎬 视频生成(Sora 2, Kling V2, Veo 3)
- 🎵 音乐生成(Suno V4)
- 💰 价格低于官方价格
- ⚡ 充值永不过期
**快速开始:**
1. 在 [crazyrouter.com](https://crazyrouter.com?utm_source=github&utm_medium=mcp&utm_campaign=dev_community) 注册获取 API Key
2. 克隆仓库并编译
3. 配置到你的 AI 客户端(Claude Desktop / Cursor / VS Code)
详细配置请参考上方英文文档。
<p align="center">
Built with ❤️ for the AI community by <a href="https://crazyrouter.com?utm_source=github&utm_medium=mcp&utm_campaign=dev_community">Crazyrouter</a>
</p>