Are you the author? Sign in to claim
๐ Text-to-Speech MCP plugin for Claude Code - hear audio feedback while coding (OpenAI TTS)
A Text-to-Speech MCP server plugin for Claude Code that converts text to speech using OpenAI's TTS API. Get audio feedback from Claude as you work!

speak-text binary for direct TTS without MCP# One-liner installation
curl -fsSL https://raw.githubusercontent.com/ybouhjira/claude-code-tts/main/install.sh | bash
Or install manually:
git clone https://github.com/ybouhjira/claude-code-tts.git ~/.claude/plugins/claude-code-tts
cd ~/.claude/plugins/claude-code-tts
make install
afplay (built-in)mpv, ffplay, or mpg123Set your OpenAI API key:
export OPENAI_API_KEY="sk-..."
Or add to your shell profile (~/.zshrc or ~/.bashrc).
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Claude Code โ
โ โ โ
โ MCP Protocol โ
โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ TTS MCP Server (Go) โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ Tool Handlers โ โ โ
โ โ โ speak(text, voice) โ tts_status() โ โ โ
โ โ โโโโโโโโโโโโโโโฌโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ โ โ
โ โ โโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ Worker Pool (2 workers) โ โ โ
โ โ โ โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ โ โ โ
โ โ โ โ Job โโโโโบโ Queue (50 slots) โ โ โ โ
โ โ โ โ Submit โ โโโโโโโโโโโโฌโโโโโโโโโโโ โ โ โ
โ โ โ โโโโโโโโโโโ โ โ โ โ
โ โ โ โโโโโโโโโโผโโโโโโโโโ โ โ โ
โ โ โ โ Worker 1 โ 2 โ โ โ โ
โ โ โ โโโโโโโโโโฌโโโโโโโโโ โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ OpenAI TTS API โ โ โ
โ โ โ POST /v1/audio/speech โ โ โ
โ โ โ Model: tts-1 โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ Audio Player (Mutex Protected) โ โ โ
โ โ โ macOS: afplay โ Linux: mpv โ Win: PowerShell โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Convert text to speech and play it aloud.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text to speak (max 4096 chars) |
voice | string | No | Voice to use (default: alloy) |
Available Voices:
| Voice | Description |
|---|---|
alloy | Neutral, balanced |
echo | Male, warm |
fable | British accent |
onyx | Deep male |
nova | Female, friendly |
shimmer | Soft female |
Example:
Use the speak tool to say "Build completed successfully!" with the nova voice.
Get the current status of the TTS system.
Returns:
{
"worker_count": 2,
"queue_size": 50,
"queue_pending": 0,
"total_processed": 15,
"total_failed": 0,
"is_playing": false,
"recent_jobs": [...]
}
This plugin includes a Stop hook that automatically speaks the first sentence of every Claude response. No configuration needed - it just works.
How it works:
Claude responds โ Stop hook fires โ First sentence extracted โ Audio plays
The hook runs in the background and won't block Claude's responses.
A standalone binary for direct TTS without going through MCP:
# Basic usage
speak-text "Hello world"
# With voice selection
speak-text -voice onyx "Error occurred"
Located at ~/.claude/plugins/claude-code-tts/bin/speak-text after installation.
claude-code-tts/
โโโ cmd/
โ โโโ tts-server/
โ โ โโโ main.go # MCP server entry point
โ โโโ speak-text/
โ โโโ main.go # Standalone CLI binary
โโโ hooks/
โ โโโ auto-speak.sh # Stop hook for deterministic TTS
โโโ internal/
โ โโโ audio/
โ โ โโโ player.go # Cross-platform audio playback
โ โโโ server/
โ โ โโโ server.go # MCP server & tool handlers
โ โ โโโ worker.go # Worker pool implementation
โ โโโ tts/
โ โโโ openai.go # OpenAI TTS client
โโโ plugin.json # Plugin metadata + hook config
โโโ Makefile # Build automation
โโโ install.sh # One-liner installer
# Clone the repository
git clone https://github.com/ybouhjira/claude-code-tts.git
cd claude-code-tts
# Build
make build
# Install to Claude Code plugins
make install
# Run tests
make test
Set your OpenAI API key:
export OPENAI_API_KEY="sk-..."
Install one of: mpv, ffplay, or mpg123:
# Ubuntu/Debian
sudo apt install mpv
# Fedora
sudo dnf install mpv
# Arch
sudo pacman -S mpv
Check that afplay works:
# Test with a sample audio file
afplay /System/Library/Sounds/Ping.aiff
The default queue size is 50. If you're hitting this limit:
tts_status() to see pending jobsThis plugin uses OpenAI's tts-1 model:
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
MIT License - see LICENSE for details.
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots
Google's universal MCP server supporting PostgreSQL, MySQL, MongoDB, Redis, and 10+ databases
Official GitHub integration for repos, issues, PRs, and CI/CD workflows