cn-free-ai-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cn-free-ai-mcpGenerate a cyberpunk cat image"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cn-free-ai-mcp
国内直连的免费 AI 能力 MCP 服务器:文本对话、图片生成、语音识别、语音合成——四合一、零成本、clone 即用。 Zero-cost, China-accessible AI MCP server: chat, image generation, speech-to-text & text-to-speech — four free AI capabilities in one, works out of the box.
中文文档
✨ 功能特性
能力 | 工具 | 默认服务 | 费用 |
📝 文本对话 / 写作 / 翻译 / 代码 |
| 智谱 | 免费 |
🖼️ 图片生成 |
| 智谱 | 免费 |
🎙️ 语音转文字(ASR) |
| 智谱 | 免费额度 |
🔊 文字转语音(TTS) |
| 微软 Edge TTS(默认,免费) | 免费 |
全部能力实测可用:npm test 13/13 通过(含真实端到端调用)。
Related MCP server: minimax-omni
🧠 API 选型(为什么这样选)
本项目调用两个国内直连、无需科学上网的免费服务:
1. 智谱开放平台(bigmodel.cn)— 文本 / 图片 / 语音识别
选型理由:一个平台同时提供文本、图像、语音三类免费模型,API 统一(OpenAI 兼容、Bearer 认证),国内直连速度快。
Base URL:
https://open.bigmodel.cn/api免费模型(本项目默认值):
能力 | 模型编码 | 说明 |
文本对话 |
| 200K 上下文,免费 |
图片生成 |
| 图片 URL 30 天有效,免费 |
语音识别 |
|
|
认证:
Authorization: Bearer <API_KEY>,Key 在 bigmodel.cn 控制台 免费创建。接口(本项目内部调用):
POST /paas/v4/chat/completions、POST /paas/v4/images/generations、POST /paas/v4/audio/transcriptions
2. 微软 Edge TTS — 语音合成
选型理由:智谱
glm-tts收费;Edge TTS 完全免费、无需 API Key、中文音色丰富(晓晓/云希等),适合开源项目零成本落地。调用方式:npm 包
node-edge-tts(微软 Edge 在线 TTS),输出mp3。切换收费后端:
text_to_speech支持provider: "zhipu"切换回智谱glm-tts(输出 wav)。
🚀 快速开始(下载即可用)
环境要求:Node.js ≥ 18 + 一个 MCP 客户端(Claude Code / Reasonix 等)。
git clone https://github.com/<你的用户名>/cn-free-ai-mcp.git
cd cn-free-ai-mcp
npm install
cp .env.example .env # Windows: copy .env.example .env编辑 .env 填入智谱 Key(免费获取):
ZHIPU_API_KEY=你的key没有 Key 也能跑:
text_to_speech默认走免费的 Edge TTS;配置 Key 后 4 个能力全部可用。
注册 MCP(自带 .mcp.json,Claude Code 规范,Reasonix 兼容,相对路径通用):
{
"mcpServers": {
"zhipu-ai": {
"command": "node",
"args": ["./src/index.js"],
"cwd": ".",
"env": { "ZHIPU_API_KEY": "${ZHIPU_API_KEY}" }
}
}
}
${ZHIPU_API_KEY}运行时从环境变量 / 项目.env展开,密钥不写入配置文件。重启客户端后工具以mcp__zhipu-ai__<tool>暴露。
🔧 工具与调用示例
工具 | 参数 | 示例 |
|
| "帮我写一首关于秋天的诗" |
|
| "生成一张赛博朋克风格的猫" |
|
| "把 D:/录音.wav 转成文字" |
|
| "把'你好世界'念出来,保存到 D:/out.mp3" |
音色参考:Edge TTS(默认)zh-CN-XiaoxiaoNeural(晓晓)、zh-CN-YunxiNeural(云希)、en-US-AriaNeural 等;智谱(provider:"zhipu")tongtong/chuichui/xiaochen/jam/kazi/douji/luodo。
📦 项目结构
cn-free-ai-mcp/
├── .mcp.json # MCP 注册声明(相对路径,通用)
├── .env.example # 环境变量模板(复制为 .env 使用)
├── package.json
├── src/index.js # MCP server(4 个工具)
└── test/ # 测试(离线 + 真实端到端)🔒 安全设计
密钥不入库:
.env已被.gitignore忽略,配置只用${VAR}占位展开SSRF 防护:音频 URL 仅允许 https、拒绝重定向与内网/回环/链路本地地址
输入校验:本地音频限
.wav/.mp3且 ≤25MB;TTS 写盘前校验音频文件头错误净化:上游错误信息截断、折叠空白,避免回显敏感内容
无注入面:无 shell 调用、无动态执行
🧪 测试
npm test离线用例(握手、防护)无需任何 Key / 网络;检测到 .env 有真实 Key 时自动执行真实端到端用例(对话、图片生成、语音识别、Edge TTS 合成→ASR 识别闭环)。当前基线:13/13 通过,0 skip。
🤝 贡献
欢迎 Issue / PR。开发前请确保 npm test 全绿。
📄 许可证
English
✨ Features
Capability | Tool | Default service | Cost |
📝 Chat / writing / translation / code |
| Zhipu | Free |
🖼️ Image generation |
| Zhipu | Free |
🎙️ Speech-to-text (ASR) |
| Zhipu | Free quota |
🔊 Text-to-speech (TTS) |
| Microsoft Edge TTS (default, free) | Free |
All capabilities verified end-to-end: npm test 13/13 passing (including real API calls).
🧠 Why these APIs
Two China-direct, no-VPN free services:
Zhipu AI (
open.bigmodel.cn) — chat / image / ASR in one platform, OpenAI-compatible, Bearer auth. Free models:glm-4.7-flash(chat),cogview-3-flash(image),glm-asr-2512(ASR). Base URL:https://open.bigmodel.cn/api.Microsoft Edge TTS — free, no API key, rich Chinese voices (Xiaoxiao/Yunxi...), via npm
node-edge-tts. Optional paid fallback:provider: "zhipu"(Zhipuglm-tts).
🚀 Quick Start
git clone https://github.com/<you>/cn-free-ai-mcp.git
cd cn-free-ai-mcp
npm install
cp .env.example .env # fill ZHIPU_API_KEY (optional but recommended)Register the bundled .mcp.json in your MCP client (Claude Code / Reasonix), restart, and tools are exposed as mcp__zhipu-ai__<tool>. Works without a key too — TTS defaults to free Edge TTS.
🔧 Tools
chat (prompt/system/temperature/max_tokens), generate_image (prompt/size/quality), transcribe_audio (audio path or https URL), text_to_speech (text/provider/voice/output_path/speed/volume).
🔒 Security
.env git-ignored (keys never committed, ${VAR} placeholders only); SSRF-guarded (https-only, no redirects/internal IPs); input validation (.wav/.mp3 ≤25MB, TTS file-header checks); error sanitization; no shell injection surface.
🧪 Testing
npm test — offline cases need no key/network; with a real key in .env, end-to-end cases run automatically (chat, image, ASR, Edge-TTS→ASR loop). Baseline: 13/13, 0 skipped.
📄 License
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server for Qwen Image 3 AI image generation
MCP server for Hailuo (MiniMax) AI video generation
MCP server for GLM chat completions using Zhipu AI models via AceDataCloud
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceMCP server enabling AI agents to generate AI videos and images, analyze video content, and download videos from Douyin and Xiaohongshu.-
- AlicenseNot gradedqualityDmaintenanceMCP server for MiniMax's multimodal generation models, enabling text-to-speech, voice cloning, image, video, and music creation through natural language.MIT
- AlicenseNot gradedqualityCmaintenanceA production-ready MCP server that provides AI-powered image generation through multiple providers including Gemini and Jimeng AI with intelligent provider selection.MIT
- AlicenseAqualityAmaintenanceA free MCP server for generating images and videos from text or other images using Agnes AI and Zhipu free models.11205 npmMIT