By default Kokoro synthesizes locally, which means the model sits on your machine. Setting KOKORO_BASE_URL sends the call to an OpenAI-compatible endpoint such as kokoro-fastapi instead, and the local dependencies stop being needed at all.
A text-to-speech MCP server built on the Kokoro engine. It exposes one tool that synthesizes speech, saves it to a file or plays it back.
- generate_speech, taking text plus optional voice, speed, save_path and play_audio
- Voice selection, defaulting to af_heart, and a speed multiplier defaulting to 1.0
- Save the audio to a directory, play it immediately, or both
- Playback on Windows, macOS and Linux, using start, afplay and aplay respectively
- An OpenAI-compatible remote backend option, so no local torch or kokoro is needed
- A Dockerfile, with the remote backend passed in as an environment variable
Python 3.10 or higher and the uv package manager; uv venv then uv pip install . in the cloned repository. To offload synthesis instead, set KOKORO_BASE_URL to an OpenAI-compatible endpoint, with KOKORO_API_KEY and KOKORO_MODEL if that endpoint needs them.
One command — uv pip install .
