Skip to main content
Glama

kokoro-tts-mcp

Cross-platform local text-to-speech MCP server. Give your AI assistant a voice — on Windows, macOS, and Linux.

Powered by Kokoro-82M. Free, fully offline, no API keys, no cloud calls.

Platform License: Apache-2.0 Node MCP

What it does

Exposes two Model Context Protocol tools to any MCP-compatible AI client (Claude Code, ZCode, Cursor, Windsurf, Cline, ...):

Tool

Purpose

speak

Converts text to speech and plays it through the speakers

tts_config

View or change settings: mute/unmute, auto-speak, voice, speed

With auto-speak enabled, your assistant speaks every response aloud — hands-free operation for accessibility, multitasking, or just vibe.

Related MCP server: ThotStream

Features

  • 🖥️ Works everywhere — Windows, macOS, and Linux (this is the main reason this fork exists; the original is macOS-only)

  • 🔒 100% local — synthesis and playback happen on your machine, nothing leaves it

  • 🆓 Free — Apache 2.0 licensed, no API keys, no subscriptions

  • 🌍 48 voices — American/British English, Spanish, French, Hindi, Italian, Japanese, Portuguese, Mandarin

  • ⚡ Offline after setup — the model is downloaded once, then everything runs locally

  • 🗣️ Auto-speak mode — the assistant narrates every response automatically

Requirements

Requirement

Version

Notes

Node.js

18+

Python

3.10 – 3.12

Needed for Kokoro inference (python.org)

Disk space

~1.5 GB

Model weights (~350 MB) + Python packages

Audio player

—

Built in on Windows (PowerShell) and macOS (afplay); Linux needs one of paplay, pw-play, aplay, or ffplay

Quick start

1. One-time initialization

Downloads model weights (~350 MB, one time) and sets up an isolated Python environment:

npx github:kalprajsolutions/kokoro-tts-mcp init

2. Add to your MCP client

Claude Code:

claude mcp add tts -- npx -y github:kalprajsolutions/kokoro-tts-mcp

Generic MCP config (ZCode, Cursor, Windsurf, Cline, Claude Desktop, ...):

{
  "mcpServers": {
    "tts": {
      "command": "npx",
      "args": ["-y", "github:kalprajsolutions/kokoro-tts-mcp"],
      "env": {
        "TTS_VOICE": "af_heart",
        "TTS_SPEED": "1.0"
      }
    }
  }
}

Windows note: if your client has trouble launching npx directly, use the cmd.exe wrapper that works everywhere:

{
  "mcpServers": {
    "tts": {
      "command": "cmd.exe",
      "args": ["/d", "/c", "npx", "-y", "github:kalprajsolutions/kokoro-tts-mcp"]
    }
  }
}

3. Talk to your assistant

Try: "Speak this: hello world", "Mute TTS", "Change voice to bf_emma", "Turn on auto-speak".

Voices

48 Kokoro voices. Prefix guide: af/am = American English, bf/bm = British English, ef/em = Spanish, ff = French, hf/hm = Hindi, if/im = Italian, jf/jm = Japanese, pf/pm = Portuguese, zf = Mandarin. f = female, m = male.

Voice

Description

af_heart

American English female (Grade A, recommended default)

af_bella

American English female (Grade A-)

bf_emma

British English female (Grade B-)

am_michael

American English male (Grade C+)

am_puck

American English male (Grade C+)

zf_xiaobei

Mandarin Chinese female

Full list: Kokoro-82M VOICES.md

Configuration

Environment variables (optional, shown above in the MCP config):

Variable

Default

Description

TTS_VOICE

af_heart

Default voice

TTS_SPEED

1.0

Playback speed 0.5 – 2.0

TTS_ENABLED

true

Set false to start muted

TTS_AUTO

false

Set true to start with auto-speak on

TTS_BASE_DIR

~/.kokoro-tts

Data directory (venv, state)

Runtime changes made through tts_config are persisted to ~/.kokoro-tts/state.json.

Platform support

Platform

Audio playback

Setup notes

Windows 10/11

PowerShell Media.SoundPlayer (built in)

Install Python from python.org with "Add python.exe to PATH" checked

macOS

afplay (built in)

Works out of the box

Linux

paplay (PulseAudio) → pw-play (PipeWire) → aplay (ALSA) → ffplay, first available is used

Install one player, e.g. sudo apt install pulseaudio-utils

Troubleshooting

"Python 3.10–3.12 is required but not found" — Install Python 3.10, 3.11, or 3.12 from python.org. On Windows, tick "Add python.exe to PATH" in the installer. Kokoro does not yet support Python 3.13+.

Linux: "No audio player found" — Install one of the supported players: sudo apt install pulseaudio-utils (paplay), sudo apt install alsa-utils (aplay), or sudo apt install ffmpeg (ffplay). On headless servers there may be no audio device; the generated WAV can still be inspected via the tool's error/duration output.

Windows: init fails on pip path — Use version ≥ 1.0.0 of this package (older versions of the original upstream had POSIX-only paths).

First speak call is slow — The Kokoro model weights are downloaded from Hugging Face on first use (~350 MB, cached in ~/.cache/huggingface). Later calls are fast and fully offline.

Model download fails / corporate proxy — Set the standard HTTPS_PROXY/HTTP_PROXY environment variables, or pre-download via huggingface-cli.

How it works

MCP client (Claude Code / ZCode / Cursor / ...)
        │  stdio (JSON-RPC)
        ▼
Node.js MCP server (this package)
        │  spawn                     │  platform dispatch
        ▼                            ▼
Python venv (Kokoro pipeline)     afplay / PowerShell /
  → generates 24 kHz WAV          SoundPlayer / paplay / aplay

Credits & attribution

This project is a cross-platform fork of claude-tts-mcp by Mitch Hazelhurst — thank you for the excellent original. Modified for Windows/macOS/Linux support by Kalpraj Solutions; see NOTICE for the full change list.

License

Apache License 2.0 — free for personal and commercial use.

Available Tools

2 tools
speakA

Convert text to speech and play it through speakers using Kokoro TTS (local, free, no API key needed). IMPORTANT: If auto-speak is enabled (check via tts_config), you MUST call this tool with your full response text for EVERY response, no exceptions. Never skip calling speak when auto-speak is ON.

Inputs: text (required), speed, voice.

tts_configA

View or change TTS settings. Call with no parameters to see current config. Use to: enable/disable TTS, turn auto-speak on/off (auto-speak makes Claude speak every response), change voice, change speed. When the user says 'mute tts', 'unmute tts', 'tts on', 'tts off', 'stop speaking', 'start speaking', 'auto speak', 'speak all responses', 'change voice', or 'change speed' — use this tool.

Inputs: auto, speed, voice, enabled.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have clearly separate purposes: tts_config manages settings (enable/disable, auto-speak, voice, speed) while speak performs text-to-speech playback. Descriptions explicitly cross-reference each other, so an agent can trivially choose the right tool.

    Naming Consistency4/5

    Both names are lowercase snake_case, but tts_config is a noun-style resource name while speak is a bare verb, a minor deviation from a single convention. With only two tools the pattern remains readable and predictable.

    Tool Count4/5

    Two tools is on the light side, but the server's scope is narrow (local TTS playback plus configuration), and both tools earn their place without redundancy. Slightly thin if one expected richer voice management, but reasonable overall.

    Completeness4/5

    Configuration covers the key lifecycle controls (enable/disable, auto-speak, voice, speed) and speak handles playback with clear guidance on when to invoke it. Minor gaps like listing available voices or pausing/stopping mid-utterance are handled indirectly via disabling TTS.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables text-to-speech conversion using the Kokoro TTS model, running fully locally with native JavaScript. Supports multiple voices, speed control, and integrates with MCP-compatible clients.
      14 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to narrate internal thoughts, announce tool actions, and speak final responses aloud through local cross-platform text-to-speech. It exposes dedicated audio tools over stdio JSON-RPC for MCP-compatible clients.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      A local MCP server that turns any text into narration, voice-overs, dialogues, audiobook chapters and per-shot video clips as MP3/WAV files — with emotions, acting modes, inline cues, presets and subtitles — driven by a ChatGPT sign-in rather than an API key. It also exposes tools for inspecting audio (timings, pace, pitch, waveform), transcribing recordings, listing and favouring voices, saving pronunciation presets, and checking sign-in status.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      An MCP server that lets an AI assistant turn written text — or prose it writes itself — into narrated audiobooks with chapter-marked .m4b files, using local Kokoro voices entirely offline and free. It supports 54 voices across 9 languages, adjustable speed, voice blending, and chapter-level resumable rendering.
      37 PyPI
      MIT