MiMo TTS MCP Server
Integrates with Xiaomi MiMo speech synthesis models to generate audio from text using preset voices, text-described voice design, or cloned voices from local audio samples.
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., "@MiMo TTS MCP Server 用冰糖的音色生成语音:欢迎使用 MiMo TTS。"
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.
MiMo TTS MCP Server
通过 Model Context Protocol(MCP)调用小米 MiMo 语音合成模型,为 Claude Code、Codex、Cursor、Windsurf、VS Code 等 MCP 客户端提供语音合成能力。
覆盖 MiMo 三个 TTS 模型:预置音色、文本设计音色、音频样本复刻音色。
三个工具与三个模型的对应关系
工具 | 模型 | 音色来源 | 唱歌模式 |
|
| 9 个内置音色 | 支持 |
|
| 文本描述凭空生成 | 不支持 |
|
| 本地 mp3/wav 样本 | 不支持 |
| — | 返回音色/模型/配置目录,不需要 API Key | — |
Related MCP server: voice-bridge
安装
npm install
npm run buildMCP 客户端配置(stdio):
{
"mcpServers": {
"mimo-tts": {
"command": "node",
"args": ["/absolute/path/to/mimo-tts-mcp/dist/bin/mimo-tts-mcp.js"],
"env": {
"MIMO_API_KEY": "your-mimo-api-key"
}
}
}
}Claude Code 一行添加:
claude mcp add mimo-tts -s user \
-e MIMO_API_KEY=your-mimo-api-key \
-- node /absolute/path/to/mimo-tts-mcp/dist/bin/mimo-tts-mcp.jsAPI Key 在 https://platform.xiaomimimo.com/console/api-keys 创建。TTS 系列目前限时免费。
环境变量
变量 | 必填 | 默认值 | 说明 |
| 是(调用时) | — | MiMo API Key;也接受 |
| 否 |
| 改用 Token Plan 或自建网关时覆盖 |
| 否 |
| 落盘目录,同时也是写入沙箱边界。支持 |
| 否 |
| 单次请求超时 |
| 否 | 未设置 | 设为 |
list_voices 不需要 Key,在 Key 缺失时仍可用于自检配置。
工具参数
text_to_speech
参数 | 必填 | 说明 |
| 是 | 要播报的文本。可在开头加风格标签 |
| 否 | 内置音色 ID,默认 |
| 否 | 自然语言风格指令,走 |
| 否 |
|
| 否 | 输出文件路径,省略时写入 |
| 否 | 省略 |
内置音色:mimo_default、冰糖、茉莉、苏打、白桦(中文);Mia、Chloe、Milo、Dean(英文)。
design_voice_to_speech
参数 | 必填 | 说明 |
| 是 | 音色设计描述,1–4 句,覆盖性别年龄、音色质感、情绪语气、语速节奏,可选人设/场景/年代 |
| 条件 | 要播报的文本;当 |
| 否 | 让模型润色文本,或在无文本时自动生成播报稿 |
| 否 | 同上 |
clone_voice_to_speech
参数 | 必填 | 说明 |
| 是 | 要播报的文本 |
| 是 | 本地音色样本绝对路径,仅支持 |
| 否 | 同上 |
样本在每次调用时读取并转成 data:audio/...;base64,... 传给 API;文件只读不写。
安全模型
output_path 与 file_name 来自模型输出,因此按不可信输入处理:
路径限制:默认只允许写入
MIMO_TTS_OUTPUT_DIR(默认~/mimo-tts)。该变量既决定默认落盘位置,也定义沙箱边界,因此建议按项目单独设置,例如"MIMO_TTS_OUTPUT_DIR": "/path/to/project/audio"。越界路径、..穿越、以及指向目录外的符号链接子目录都会被拒绝。确实需要写任意位置时显式设置MIMO_TTS_ALLOW_ANY_PATH=1。从不覆盖:目标已存在时不覆盖,自动改用
-2、-3后缀,并用wx标志打开,因此也不会跟随已存在的符号链接写到别处。这样即使模型给出~/.bashrc这类路径,也只会新建一个同名新文件,不会破坏原文件。文件名净化:
file_name中的路径分隔符会被清除,无法借它跳出目录。样本只读:
sample_path仅用于读取,从不写入。密钥只走环境变量:代码不读取配置文件、不写入磁盘、不打印日志;错误信息中不会回显 Key。
如果你的 MCP 客户端会执行模型生成的路径,建议保持默认(不放宽 MIMO_TTS_ALLOW_ANY_PATH)。
返回值
{
"ok": true,
"model": "mimo-v2.5-tts",
"voice": "冰糖",
"file": "/home/user/mimo-tts/20261020-110928-冰糖.wav",
"format": "wav",
"bytes": 148524,
"duration_seconds": 1.55,
"sample_rate": 24000,
"streamed": true,
"latency_ms": 1830
}音频只写文件不内联 base64,避免把大 payload 灌进上下文。WAV 的 duration_seconds 由本地计算;mp3 需要逐帧解析才能精确,故不返回。若目标文件已存在,file 会带 -2 之类的后缀,这是正常行为而非错误。
实现要点
端点:
POST {baseUrl}/chat/completions,认证头api-key,OpenAI Chat Completions 兼容。消息分工:
assistant存合成文本,user存风格指令/音色描述。预置音色模型下user可省略;voicedesign 下user必填且不接受audio.voice。wav走流式路径:MiMo 仅在stream: true时输出原始pcm16,因此按 SSE 收集choices[0].delta.audio.data、丢弃尾部不足一个采样的残字节,再本地封装 44 字节 WAV 头(24 kHz / 16-bit / 单声道)。voicedesign 与 voiceclone 的流式接口目前降级为「推理完成后一次性返回」,流式拿不到音频时自动回退到非流式请求。
mp3走非流式路径,直接取choices[0].message.audio.data。
开发
npm run dev # tsx 直接跑 stdio server
npm run typecheck
npm test # vitest:请求体构造、SSE 拼帧、WAV 头、落盘路径与写入沙箱、MCP 工具契约
npm run build参考
Available Tools
4 toolsclone_voice_to_speechMiMo TTS - cloned voiceA
Synthesize speech with Xiaomi MiMo mimo-v2.5-tts-voiceclone, replicating a voice from a local mp3/wav sample. The sample is Base64-encoded and sent on every call; MiMo requires it to stay under 10 MB. Writes the audio to a file and returns its path.
Inputs: text (required), sample_path (required), format, file_name, +2 more.
design_voice_to_speechMiMo TTS - designed voiceA
Synthesize speech with Xiaomi MiMo mimo-v2.5-tts-voicedesign, inventing a brand-new voice from a text description. No preset voice and no audio sample involved. Writes the audio to a file and returns its path.
Inputs: voice_description (required), text, format, file_name, +2 more.
list_voicesMiMo TTS - catalogA
List the MiMo TTS models, their capabilities, built-in preset voices, and where files are written. Read-only; no API key needed.
Inputs: no named parameters.
text_to_speechMiMo TTS - preset voiceA
Synthesize speech with Xiaomi MiMo mimo-v2.5-tts using one of the built-in voices. Supports singing via a leading (唱歌) tag, and fine-grained audio tags inside the text. Writes the audio to a file and returns its path, byte size, and duration.
Inputs: text (required), voice, format, file_name, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
The three synthesis tools are cleanly differentiated by voice source: preset built-in voice (text_to_speech), invented voice from a description (design_voice_to_speech), and replicated voice from an audio sample (clone_voice_to_speech). list_voices is clearly read-only and metadata-focused, so there is no realistic misselection.
All three synthesis tools follow a predictable '<source>_to_speech' pattern, and the read-only tool uses the conventional 'list_<noun>' form. The convention is consistent and self-explanatory across the whole set.
Four tools is well-scoped for a TTS server: three synthesis modes plus one discovery/introspection tool. Each tool earns its place with no filler or redundancy.
The surface covers the key TTS lifecycle modes (preset, design, clone) plus model/voice discovery, which is strong for the domain. Minor gaps exist around managing generated output (e.g. listing or deleting written files), but agents can work around this via the returned file paths.
Related MCP Connectors
AI voice generation: text-to-speech and voice cloning from any MCP client.
AI text-to-speech, multi-speaker dialogues, and audiobooks over remote Streamable HTTP MCP.
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
MCP server exposing the AceDataCloud Fish Audio API (text-to-speech with voice conditioning)
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides text-to-speech conversion through a unified MCP interface, supporting both local Kokoro and cloud OpenAI TTS engines with streaming audio, voice selection, and customization via natural language instructions.7-
- AlicenseNot gradedqualityDmaintenanceMulti-engine text-to-speech for AI coding assistants. Speaks responses aloud from Claude Code, Cursor, or VS Code via a Claude Code plugin, MCP server, or CLI pipe.87 PyPIMIT
- AlicenseAqualityBmaintenanceText to speech in 149 languages: MP3 links from any assistant. Free without an account. 2,253 voices; PRO adds HD voices, WAV, dialogue with a voice per speaker, Script mode timing and transcription.741 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables local voice cloning and multi-take text-to-speech synthesis on Apple Silicon, plus audio/video transcription and subtitle generation, through Claude and other MCP clients.2MIT