ElevenLabs播客MCP服务器
模型上下文协议(MCP)服务器,用于使用ElevenLabs v3 Text-to-Speech API生成专业播客,并支持音频标签。
🎯 主要特点
- 🎙️ 多人对话 有自然的中断和重叠的语音
- 🏷️ 音频标签 情绪控制
[excited],交货[whispers],以及效果[laughs] - ⏱️ 智能持续时间控制 -内容感知,最多10分钟
- 🎨 多种播客风格 -访谈、叙事、讨论、教育、喜剧
- 🎭 音调预设 -专业、随意、兴奋、冷静、戏剧性
- 🌍 70+语言支持 具有一致的语音质量
- 📝 AI脚本生成 带有音频标签
- 🔄 批量处理 对于长篇内容
- 🔊 高品质音频 输出(最高192kbps MP3)
- 🚀 内置于 FastMCP 便于集成
📦 安装
- 克隆存储库:
git clone
cd elevenlabs-podcast-mcp- 安装依赖项:
pip install -r requirements.txt- 设置环境变量:
cp .env.example .env
# Edit .env and add your ElevenLabs API key🚀 快速开始
运行服务器
开发模式:
fastmcp dev server.py生产方式:
fastmcp run server.py --transport sse🛠️ 可用工具
核心工具
generate_podcast
使用音频标签、可配置的风格和音调生成完整的播客。
{
"script": "Host: [excitedly] Welcome! Guest: [thoughtfully] Great to be here!",
"style": "interview", # interview, narrative, discussion, educational, comedy
"tone": "professional", # professional, casual, excited, calm, dramatic
"duration_minutes": null, # Auto-calculates based on content (max 10 min)
"auto_duration": true,
"voice_mapping": {"Host": "voice_id_1", "Guest": "voice_id_2"},
"output_path": "output/episode.mp3"
}generate_script
使用音频标签生成AI驱动的脚本。
{
"topic": "Artificial Intelligence",
"style": "interview",
"duration_minutes": 5,
"include_tags": true # Includes Audio Tags for emotions
}输出示例:
Host: [excitedly] Welcome to Tech Talks! Today we're exploring AI.
Guest: [thoughtfully] This technology is transforming everything.
Host: [interrupting] —That's exactly what our listeners want to know!generate_long_podcast
使用自动批处理(>3000个字符)处理长格式内容。
{
"script": "Very long podcast script...",
"style": "narrative",
"tone": "dramatic",
"output_path": "output/long_episode.mp3"
}preview_podcast
快速预览生成,用于测试语音和音调。
{
"text": "[whispers] Testing the preview feature",
"voice_id": "21m00Tcm4TlvDq8ikWAM",
"tone": "dramatic"
}语音管理
list_voices
列出ElevenLabs帐户中的所有可用语音。
实用工具
create_podcast_project
创建结构化项目目录。
{
"project_name": "MyPodcast",
"description": "Weekly tech discussions"
}🏷️ 音频标签参考
音频标签被包裹在方括号中,用于控制语音性能:
情感
[excited],[happy],[sad],[angry],[thoughtfully],[nervously]
交付
[whispers],[shouts],[quietly],[loudly][pause],[stammers],[rushed]
反应
[laughs],[sighs],[gasps],[clears throat],[chuckles]
对话动态
[interrupting],[overlapping],[jumping in]
口音
[British accent],[French accent],[Australian accent]
带有音频标签的示例脚本
Host: [excitedly] Welcome to our show! [pause] Today's topic is fascinating.
Guest: [thoughtfully] Indeed. [sighs] Let me explain why...
Host: [interrupting] —Actually, that reminds me of something!
Guest: [laughs] You always do that! [continuing] As I was saying...
Host: [whispers] Sorry, go ahead.
Guest: [normal voice] The key point is... [dramatically] Everything changes now!🎨 播客风格
面试
专业问答形式,包含主人和客人动态。
叙述
带有戏剧性元素的故事讲述格式。
讨论
多人圆桌会议,自然中断。
教育的
清晰、结构化的学习内容。
喜剧
幽默的表达,带有时间感和讽刺意味。
🎭 音调预设
每个音调都会调整语音参数:
- 专业的:平衡、清晰的交付(稳定性:0.7)
- 随意:放松、健谈(稳定性:0.4)
- 兴奋:高能量,热情(稳定性:0.3)
- 平静:舒缓,测量速度(稳定性:0.8)
- 戏剧性的:戏剧性,表现力强(稳定性:0.5)
📚 可用资源
voices://presets-预设语音配置config://settings-服务器配置templates://podcast-scripts-带有音频标签的脚本模板
💡 使用示例
带情感的简单播客
client.call_tool("generate_podcast", {
"script": "Host: [excitedly] Breaking news everyone!",
"style": "interview",
"tone": "excited"
})带中断的多扬声器
script = """
Host: [starting] So the main issue is—
Guest: [interrupting] —Actually, I disagree!
Host: [surprised] Oh? Tell me more.
Guest: [explaining] Well, when you consider...
"""
client.call_tool("generate_podcast", {
"script": script,
"style": "discussion"
})自动生成的脚本
# First generate the script
script = client.call_tool("generate_script", {
"topic": "Space Exploration",
"style": "narrative",
"include_tags": true
})
# Then create the podcast
client.call_tool("generate_podcast", {
"script": script,
"auto_duration": true
})⚙️ 配置
环境变量
ELEVENLABS_API_KEY=your_api_key_here
ELEVENLABS_MODEL=eleven_v3 # ALWAYS use v3 for Audio Tags
MAX_DURATION_MINUTES=10
DEFAULT_SPEAKING_RATE=150语音默认值
- 主持人:瑞秋(21m00Tcm4TlvDq8ikWAM)
- 嘉宾:德鲁(29vD33N1CtxCmqQRPOHJ)
- 旁白:贝拉(EXAVITQu4vr4xnSDxMaL)
🔧 发展
项目结构
elevenlabs-podcast-mcp/
├── server.py # Main MCP server with all tools
├── requirements.txt # Python dependencies
├── .env.example # Environment template
├── CLAUDE.md # AI context documentation
├── README.md # This file
└── ai-docs/ # Additional documentation添加自定义工具
@mcp.tool
async def your_custom_tool(param: str) -> Dict:
"""Your tool description."""
# Implementation
return {"result": "success"}测试
# Inspect available tools
fastmcp inspect server.py
# Test specific tool
fastmcp dev server.py📋 需求
- Python 3.11+
- ElevenLabs API密钥(需要v3访问权限)
- FastMCP框架
- pydub(用于音频处理)
⚠️ 重要提示
- 始终使用
eleven_v3模型 音频标签支持 - 字符限制:每个请求3000(较长内容的自动批处理)
- 专业语音克隆(PVC) 尚未完全针对v3进行优化
- 推荐:使用即时语音克隆(IVC)或设计语音
🐛 故障排除
速率限制
服务器包括指数回退的自动重试。
长内容
使用 generate_long_podcast 对于长度超过3000个字符的内容。
音频标签不工作
确保您正在使用 eleven_v3 模型,不是 eleven_turbo_v2_5.
📄 许可证
麻省理工学院
💬 支持
对于问题或疑问,请打开GitHub问题。
