mcp-kokoro-tts
mcp-kokoro-tts
Lokaler Kokoro-82M-Text-to-Speech-MCP-Server. Wenn Ihr Agent speak aufruft, synthetisiert er Sprache und spielt sie auf Ihrem Rechner ab, sodass Sie den Harness sprechen hören können.
Funktioniert mit jedem MCP-Client: Claude Desktop, Claude Code, Cursor, VS Code, opencode, Cline und mehr. Ein kurzer Konfigurationsblock, keine API-Schlüssel – die Synthese läuft lokal mit Kokoro-82M.
Beim ersten Start stellt der Server zwei Dinge bereit, die nicht auf PyPI sind: die Kokoro-82M-Gewichte (~312 MB) in einen lokalen Cache und das englische spaCy-Modell (en_core_web_sm) in dieselbe Python-Umgebung, in der der Server läuft. Diese zweite Installation ist erforderlich, da Kokoros G2P-Pipeline spaCy lädt und eine uvx-/uv tool-Umgebung das Modell nicht enthält, es sei denn, dieses Paket legt es dort ab.
Installation
Fügen Sie Folgendes zur MCP-Konfiguration Ihres Clients hinzu:
{
"mcpServers": {
"mcp-kokoro-tts": {
"command": "uvx",
"args": ["mcp-kokoro-tts"]
}
}
}Erfordert Python 3.12 und uv. Der erste Serverstart stellt Kokoro-Gewichte und das englische spaCy-Modell automatisch bereit.
Um beide vorab herunterzuladen, ohne den MCP-Server zu starten:
uvx mcp-kokoro-tts-provisionRelated MCP server: mac-say-mcp
Den Agenten dazu bringen, es aufzurufen
Fügen Sie eine Zeile zu Ihrer AGENTS.md / CLAUDE.md / Systemaufforderung hinzu:
When the user wants to hear something spoken aloud, call the `speak` tool with clear, natural text.Werkzeuge
speak
Synthetisiert Sprache, schreibt eine WAV-Datei und spielt sie lokal ab.
Param | Erforderlich | Beschreibung |
| ja | Zu sprechender Text (max. 500 Zeichen) |
| nein | Stimm-ID (z. B. |
| nein | Wiedergabegeschwindigkeits-Multiplikator (Standard |
list_voices
Listet verfügbare Kokoro-Stimmen und die aktuell ausgewählte Standardstimme auf.
Auswahl Ihrer Stimme
Auflösungsreihenfolge:
TTS_VOICE-Umgebungsvariable – Stimm-ID oder absoluter.pt-PfadEine Datei im
voices/-Ordner des Pakets, deren Name mitdefaultbeginntErste
.pt-Datei invoices/(alphabetisch)Die gebündelte
af_heart-Stimme des Modells
{
"mcpServers": {
"mcp-kokoro-tts": {
"command": "uvx",
"args": ["mcp-kokoro-tts"],
"env": {
"TTS_VOICE": "af_heart"
}
}
}
}Umgebungsvariablen
Variable | Beschreibung |
| Standard-Stimm-ID oder absoluter |
| Modell-Cache-Verzeichnis überschreiben |
| Hugging-Face-Hub-Cache-Verzeichnis überschreiben |
| Verzeichnis für generierte WAV-Dateien |
| Auf |
| Optionales Hugging-Face-Token für schnellere Downloads |
Plattformen
OS | Synthese | Wiedergabe |
macOS | ja |
|
Linux | ja |
|
Windows | ja | PowerShell |
espeak-ng ist optional. Englisch funktioniert ohne es; installieren Sie es für eine bessere Abdeckung von Wörtern außerhalb des Vokabulars und einige nicht-englische Sprachen.
Veröffentlichung
Das Taggen einer Version führt GitHub Actions publish.yml aus, das zuerst auf PyPI und dann in die MCP-Registry hochlädt.
Die Veröffentlichung auf PyPI verwendet das Repo-Geheimnis PYPI_TOKEN (ein PyPI-API-Token). GitHub Trusted Publishing kann auch auf dem PyPI-Projekt konfiguriert werden; dieser Workflow authentifiziert sich mit dem Token, sodass eine erste Veröffentlichung nicht von der Übereinstimmung mit einem ausstehenden Publisher abhängt.
Release
versioninpyproject.tomlerhöhen (undserver.json, falls Sie noch nicht taggen)Committen und taggen:
git tag v0.1.2 && git push origin v0.1.2GitHub Actions führt
publish.ymlaus:release– Typprüfung, Tests, Wheel/sdist bauenpypi-publish– Upload zu PyPI mitPYPI_TOKENmcp-registry– OIDC → MCP-Registry (nach erfolgreichem PyPI-Upload)
Entwicklung
cd mcps-tts
python3.12 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pyright
pytest
python -m mcp_kokoro_ttsLizenz
Apache-2.0. Siehe LICENSE und NOTICE. Die Kokoro-82M-Modellgewichte werden separat unter ihrer Apache-2.0-Lizenz heruntergeladen.
Available Tools
2 toolslist_voicesList voicesA
List Kokoro voices available to the speak tool and the currently selected default voice. Resolution order: TTS_VOICE env var, voices/default* file, first file in voices/, then the model's default af_heart voice.
Inputs: no named parameters. Returns: result
speakSpeakA
Synthesize speech with Kokoro-82M and play it on the user's machine. Call this when the user wants the harness to talk, read something aloud, or hear a spoken response. Always pass clear, natural text to speak. Default voice resolution: TTS_VOICE env var, voices/default* in the package, first file in voices/, then the bundled af_heart voice from the model.
Inputs: text (required), speed, voice. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one performs speech synthesis ('speak'), the other lists available voices ('list_voices'). No ambiguity between them, as they serve complementary roles in the TTS workflow.
Both tool names follow an imperative verb style ('speak', 'list_voices'), which is concise and predictable. 'list_voices' uses a verb_noun pattern, but the naming is consistent in tone and clarity for a small set.
With only 2 tools, the server is minimal yet well-scoped for its purpose: a text-to-speech harness. The count is appropriate; additional tools would likely be redundant.
The core operation (speak) is present, and the companion list_voices provides necessary context for voice selection. Minor gaps exist, such as no pause/stop or voice configuration tool, but these are not critical for basic TTS functionality.
Maintenance
Related MCP Connectors
MCP server for Text-to-Speech
Hosted text-to-speech MCP server: 66 voices in 9 languages, long-form narration, podcasts.
Remote text-to-speech MCP server with text_to_speech and list_voices tools. Free plan.
AI voice generation: text-to-speech and voice cloning from any MCP client.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables users to convert text into high-quality audio by accessing the OpenAI Text-to-Speech API. It supports customizable model selection and voice options for synthesized speech generation via the MCP protocol.1MIT
- AlicenseAqualityDmaintenanceMCP server for text-to-speech using macOS say command, enabling speech synthesis, audio file generation, and voice management.51MIT

leanvox-mcpofficial
AlicenseNot gradedqualityDmaintenanceEnables text-to-speech generation, voice cloning, dialogue creation, and other TTS operations through natural language in MCP-compatible AI assistants.10 npmMIT- AlicenseNot gradedqualityDmaintenanceEnables MCP clients to speak by running local voice models using Chatterbox Turbo TTS or Kokoro TTS, with support for voice cloning, paralinguistic tags, and multiple voices.89 npm13MIT