Bailian Voice Clone MCP
Enables voice cloning and speech synthesis through Alibaba Cloud's Bailian and DashScope platforms. It provides tools to create, manage, and synthesize audio using custom cloned voice profiles.
README
Bailian Voice Clone MCP
一个可部署到阿里云 Function AI 的 stdio MCP,用于:
- 创建声音克隆
- 轮询音色状态
- 查询单个音色
- 列出音色
- 删除音色
- 用复刻音色做语音合成
本地启动
- 安装依赖
Path B:部署到阿里云 Function AI
1. 准备代码仓库
把这个目录推到 GitHub 或阿里云 Codeup:
server.pyrequirements.txt.env.exampleREADME.md
2. 在 Function AI 创建 MCP 服务
- 登录 Function AI 控制台
- 创建空白项目
- 新建服务,选择
MCP 服务 - 传输类型选择
SSE - 开启鉴权
- 运行环境选择
Python - 绑定你的代码仓库
3. 配置构建和启动
建议值:
- 构建命令:
pip install -t . -r requirements.txt - 启动命令:
python server.py
资源建议:
- vCPU:1
- 内存:2 GB
- 弹性策略:
极速模式 - 预置快照:
1 - 实例上限:
1
4. 配置环境变量
在 Function AI 的变量管理里新增:
DASHSCOPE_API_KEYDASHSCOPE_REGION=cn-beijingBAILIAN_TTS_MODEL=cosyvoice-v3.5-plusINLINE_AUDIO_BASE64_LIMIT=300000
5. 部署并测试
部署成功后,Function AI 会给你一个公网 SSE 地址,通常是:
https://xxxx.cn-beijing.fcapp.run/sse
先在 Function AI 控制台直接测试工具是否可用。
注册到百炼 MCP 管理
- 打开百炼控制台 -> MCP 管理 -> 自定义服务
- 点击
+创建 MCP 服务 - 选择
使用脚本部署 - 安装方式选
http - 填入你的 SSE 地址
配置示例:
{
"mcpServers": {
"voice-clone-mcp": {
"url": "https://xxxx.cn-beijing.fcapp.run/sse"
}
}
}
使用顺序建议
- 调
create_voice_clone - 调
wait_for_voice_ready - 状态变成
OK后,调synthesize_with_cloned_voice
示例参数
创建声音克隆
{
"audio_url": "https://your-public-audio-url/sample.wav",
"prefix": "myvoice01",
"language_hint": "zh",
"target_model": "cosyvoice-v3.5-plus",
"region": "cn-beijing"
}
合成语音
{
"text": "你好,这是一段使用复刻音色生成的演示语音。",
"voice_id": "cosyvoice-v3.5-plus-myvoice01-xxxxxxxx",
"target_model": "cosyvoice-v3.5-plus",
"region": "cn-beijing",
"inline_base64": true
}
注意事项
- 声音克隆和声音合成用的
target_model必须一致,否则合成会失败 audio_url必须公网可访问prefix建议只用小写字母、数字、下划线,长度不超过 10synthesize_with_cloned_voice默认会把音频落到临时目录;在云端想长期保存,下一步建议接 OSS
Local Recording Support
The MCP now supports two additional tools for local recordings:
create_qwen_voice_clone_from_audio_base64create_qwen_voice_clone_from_local_filecreate_qwen_voice_clone_from_video_url_segmentcreate_qwen_voice_clone_from_local_video_segment
How to choose:
- If you deploy the MCP to Function AI / Bailian, use
create_qwen_voice_clone_from_audio_base64. This is the remote-friendly path because you can pass audio as base64 or a full Data URL. - If you run the MCP locally with
stdio, usecreate_qwen_voice_clone_from_local_file. - If the voice is inside a video, use one of the video segment tools and specify the exact start/end time of the speaker you want to clone.
Important:
CosyVoiceclone tools still require a publicaudio_url.- Direct local-file clone support is implemented with
Qwen3 TTS VC, because the official Qwen voice enrollment API supportsaudio.datawhile the CosyVoice clone API is documented around public URL input.
Example for remote base64 mode:
{
"audio_base64_or_data_url": "data:audio/wav;base64,AAA...",
"preferred_name": "demo_voice_01",
"audio_mime_type": "audio/wav",
"target_model": "qwen3-tts-vc-2026-01-22",
"region": "cn-beijing"
}
Example for local file mode:
{
"local_file_path": "C:\\Users\\29932\\Desktop\\sample.wav",
"preferred_name": "demo_voice_01",
"target_model": "qwen3-tts-vc-2026-01-22",
"region": "cn-beijing"
}
Example for video URL mode:
{
"video_url": "https://your-public-video-url/demo.mp4",
"preferred_name": "demo_voice_01",
"start_time": "00:01:15",
"end_time": "00:01:42",
"speech_enhancement": false,
"target_model": "qwen3-tts-vc-2026-01-22",
"region": "cn-beijing"
}
Example for local video mode:
{
"local_video_path": "C:\\Users\\29932\\Desktop\\demo.mp4",
"preferred_name": "demo_voice_01",
"start_time": "75",
"end_time": "102",
"speech_enhancement": false,
"target_model": "qwen3-tts-vc-2026-01-22",
"region": "cn-beijing"
}
Video notes:
start_timeandend_timesupportsecondsorHH:MM:SS[.ms]- Video extraction now keeps
24000 Hzmono WAV by default to preserve more timbre detail for cloning speech_enhancement=falseis now the safer default when similarity matters most- Turn
speech_enhancement=trueon only when the source clip is noisy enough that intelligibility matters more than timbre fidelity - For best cloning quality, choose a
10-20ssegment where the target speaker is clear, continuous, and background music is as weak as possible
Workflow By Clone Type
Use different follow-up steps for the two API families in this MCP:
-
create_voice_clone: This is the CosyVoicevoice-enrollmentflow. It is asynchronous. After creation, callwait_for_voice_readyorquery_voice, then callsynthesize_with_cloned_voice. -
create_qwen_voice_clone_from_audio_base64 -
create_qwen_voice_clone_from_local_file -
create_qwen_voice_clone_from_video_url_segment -
create_qwen_voice_clone_from_local_video_segmentThese are Qwen voice clone flows. They are ready for synthesis immediately after the create call returns success. Do not callquery_voice,wait_for_voice_ready,list_voices, ordelete_voicewith a Qwen voice id such asqwen-tts-vc-.... Callsynthesize_with_cloned_voicedirectly with the returnedvoice_idandtarget_model.
Qwen follow-up example:
{
"text": "时光如白驹过隙,转瞬即逝。",
"voice_id": "qwen-tts-vc-demo_voice_01-voice-20260323xxxx",
"target_model": "qwen3-tts-vc-2026-01-22",
"region": "cn-beijing",
"inline_base64": true
}
LobeHub HTTP Mode
LobeHub expects Streamable HTTP, not SSE.
This project now supports both transports:
MCP_TRANSPORT=stdioFor local stdio use or Function AI MCP proxy mode.MCP_TRANSPORT=streamable-httpFor direct LobeHub integration.
Recommended environment variables for direct LobeHub deployment:
MCP_TRANSPORT=streamable-http
MCP_HOST=0.0.0.0
MCP_PORT=8080
Startup command for HTTP mode:
python server.py
LobeHub example config:
{
"mcpServers": {
"voice-clone-mcp": {
"url": "https://your-domain.example.com/mcp",
"type": "streamable-http",
"headers": {
"Authorization": "Bearer YOUR_TOKEN"
}
}
}
}
Important:
- For LobeHub, use the
/mcpHTTP URL of the deployed service, not the old/sseURL. - If you deploy this mode to Function AI, use a normal HTTP/Web service style deployment that exposes port
8080.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。