使用说明
Chatterbox TTS MCP服务器
一个FastMCP服务器,它公开 聊天盒TTS 从笔记本电脑上的Claude Code连接,在配备GPU的台式机上生成语音。
特性
- 文本转语音:具有多种模型的高质量语音合成
- 语音克隆:使用5-15秒的参考音频克隆任何语音
- 语音管理:按名称保存、列出和重用语音引用
- 长文本支持:超过40秒的文本自动分块
- 远程访问:从网络上的任何机器生成语音
- 下载URL:通过HTTP获取生成的音频
模型
| 型号 | 语言 | 功能 |
|---|---|---|
standard |
英文 | CFG权重,夸张控制,零样本克隆 |
turbo |
英语 | 快速生成,副语言标签,需要语音 |
安装
# Clone the repo
git clone https://github.com/yourusername/chatterbox-mcp.git
cd chatterbox-mcp
# Install dependencies
pip install -r requirements.txt
# Install wsproto for websocket support (no deprecation warnings)
pip install wsproto
配置
编辑 server.py 设置您的路径:
OUTPUT_DIR = Path(r"C:\path\to\output")
VOICES_DIR = Path(r"C:\path\to\voices")
用法
启动服务器
python server.py
# or
run_server.bat
从克劳德代码连接
添加到MCP配置(~/.claude/settings.json 或 .claude/settings.json):
{
"mcpServers": {
"chatterbox": {
"type": "url",
"url": "http://<your-pc-ip>:8765/mcp"
}
}
}
工具
text_to_speech
从文本生成语音。
# Basic TTS
text_to_speech(text="Hello, world!")
# With voice cloning
text_to_speech(text="Hello", voice_name="david")
# Turbo with paralinguistic tags
text_to_speech(text="That's hilarious! [laugh]", model="turbo", voice_name="david")
# Expressive/dramatic
text_to_speech(text="...", exaggeration=0.7, cfg_weight=0.3)
list_voices
列出所有已保存的语音参考。
delete_voice
删除已保存的语音参考。
提示
- 默认设置 (
exaggeration=0.5,cfg_weight=0.5)适用于大多数提示 - 快速扬声器:较低
cfg_weight调整至~0.3,以获得更好的起搏效果 - 表达性演讲:使用
exaggeration=0.7,cfg_weight=0.3 - 语音克隆:使用5-15秒的干净语音,背景噪音最小
- 长文本:自动分割成块-无需手动分割
需求
- Python 3.10+
- 支持CUDA的GPU(推荐)
- 标准型号约4GB VRAM
许可证
麻省理工学院