A production-ready Model Context Protocol (MCP) server for ElevenLabs with universal API key support, V3 features, and clean output modes.
- Universal API Key Support: Works with both
xi-andsk-format API keys - V3 Audio Features: Full support for audio tags, multi-speaker dialogue, and emotional synthesis
- Clean Output Mode: Professional, minimal output by default (debug mode available)
- Comprehensive Testing: 69 test cases covering all functionality
- Production Ready: Enterprise-grade error handling and reliability
# Clone the repository
git clone https://github.com/bmorphism/elevenlabs-mcp-enhanced.git
cd elevenlabs-mcp-enhanced
# Install dependencies
pip install elevenlabs mcp fastmcp httpx python-dotenv- Set your API key:
export ELEVENLABS_API_KEY="your-api-key-here"- Add to Claude MCP:
claude mcp add-json elevenlabs '{"type": "stdio", "command": "python3", "args": ["path/to/server.py"], "env": {"ELEVENLABS_API_KEY": "your-key"}}' --scope userfrom server import text_to_speech
result = text_to_speech("Hello world")
# Output: Audio saved: /path/to/file.mp3 (12345 bytes)result = text_to_speech("[excited] Amazing! [whispers] Secret message [normal] Back to normal")dialogue = """
[alice] Hello there!
[bob:excited] Hi Alice, great to see you!
[alice:whispers] I have something to tell you...
"""
result = create_dialogue(dialogue)[excited]- Excited delivery[whispers]- Whispering[angry]- Angry tone[sad]- Sad delivery[laughs]- Laughter[sarcastic]- Sarcastic tone[confident]- Confident delivery[normal]- Return to normal
- Named speakers:
[alice],[bob],[narrator] - Speakers with emotions:
[alice:excited],[bob:sad] - Character variations:
[character_1],[character_2]
ELEVENLABS_API_KEY- Your ElevenLabs API key (required)ELEVENLABS_DEBUG- Set to "true" for verbose output with emojisELEVENLABS_MCP_BASE_PATH- Custom base path for output filesELEVENLABS_DEFAULT_VOICE_ID- Default voice ID to use
Normal Mode (Default):
Audio saved: /path/to/file.mp3 (37661 bytes)
Debug Mode:
โ
PATCHED TTS Success!
๐ File: /path/to/file.mp3
๐ Size: 37,661 bytes
๐ API Key: sk_58fe7... (validated)
๐ญ Model: eleven_multilingual_v2
Run the comprehensive test suite:
python3 tests.pyTest results:
- 69 total tests across 7 categories
- 100% pass rate verified
- Average response time: ~1.4 seconds
This enhanced server fixes the hardcoded API key format restrictions in the official ElevenLabs MCP server. It accepts:
xi-format keys (original format)sk-format keys (new format)- Custom format keys (length/pattern validated)
eleven_multilingual_v2- High quality, 29 languages (default)eleven_turbo_v2_5- Fast generationeleven_flash_v2_5- Ultra-fast generation
elevenlabs-mcp-enhanced/
โโโ server.py # Main patched server with authentication fix
โโโ unified_elevenlabs_mcp_server.py # Unified server with V3 enhancements
โโโ tests.py # Comprehensive test suite (69 tests)
โโโ requirements.txt # Python dependencies
โโโ README.md # This file
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details
- Built on top of the official ElevenLabs MCP server
- Enhanced with V3 features and universal API key support
- Tested with comprehensive suite of 69 test cases
The server accepts both xi- and sk- format keys. If you're getting authentication errors:
- Verify your API key at https://elevenlabs.io/app/settings/api-keys
- Ensure the environment variable is set correctly
- Try setting
ELEVENLABS_DEBUG=truefor detailed error messages
# Check server status
claude mcp list
# View configuration
claude mcp get elevenlabs
# Remove and re-add if needed
claude mcp remove elevenlabs -s user- For cleaner output: Leave
ELEVENLABS_DEBUGunset or set to "false" - For verbose output: Set
ELEVENLABS_DEBUG=true
Version: 1.0.0
Author: @bmorphism
API Key Compatibility: xi- and sk- formats
Test Coverage: 100% (69/69 tests passing)