SuperAPI AI Directory

claude-code-tts

Text-to-speech for Claude Code using OpenAI's TTS API, with multiple voices and cross-platform playback.

Open website

About this tool

Purpose: This is a text-to-speech (TTS) MCP server plugin for Claude Code that converts text into speech via the OpenAI TTS API and plays it, giving users audio feedback while coding.

Main capabilities: Deterministic automatic reading is implemented through the Stop hook; the first sentence of every Claude reply is automatically read aloud with no configuration required; 6 voices are provided: alloy, echo, fable, onyx, nova, shimmer; it uses a Worker Pool architecture with a non-blocking queue and support for concurrent processing; playback is protected by a mutex so only one audio segment plays at a time and they do not overlap; cross-platform support includes macOS (afplay), Linux (mpv/ffplay/mpg123), and Windows (PowerShell).

Usage: The MCP tool speak(text, voice) can convert text to speech and play it; tts_status() gets the current status of the TTS system. A standalone CLI tool, speak-text, is also provided, which can call TTS directly without going through MCP; after installation it is located at ~/.claude/plugins/claude-code-tts/bin/speak-text. Automatic TTS is implemented by the Stop hook, runs in the background, and does not block Claude's replies.

Requirements: Go 1.21+ (required when building from source), an OpenAI API Key with TTS permissions, and an audio player (afplay is built into macOS, Linux requires mpv, ffplay, or mpg123 to be installed, and Windows uses the built-in PowerShell). The OPENAI_API_KEY environment variable must be set and can be added to ~/.zshrc or ~/.bashrc.

Limitations: It uses OpenAI's tts-1 model, costing about $0.015 per 1000 characters; API requests usually take 1-3 seconds; audio must be fully downloaded before it can be played; the default queue size is 50, and when the limit is reached you must wait for the current task to finish or check pending tasks via tts_status(); keeping messages short is recommended for faster feedback.

License: MIT License. Other details such as installation commands and contribution guidelines are not fully provided in the official materials.