Skip to main content

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 provisions two things that are not on PyPI: the Kokoro-82M weights (~312 MB) into a local cache, and spaCy's English model (en_core_web_sm) into the same Python environment the server is running in. That second install is required because Kokoro's G2P pipeline loads spaCy, and a uvx / uv tool environment will not have the model unless this package puts it there.

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 Kokoro weights and the spaCy English model automatically.

To pre-download both 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:

  1. TTS_VOICE env var — voice id or absolute .pt path
  2. A file in the package voices/ folder whose name starts with default
  3. First .pt file in voices/ (alphabetical)
  4. The model's bundled af_heart voice
{
  "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

  1. Bump version in pyproject.toml (and server.json if you are not tagging yet)
  2. Commit and tag: git tag v0.1.2 && git push origin v0.1.2
  3. GitHub Actions runs publish.yml:
    • release — typecheck, test, build wheel/sdist
    • pypi-publish — upload to PyPI with PYPI_TOKEN
    • mcp-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.

Metadata

Release files for mcp-kokoro-tts 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-kokoro-tts 0.1.4
File Size Uploaded
mcp_kokoro_tts-0.1.4.tar.gz 12.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-kokoro-tts 0.1.4
File Interpreter ABI Platform
mcp_kokoro_tts-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 23.9 kB

Release files / mcp_kokoro_tts-0.1.4.tar.gz

Download URL mcp_kokoro_tts-0.1.4.tar.gz
Size 12.1 kB
Tags Source
SHA-256 checksum
How to use checksums
06c18e182a218f00e1096347937b7b1c53538ea11fcf52d459f3772ab5e6796a
BLAKE2b-256 checksum
How to use checksums
de0876d25b4e5776539c820097ad8917e89dd2b5fd49912024f681b47a55e221
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / mcp_kokoro_tts-0.1.4-py3-none-any.whl

Download URL mcp_kokoro_tts-0.1.4-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff8fa5f1e9c20bf1f94a717c693c6c123d42dfa411bbf8e130d9e7112b4bd636
BLAKE2b-256 checksum
How to use checksums
9645615b0ff7302771dd9c6350e43d86f7e4fecc456f4ba5addefb416a956026
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page