tts-mcp
Provides text-to-speech synthesis using Google Cloud Text-to-Speech API, with profile-driven voice and settings for playback.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tts-mcpRead the following text aloud: 'Welcome to the future.'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
tts-mcp
Profile-driven MCP server for Google Cloud Text-to-Speech: define one profile per app/client so each tool always speaks with the right voice and settings.
Exposes three tools to any MCP client:
tts_speak— synthesize text to audio and auto-play ittts_doctor— run diagnostics on auth, profile, and playbacktts_stop— stop any currently playing audio
Voice, language, model, and format are locked per profile — the LLM can only control text content, speaking rate, and pitch.
Install
pip install tts-mcpOr with uvx (no install needed):
uvx tts-mcp --helpRelated MCP server: Edge TTS MCP
Prerequisites
Python 3.11+
A Google Cloud project with the Cloud Text-to-Speech API enabled
Google offers a generous free tier — up to 4 million characters/month (roughly 84 hours of English speech at a normal pace) for Standard and WaveNet voices, and 1 million characters/month (roughly 21 hours) for Neural2, Polyglot, Chirp 3: HD, and Studio voices, more than enough for most individual use. See TTS pricing for details.
Google Cloud CLI (
gcloud) for authenticationmacOS uses
afplayfor playback by default (configurable via profile)
Setup
1. Authenticate with Google Cloud
gcloud auth application-default login
gcloud auth application-default set-quota-project YOUR_PROJECT_IDThis stores credentials at ~/.config/gcloud/application_default_credentials.json, which the TTS client discovers automatically. No environment variables needed.
2. Create a profiles file
tts-mcp --init
${EDITOR:-vi} ~/.config/tts-mcp/profiles.jsonThis creates a starter config at ~/.config/tts-mcp/profiles.json with example profiles for every Google TTS voice tier. Edit it to pick your voice, format, and playback settings.
The server finds the profiles file automatically — no --profiles flag needed for the common case. The search order is:
--profilesflag orTTS_MCP_PROFILES_PATHenv var (explicit override)~/.config/tts-mcp/profiles.json(XDG standard — created bytts-mcp --init)
MCP client setup
After running tts-mcp --init, no --profiles flag is needed — the server finds ~/.config/tts-mcp/profiles.json automatically. Just pass --profile to select which profile each client uses.
Claude Code
claude mcp add --transport stdio --scope user \
speech -- tts-mcp --profile claudeOpenCode
Edit ~/.config/opencode/opencode.jsonc:
{
"mcp": {
"speech": {
"type": "local",
"command": ["tts-mcp", "--profile", "opencode"],
"enabled": true,
"timeout": 120000
}
}
}Codex CLI
Edit ~/.codex/config.toml:
[mcp_servers.speech]
command = "tts-mcp"
args = ["--profile", "codex"]Using uvx (no global install)
Any client config can use uvx instead of installing globally:
{
"command": "uvx",
"args": ["--update", "tts-mcp", "--profile", "opencode"]
}Usage
In any MCP-enabled client, prompt naturally:
Summarize this and read it aloud.Stop talking.
Tool names may appear prefixed by the client (e.g. speech_tts_speak, speech_tts_stop).
CLI reference
The package installs four commands. Each supports --help for full details.
For normal usage, you only need tts-mcp --init plus your MCP client setup above; the commands below are mostly for diagnostics or manual testing.
tts-mcp — MCP server and management
tts-mcp --init # create starter config at ~/.config/tts-mcp/profiles.json
tts-mcp --init --force # overwrite existing config
tts-mcp --doctor # diagnostics: auth, profile, voice, player
tts-mcp --profile casual # start MCP server with a specific profileDefaults:
--profiles:TTS_MCP_PROFILES_PATHenv var or""(then auto-discovery runs)--profile:TTS_MCP_PROFILE_NAMEenv var or""(thendefault_profileis used)--doctor,--init,--force:false
tts-speak — synthesize text to audio
tts-speak --text "Hello world" --voice en-US-Chirp3-HD-Fenrir --format wav --out hello.wav
tts-speak --text-file notes.txt --voice en-US-Neural2-D --format mp3 --out notes.mp3
tts-speak --ssml --text "<speak>Hello <break time='500ms'/> world</speak>" --out ssml.wav
echo "Piped text" | tts-speak --voice en-US-Casual-K --out piped.oggOptions: --text, --text-file, --voice, --language, --model, --format (mp3/ogg/wav), --speaking-rate, --pitch, --out, --usage-log.
Defaults:
--voice:""--language:en-US--model:""--format:mp3--speaking-rate:1.0--pitch:0.0--out:""(auto-generatesYYYYMMDD-HHMMSS-ms.extin the current directory, local timezone)--usage-log:usage_log.csvinput: if neither
--textnor--text-fileis provided, the CLI reads piped stdin or prompts for text
tts-voices — list available voices
tts-voices # list en-US voices (default language)
tts-voices --language en-US # filter by language
tts-voices --language en-US --family Chirp3 # filter by family
tts-voices --limit 5 # limit resultsDefaults:
--language:en-US--family:""(no family filter)--limit:0(no limit)
tts-batch — generate samples for multiple voices
tts-batch --text-file test.txt --out-dir ./samples
tts-batch --text-file test.txt --families Chirp3,Neural2 --language en-US --format wav
tts-batch --text-file test.txt --limit 3 # first 3 matching voices onlyDefaults:
--families:""(no family filter)--language:en-US--format:mp3--out-dir:./out--speaking-rate:1.0--pitch:0.0--limit:0(all matching voices)--text-file: required
Profile system
Profiles are defined in a JSON file (see profiles.example.json):
{
"default_profile": "opencode",
"profiles": {
"opencode": {
"voice": "en-US-Chirp3-HD-Fenrir",
"language": "en-US",
"model": "models/chirp3-hd",
"format": "wav",
"speaking_rate": 1.0,
"pitch": 0.0,
"output_dir": "~/.local/share/tts-mcp/out",
"usage_log": "~/.local/share/tts-mcp/usage_log.csv",
"autoplay": true,
"player_command": ["afplay", "{file}"]
}
}
}Each profile locks: voice, language, model, format, output_dir, usage_log, autoplay, and player_command. Only speaking_rate and pitch can be overridden per tool call.
Troubleshooting
Auth errors — run
gcloud auth application-default login, or confirmGOOGLE_APPLICATION_CREDENTIALSis set.No audio — verify the player binary (e.g.
afplay) exists, or changeplayer_commandin your profile.Tool timeout — playback is non-blocking, but if timeouts persist, increase the client's
tool_timeout.Run diagnostics —
tts-mcp --doctorchecks auth, profile, voice, and player.
Development
git clone git@github.com:that-lucas/tts-mcp.git
cd tts-mcp
make setup # creates venv, installs package + dev deps, sets git hooks
make test # run pytest
make lint # run ruff check + format checkSee CONTRIBUTING.md for details.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for Text-to-Speech
MCP server exposing the AceDataCloud Fish Audio API (text-to-speech with voice conditioning)
MCP server for Speech-to-Text
AI voice generation: text-to-speech and voice cloning from any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA Model Context Protocol server that integrates high-quality text-to-speech capabilities with Claude Desktop and other MCP-compatible clients, supporting multiple voice options and audio formats.15 npm1MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that converts text into lifelike speech using Microsoft Edge's Text-to-Speech service, supporting customizable voice, rate, volume, and pitch.4MIT
- AlicenseNot gradedqualityDmaintenanceA text-to-speech MCP server with 48 voices across 9 languages, supporting emotion spans, SFX tags, and multi-speaker dialogue. Deployable via a single npx command with built-in guardrails and swappable backends.MIT
- AlicenseAqualityCmaintenanceMCP server for text-to-speech using macOS say command, enabling speech synthesis, audio file generation, and voice management.56 npm1MIT