Mcp Kokoro Tts

io.github.mrfqcentic由 GitHub 账号 mrfqcentic 发布v0.1.4更新于 Oct 24, 2026

Local Kokoro-82M TTS MCP server that synthesizes and plays speech on your machine

已验证STDIO仅桌面媒体与设计AI 与机器学习

概览

AI 生成的概览

本地文本转语音 MCP 服务器,让助手用 Kokoro-82M 模型合成语音并在你的机器上播放。

可以做什么
通过 speak 工具把文本(最多 500 字符)合成为语音,可指定音色和语速,写出 WAV 文件并在本地播放。列出可用的 Kokoro 音色及当前默认音色。可通过音色 id 或本地音色文件路径设置默认音色,也可选择只合成不播放。
适用场景
适合希望助手在会话中朗读文本的场景,例如语音播报结果或语音确认操作,需在具备可用音频播放的桌面机器上使用。
运行要求
通过 uvx 在本地运行,需要 Python 3.12 和 uv。首次启动会下载 Kokoro-82M 权重(约 312 MB)和 spaCy 英文模型到本地环境。播放依赖 macOS 的 afplay、Linux 的 ffplay、paplay 或 aplay、Windows 的 PowerShell MediaPlayer;espeak-ng 为可选。可选环境变量包括 TTS_VOICE、TTS_MODEL_DIR、TTS_HF_CACHE_DIR、TTS_OUTPUT_DIR、TTS_PLAY 和 HF_TOKEN。
安装前请注意
首次运行会下载数百 MB 的模型文件,并把 spaCy 英文模型安装到服务器的 Python 环境中。生成的 WAV 文件会写入本地输出目录。HF_TOKEN 为可选,仅用于加快下载。仅限桌面环境,无头或网页环境无法播放音频。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mcp Kokoro Tts,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

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:

json
{  "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:

bash
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.

ParamRequiredDescription
textyesText to speak (max 500 chars)
voicenoVoice id (e.g. af_heart) or absolute path to a .pt voice file
speednoPlayback 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
json
{  "mcpServers": {    "mcp-kokoro-tts": {      "command": "uvx",      "args": ["mcp-kokoro-tts"],      "env": {        "TTS_VOICE": "af_heart"      }    }  }}

Environment variables

VariableDescription
TTS_VOICEDefault voice id or absolute .pt path
TTS_MODEL_DIROverride model cache directory
TTS_HF_CACHE_DIROverride Hugging Face hub cache directory
TTS_OUTPUT_DIRDirectory for generated WAV files
TTS_PLAYSet to 0 to synthesize without local playback
HF_TOKENOptional Hugging Face token for faster downloads

Platforms

OSSynthesisPlayback
macOSyesafplay
Linuxyesffplay, paplay, or aplay
WindowsyesPowerShell 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

bash
cd mcps-ttspython3.12 -m venv .venvsource .venv/bin/activatepip install -e ".[dev]"pyrightpytestpython -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.

来源:README.md,提交 17ca391

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.4最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。