A Model Context Protocol (MCP) server for AllTalk TTS, providing full-featured text-to-speech with RVC voice conversion, narrator mode, and advanced audio generation capabilities.
- Full AllTalk API Support: All parameters from SillyTavern's AllTalk integration
- RVC Voice Conversion: Real-Time Voice Cloning with GPU acceleration
- Narrator Mode: Separate voices for character dialogue and narration
- Multiple Output Formats: WAV audio with configurable parameters
- Performance Optimizations: DeepSpeed and Low VRAM modes
- Cross-platform Audio Playback: Automatic audio playback after generation
-
AllTalk TTS Server: Running locally or remotely
- Default:
http://localhost:7851 - AllTalk GitHub
- Default:
-
Python 3.8+ with virtual environment support
-
Audio System: PulseAudio, ALSA, or compatible audio backend
git clone https://github.com/yourusername/alltalk-tts-mcp.git
cd alltalk-tts-mcp# Install uv if not already installed
curl -LsSf https://astral.sh/uv/install.sh | sh
# Or using pip: pip install uv
# Create virtual environment and install dependencies
uv syncpython -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txtCreate a .env file or set environment variables:
# Required: AllTalk server URL
export ALLTALK_URL="http://localhost:7851"
# Optional: Audio playback settings
export PULSE_SERVER="unix:/run/user/$(id -u)/pulse/native"
export XDG_RUNTIME_DIR="/run/user/$(id -u)"{
"mcpServers": {
"alltalk-tts": {
"command": "/path/to/alltalk-tts-mcp/.venv/bin/python",
"args": ["/path/to/alltalk-tts-mcp/server.py", "--transport", "stdio"],
"env": {
"ALLTALK_URL": "http://localhost:7851",
"PULSE_SERVER": "unix:/run/user/1000/pulse/native",
"XDG_RUNTIME_DIR": "/run/user/1000"
}
}
}
}{
"mcp": {
"alltalk-tts": {
"type": "local",
"command": [
"/path/to/alltalk-tts-mcp/.venv/bin/python",
"/path/to/alltalk-tts-mcp/server.py",
"--transport",
"stdio"
],
"environment": {
"ALLTALK_URL": "http://localhost:7851",
"PULSE_SERVER": "unix:/run/user/1000/pulse/native",
"XDG_RUNTIME_DIR": "/run/user/1000"
},
"enabled": true
}
}
}generate_tts- Full-featured TTS with all parametersquick_tts- Simplified TTS with RVCgenerate_with_rvc- TTS with RVC voice conversiongenerate_narrator- TTS with narrator modestream_tts- Real-time streaming TTS (no RVC/narrator)
list_voices- List available TTS voiceslist_rvc_voices- List available RVC modelsget_current_settings- Get current AllTalk configurationswitch_model- Switch TTS modelset_deepspeed- Enable/disable DeepSpeed optimizationset_low_vram- Enable/disable Low VRAM mode
# List available voices
alltalk-tts_list_voices
# Generate TTS with RVC
alltalk-tts_generate_tts \
--text_input "Hello, this is a test" \
--character_voice_gen "female_01.wav" \
--rvccharacter_voice_gen "" \
--autoplay true
# Quick TTS generation
alltalk-tts_quick_tts \
--text "Quick test" \
--voice "male_01.wav" \
--rvc_model "eminem/eminem-new-era-v2-48k.pth"# Using the MCP tools in Claude
voices = alltalk_tts.list_voices()
print(voices)
# Generate TTS with specific parameters
result = alltalk_tts.generate_tts(
text_input="Hello from Claude!",
character_voice_gen="female_01.wav",
narrator_enabled=True,
narrator_voice_gen="male_01.wav",
rvccharacter_voice_gen="",
speed=1.2,
pitch=2
)
print(f"Generated: {result}")result = alltalk_tts.generate_narrator(
text="\"Hello,\" said the character. The narrator continued the story.",
character_text="Hello,",
character_voice="female_01.wav",
narrator_voice="male_01.wav",
language="auto"
)text_input(required): Text to synthesizecharacter_voice_gen: Voice file for character (default: "female_01.wav")narrator_enabled: Enable narrator mode (default: false)narrator_voice_gen: Voice for narrator (default: "male_01.wav")rvccharacter_voice_gen: RVC model for character voice (default: "")rvccharacter_pitch: Pitch shift for RVC (-24 to 24, default: 0)language: Language code or "auto" (default: "auto")speed: Speech speed (0.25-2.0, default: 1.0)pitch: Voice pitch adjustment (-10 to 10, default: 0)temperature: Sampling temperature (0.1-1.0, default: 0.8)autoplay: Auto-play after generation (default: true)
-
No sound after generation: Check audio system and permissions
# Test audio system paplay --version # Check PulseAudio socket ls -la /run/user/$(id -u)/pulse/
-
Permission errors: Ensure user has access to audio system
groups | grep audio sudo usermod -a -G audio $USER
-
AllTalk server not responding: Verify server is running
curl http://localhost:7851/api/voices
-
GPU not utilized: Check RVC parameters and GPU drivers
nvidia-smi # For NVIDIA GPUs
- Tools not appearing: Check MCP configuration file syntax
- Connection errors: Verify Python path and virtual environment
- Timeout errors: Increase timeout in MCP client configuration
To create your own custom configuration:
-
Clone the repository:
git clone https://github.com/bpawnzZ/alltalk-tts-mcp.git cd alltalk-tts-mcp -
Set up environment:
uv sync # or use pip: python -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt -
Configure for your system:
- Edit
server.pyto change default values (voice, RVC model, etc.) - Set environment variables for your AllTalk server URL
- Update MCP client configuration with your specific paths
- Edit
-
Common customizations:
- Change
ALLTALK_URLto your server address - Modify default voice in
server.pyparameters - Set your preferred RVC model
- Adjust audio playback settings for your system
- Change
# Test server directly
python server.py --help
# Test with stdio transport (for MCP clients)
python server.py --transport stdio
# Test with SSE transport (for HTTP clients)
python server.py --transport sse --host 0.0.0.0 --port 8080- Create feature branch from
main - Implement changes in
server.py - Update documentation
- Test with both OpenCode and Claude Desktop
- Merge to appropriate branch
MIT License - See LICENSE file for details.
- AllTalk TTS for the amazing TTS engine
- Model Context Protocol for the protocol specification
- Claude Desktop and OpenCode for MCP client implementations