mcp-kokoro-tts
Local Kokoro-82M text-to-speech MCP server. When your agent calls speak, it synthesizes speech and plays it on your machine so you can hear the harness talk.
Works with any MCP client: Claude Desktop, Claude Code, Cursor, VS Code, opencode, Cline, and more. One short config block, no API keys — synthesis runs locally with Kokoro-82M.
On first start, the server downloads the model (~312 MB) into your local cache. Model weights are not bundled in the package.
Install
Add to your client's MCP config:
{
"mcpServers": {
"mcp-kokoro-tts": {
"command": "uvx",
"args": ["mcp-kokoro-tts"]
}
}
}
Requires Python 3.12 and uv. The first server start provisions the Kokoro model automatically.
To pre-download the model without starting the MCP server:
uvx mcp-kokoro-tts-provision
Make the agent call it
Add one line to your AGENTS.md / CLAUDE.md / system prompt:
When the user wants to hear something spoken aloud, call the `speak` tool with clear, natural text.
Tools
speak
Synthesizes speech, writes a WAV file, and plays it locally.
| Param | Required | Description |
|---|---|---|
text |
yes | Text to speak (max 500 chars) |
voice |
no | Voice id (e.g. af_heart) or absolute path to a .pt voice file |
speed |
no | Playback speed multiplier (default 1.0) |
list_voices
Lists available Kokoro voices and the currently selected default.
Choosing your voice
Resolution order:
TTS_VOICEenv var — voice id or absolute.ptpath- A file in the package
voices/folder whose name starts withdefault - First
.ptfile invoices/(alphabetical) - The model's bundled
af_heartvoice
{
"mcpServers": {
"mcp-kokoro-tts": {
"command": "uvx",
"args": ["mcp-kokoro-tts"],
"env": {
"TTS_VOICE": "af_heart"
}
}
}
}
Environment variables
| Variable | Description |
|---|---|
TTS_VOICE |
Default voice id or absolute .pt path |
TTS_MODEL_DIR |
Override model cache directory |
TTS_HF_CACHE_DIR |
Override Hugging Face hub cache directory |
TTS_OUTPUT_DIR |
Directory for generated WAV files |
TTS_PLAY |
Set to 0 to synthesize without local playback |
HF_TOKEN |
Optional Hugging Face token for faster downloads |
Platforms
| OS | Synthesis | Playback |
|---|---|---|
| macOS | yes | afplay |
| Linux | yes | ffplay, paplay, or aplay |
| Windows | yes | PowerShell MediaPlayer |
espeak-ng is optional. English works without it; install it for better out-of-vocabulary coverage and some non-English languages.
Publishing
Tagging a version runs GitHub Actions publish.yml, which uploads to PyPI then the MCP Registry.
Publishing to PyPI uses the repo secret PYPI_TOKEN (a PyPI API token). GitHub trusted publishing can also be configured on the PyPI project; this workflow authenticates with the token so a first release does not depend on pending-publisher matching.
Release
- Bump
versioninpyproject.toml(andserver.jsonif you are not tagging yet) - Commit and tag:
git tag v0.1.1 && git push origin v0.1.1 - GitHub Actions runs
publish.yml:release— typecheck, test, build wheel/sdistpypi-publish— upload to PyPI withPYPI_TOKENmcp-registry— OIDC → MCP Registry (after PyPI succeeds)
Development
cd mcps-tts
python3.12 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pyright
pytest
python -m mcp_kokoro_tts
License
Apache-2.0. See LICENSE and NOTICE. Kokoro-82M model weights are downloaded separately under their Apache-2.0 license.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_kokoro_tts-0.1.1.tar.gz.
File metadata
- Download URL: mcp_kokoro_tts-0.1.1.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
291fd54917975db94bc2ecc28718cf62bc68081f7789645527f721f4d598e368
|
|
| MD5 |
329022449a2ed5d1e63d4f23b9f370cb
|
|
| BLAKE2b-256 |
bcb1659918a0d39ecbbbc23618be60ac8bb7c8a323d93258212a6ff6d56e0aaa
|
File details
Details for the file mcp_kokoro_tts-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mcp_kokoro_tts-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9850147de3a3ab3e6796c16753622a4fd83275ea4fa2e48aa4c68bb6806f66ff
|
|
| MD5 |
56394d58738b72ad722fb6c6f48e6ce8
|
|
| BLAKE2b-256 |
5ae03996e21f97b44edeb12667f9c4f9c10e4249681adcada362776884536a1d
|