Edge-TTS MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Edge-TTS MCP Server
中文文档 | English Documentation
基于 Microsoft Edge TTS 服务的 MCP (Model Context Protocol) 服务器,提供文本转语音功能。
Claude Code MCP Configuration
Add the following MCP server configuration to your Claude Code settings:
{
"mcpServers": {
"edge-tts": {
"command": "python",
"args": [
"/absolute/path/to/edge-tts/main.py"
],
"env": {
"PYTHONPATH": "/absolute/path/to/edge-tts/src"
}
}
}
}Configuration Example (modify with your actual path):
{
"mcpServers": {
"edge-tts": {
"command": "python",
"args": [
"/Users/ymr/github/edge-tts/main.py"
],
"env": {
"PYTHONPATH": "/Users/ymr/github/edge-tts/src"
}
}
}
}Windows Configuration:
{
"mcpServers": {
"edge-tts": {
"command": "python",
"args": [
"C:\\path\\to\\edge-tts\\main.py"
],
"env": {
"PYTHONPATH": "C:\\path\\to\\edge-tts\\src"
}
}
}
}Using Virtual Environment (recommended):
{
"mcpServers": {
"edge-tts": {
"command": "/path/to/venv/bin/python",
"args": [
"/path/to/edge-tts/main.py"
]
}
}
}Configuration File Example: The project root provides claude-mcp-config.json with a complete configuration example.
Configuration Details
command: Path to Python interpreter
args: Path to main program file
env: Environment variables to ensure Python can find source code
disabled: Whether to disable this server (default false)
autoStart: Whether to auto-start (default true)
Configuration Location
Claude Code MCP configuration file is typically located at:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Add the configuration to the mcpServers section of the file.
Related MCP server: edge-tts
功能特性
✅ 文本转语音(支持多种语言和语音)
✅ 语音列表查询(支持按语言、性别过滤)
✅ 音频文件保存
✅ 语音详细信息查询
✅ 字幕生成(SRT格式)
✅ 完整的 MCP 协议支持
✅ 严格的参数验证
✅ 详细的错误处理
安装依赖
pip install -r requirements.txt启动服务器
# 方式1: 使用主脚本
python main.py
# 方式2: 直接运行服务器
python -m src.server工具列表
1. text_to_speech
将文本转换为语音音频
参数:
text: 要转换的文本内容(必填)voice: 语音名称(默认: en-US-EmmaMultilingualNeural)rate: 语速调整(默认: +0%)volume: 音量调整(默认: +0%)pitch: 音调调整(默认: +0Hz)boundary: 边界类型(默认: SentenceBoundary)format: 输出格式(默认: mp3)
2. list_voices
查询可用的语音列表
参数:
locale: 语言区域过滤gender: 性别过滤(Male/Female)name_pattern: 名称模式匹配
3. save_audio
将音频数据保存到文件
参数:
audio_data: base64编码的音频数据(必填)filename: 保存的文件名(必填)format: 文件格式(默认: mp3)
4. get_voice_info
获取特定语音的详细信息
参数:
voice_name: 语音名称(必填)
5. generate_subtitles
生成语音的字幕文件
参数:
text: 文本内容(必填)voice: 语音名称(默认: en-US-EmmaMultilingualNeural)subtitle_format: 字幕格式(默认: srt)boundary_type: 边界类型(默认: SentenceBoundary)
使用示例
命令行测试
# 查询中文语音列表
curl -X POST http://localhost:8000/tools/call \
-H "Content-Type: application/json" \
-d '{
"name": "list_voices",
"arguments": {
"locale": "zh-CN"
}
}'
# 文本转语音
curl -X POST http://localhost:8000/tools/call \
-H "Content-Type: application/json" \
-d '{
"name": "text_to_speech",
"arguments": {
"text": "你好,世界!",
"voice": "zh-CN-XiaoxiaoNeural"
}
}'Python 客户端示例
import asyncio
import aiohttp
import json
async def test_tts():
async with aiohttp.ClientSession() as session:
# 文本转语音
payload = {
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "text_to_speech",
"arguments": {
"text": "Hello, world!",
"voice": "en-US-JennyNeural"
}
}
}
async with session.post("http://localhost:8000", json=payload) as response:
result = await response.json()
print(json.dumps(result, indent=2))
asyncio.run(test_tts())错误代码
1001: 验证错误1002: 语音不存在1003: 参数错误1004: 网络错误1005: 音频生成错误
配置说明
编辑 config/server_config.yaml 文件进行配置:
server:
host: localhost
port: 8000
log_level: INFO
defaults:
voice: en-US-EmmaMultilingualNeural
rate: +0%
volume: +0%
pitch: +0Hz支持的语音
支持 85 种语言的 585 个不同语音,包括:
中文:
zh-CN-XiaoxiaoNeural,zh-CN-YunyangNeural英文:
en-US-JennyNeural,en-US-EmmaMultilingualNeural日文:
ja-JP-NanamiNeural韩文:
ko-KR-SunHiNeural
使用 list_voices 工具查看完整列表。
开发说明
项目结构:
edge-tts-mcp-server/
├── src/
│ ├── __init__.py
│ ├── server.py # MCP Server 主文件
│ ├── tools.py # 工具实现
│ ├── models.py # 数据模型
│ └── utils.py # 工具函数
├── config/
│ └── server_config.yaml # 服务器配置
├── requirements.txt # 依赖文件
├── README.md
└── main.py # 启动脚本许可证
MIT License
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for Text-to-Speech
Hosted text-to-speech MCP server: 66 voices in 9 languages, long-form narration, podcasts.
MCP server exposing the AceDataCloud Fish Audio API (text-to-speech with voice conditioning)
AI voice generation: text-to-speech and voice cloning from any MCP client.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server that provides text-to-speech functionality for AI agents using Microsoft Edge's text-to-speech technology, supporting multiple voices, languages, and voice customization.28MIT
- AlicenseBqualityDmaintenanceAn MCP server integrated with Microsoft Edge's high-quality speech synthesis capabilities, supporting multilingual speech generation, audio merging, and cloud storage.12Apache 2.0
- AlicenseAqualityDmaintenanceA cross-platform MCP server that enables Claude to speak using Microsoft Edge TTS with support for over 300 voices across 50+ languages. It requires no API keys and allows for customization of speech rate, volume, and pitch.333 PyPI1MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that converts text into lifelike speech using Microsoft Edge's Text-to-Speech service, supporting customizable voice, rate, volume, and pitch.4MIT