ElevenLabs MCP Server
An MCP server that provides text-to-speech, speech-to-text, and voice management via ElevenLabs API.
README
ElevenLabs MCP Server
Streamable HTTP MCP server for ElevenLabs — text-to-speech, speech-to-text, and voice management.
Author: overment
[!WARNING] You connect this server to your MCP client at your own responsibility. Language models can make mistakes, misinterpret instructions, or perform unintended actions. Review tool outputs and verify results before using generated audio or transcripts in production.
Features
- ✅ Text to Speech — Convert text to audio using any ElevenLabs voice
- ✅ Speech to Text — Transcribe audio/video files with Scribe models
- ✅ Voice Management — List and inspect available voices
- ✅ Transcript Management — Retrieve and delete transcripts
- ✅ Dual Runtime — Node.js/Bun or Cloudflare Workers
- ✅ Multiple Input Methods — File URLs or base64-encoded data
Design Principles
- LLM-friendly: Tools have clear descriptions and structured outputs
- Flexible input: Speech-to-text accepts both file URLs and base64 data
- Rich output: TTS returns base64 audio; STT returns text with metadata
Installation
Prerequisites: Bun, Node.js 20+, ElevenLabs account.
cd elevenlabs-mcp
bun install
Configuration
Create a .env file with your ElevenLabs API key from ElevenLabs Settings:
PORT=3000
AUTH_STRATEGY=api_key
API_KEY=xi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
API_KEY_HEADER=xi-api-key
ELEVENLABS_API_KEY=xi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Note:
ELEVENLABS_API_KEYis used by the tools to authenticate with the ElevenLabs API. TheAPI_KEY/API_KEY_HEADERpair is used to protect the MCP endpoint itself.
Start
bun dev
# MCP: http://127.0.0.1:3000/mcp
Client Configuration
MCP Inspector (quick test):
bunx @modelcontextprotocol/inspector
# Connect to: http://localhost:3000/mcp
Claude Desktop / Cursor:
{
"mcpServers": {
"elevenlabs": {
"command": "bunx",
"args": [
"mcp-remote",
"http://localhost:3000/mcp",
"--header",
"x-api-key: ${ELEVENLABS_API_KEY}"
]
}
}
}
Tools
list_voices
List all available ElevenLabs voices. Call this first to discover voice IDs.
// Input
{}
// Output
{
count: number;
voices: Array<{
voice_id: string;
name: string;
category: string;
labels: Record<string, string>;
preview_url: string | null;
}>;
}
text_to_speech
Convert text into speech audio. Returns base64-encoded audio data.
// Input
{
text: string; // Required — text to convert
voice_id: string; // Required — from list_voices
model_id?: string; // Default: eleven_multilingual_v2
output_format?: string; // Default: mp3_44100_128
language_code?: string; // ISO 639-1 code
voice_settings?: {
stability?: number; // 0-1
similarity_boost?: number; // 0-1
speed?: number; // 0.1-3.0
style?: number; // 0-1
};
}
// Output: base64-encoded audio as a data URI resource
speech_to_text
Transcribe an audio or video file. Accepts either a URL or base64 data.
// Input
{
file_url?: string; // HTTPS URL of the file
file_base64?: string; // Base64-encoded file content
file_name?: string; // Filename when using base64
model_id?: string; // scribe_v1 (default) or scribe_v2
language_code?: string; // ISO 639-1/3 code (auto-detect if omitted)
diarize?: boolean; // Identify speakers
num_speakers?: number; // Expected speaker count (1-32)
tag_audio_events?: boolean; // Tag (laughter), (footsteps), etc.
timestamps_granularity?: string; // none, word, character
}
// Output
{
text: string;
language_code: string;
language_probability: number;
transcription_id: string | null;
}
get_voice
Get detailed metadata about a specific voice.
// Input
{ voice_id: string }
// Output: voice details including name, category, labels, settings, preview_url
get_transcript
Retrieve a previously generated transcript by ID.
// Input
{ transcription_id: string }
// Output: full transcript text with language and word count
delete_transcript
Delete a previously generated transcript.
// Input
{ transcription_id: string }
// Output: deletion confirmation
Examples
1. Generate speech from text
// First, find a voice
{ "name": "list_voices", "arguments": {} }
// Then generate audio
{
"name": "text_to_speech",
"arguments": {
"text": "Hello, this is a test of the ElevenLabs text to speech system.",
"voice_id": "JBFqnCBsd6RMkjVDRZzb",
"output_format": "mp3_44100_128"
}
}
2. Transcribe an audio file from URL
{
"name": "speech_to_text",
"arguments": {
"file_url": "https://example.com/recording.mp3",
"diarize": true,
"language_code": "en"
}
}
3. Transcribe with speaker identification
{
"name": "speech_to_text",
"arguments": {
"file_url": "https://example.com/meeting.mp3",
"diarize": true,
"num_speakers": 3,
"tag_audio_events": true
}
}
HTTP Endpoints
| Endpoint | Method | Purpose |
|---|---|---|
/mcp |
POST | MCP JSON-RPC 2.0 |
/mcp |
GET | SSE stream (Node.js only) |
/health |
GET | Health check |
Development
bun dev # Start with hot reload
bun run typecheck # TypeScript check
bun run lint # Lint code
bun run build # Production build
bun start # Run production
Architecture
src/
├── shared/
│ └── tools/
│ └── elevenlabs/ # ElevenLabs tool definitions
│ ├── api.ts # Shared API helpers
│ ├── text-to-speech.ts
│ ├── speech-to-text.ts
│ ├── list-voices.ts
│ ├── get-voice.ts
│ ├── get-transcript.ts
│ └── delete-transcript.ts
├── config/
│ ├── env.ts # Environment config
│ └── metadata.ts # Tool & server metadata
├── core/
│ ├── capabilities.ts # MCP capabilities
│ ├── context.ts # Request context
│ └── mcp.ts # MCP server builder
├── http/
│ ├── app.ts # Hono HTTP app
│ ├── middlewares/ # Auth, CORS
│ └── routes/ # Health, MCP
├── index.ts # Node.js entry
└── worker.ts # Workers entry
Troubleshooting
| Issue | Solution |
|---|---|
| "Missing ElevenLabs API key" | Set ELEVENLABS_API_KEY in .env or configure auth headers |
| "Rate limit exceeded" | ElevenLabs has per-plan rate limits. Wait and retry. |
| Empty audio response | Verify voice_id exists using list_voices |
| Transcription fails | Ensure file URL is accessible or base64 is valid |
| 422 Validation Error | Check input parameters match the API spec |
License
MIT
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。