MCP_tts_server
MCP Server wrapper for TTS engines (Kokoro TTS and OpenAI TTS)
claude mcp add --transport stdio kristofferv98-mcp_tts_server uv run tts_mcp.py \ --env OPENAI_API_KEY="Your OpenAI API key for OpenAI TTS functionality"
How to use
The MCP TTS Server exposes a unified interface for Text-to-Speech using either a local Kokoro engine or the cloud-based OpenAI TTS engine. It streams audio to clients in real time when possible and supports queueing, playback control, and voice customization via natural language instructions (for OpenAI TTS). To integrate with Claude Desktop or other MCP-enabled clients, connect to the MCP server named mcp_tts_server and invoke the tts function, choosing the engine you want via the engine parameter. You can also stop playback or clear the queue with the tts_stop_playback_and_clear_queue function. Voices are available for Kokoro (default is a Kokoro voice) and a set of OpenAI voices, with adjustable playback speed and optional instructions to customize OpenAI TTS output.
How to install
Prerequisites:
- Python 3.10 or higher
- uv package manager
- OpenAI API key (for OpenAI TTS)
Quick installation steps:
Clone the repository
git clone https://github.com/kristofferv98/MCP_tts_server.git cd MCP_tts_server
Create and activate a virtual environment with uv
uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
Install the package in editable mode
uv pip install -e .
Prepare environment (example)
cp .env.example .env
Edit .env to set your OpenAI API key
OPENAI_API_KEY=your_openai_api_key_here
Run the MCP server
uv run tts_mcp.py
Optional: run the simpler Kokoro-only server for testing
uv run simple_tts_mcp.py
Additional notes
Environment variables and configuration:
- OPENAI_API_KEY is required if you plan to use OpenAI TTS. Ensure the API key has TTS access.
- The server exposes two engines: Kokoro (local) and OpenAI (cloud). You can select the engine per request via the engine parameter in the tts MCP function.
- Playback speed can be adjusted with the speed parameter (typical range 0.8 to 1.5).
- If streaming audio is not available, the server can fall back to file-based playback.
- Claude Desktop users can install the server via fastmcp or manually add an mcpServers entry pointing to uv run tts_mcp.py. Ensure the directory path is correct for your environment.
- Available Kokoro voices: default is af_heart. OpenAI voices include alloy, ash, ballad, coral, echo, fable, onyx, nova, sage, shimmer; default OpenAI model is gpt-4o-mini-tts.
- For development and testing, you can run fastmcp dev ./tts_mcp.py to launch the MCP Inspector UI.
Related MCP Servers
MCP-Bridge
A middleware to provide an openAI compatible endpoint that can call MCP tools
voicemode
Natural voice conversations with Claude Code
python -client
支持查询主流agent框架技术文档的MCP server(支持stdio和sse两种传输协议), 支持 langchain、llama-index、autogen、agno、openai-agents-sdk、mcp-doc、camel-ai 和 crew-ai
Archive-Agent
Find your files with natural language and ask questions.
mcp-tts
MCP Server for Text to Speech
kuon
久远:一个开发中的大模型语音助手,当前关注易用性,简单上手,支持对话选择性记忆和Model Context Protocol (MCP)服务。 KUON:A large language model-based voice assistant under development, currently focused on ease of use and simple onboarding. It supports selective memory in conversations and the Model Context Protocol (MCP) service.