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 分

    請在儲存庫或註冊中心條目中宣告授權條款。