loading…
Search for a command to run...
loading…
Profile-driven MCP server for Google Cloud Text-to-Speech that exposes tools to synthesize text to speech, run diagnostics, and stop playback, with voice and se
Profile-driven MCP server for Google Cloud Text-to-Speech that exposes tools to synthesize text to speech, run diagnostics, and stop playback, with voice and settings locked per profile.
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 audioVoice, language, model, and format are locked per profile — the LLM can only control text content, speaking rate, and pitch.
pip install tts-mcp
Or with uvx (no install needed):
uvx tts-mcp --help
gcloud) for authenticationafplay for playback by default (configurable via profile)gcloud auth application-default login
gcloud auth application-default set-quota-project YOUR_PROJECT_ID
This stores credentials at ~/.config/gcloud/application_default_credentials.json, which the TTS client discovers automatically. No environment variables needed.
tts-mcp --init
${EDITOR:-vi} ~/.config/tts-mcp/profiles.json
This 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:
--profiles flag or TTS_MCP_PROFILES_PATH env var (explicit override)~/.config/tts-mcp/profiles.json (XDG standard — created by tts-mcp --init)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 mcp add --transport stdio --scope user \
speech -- tts-mcp --profile claude
Edit ~/.config/opencode/opencode.jsonc:
{
"mcp": {
"speech": {
"type": "local",
"command": ["tts-mcp", "--profile", "opencode"],
"enabled": true,
"timeout": 120000
}
}
}
Edit ~/.codex/config.toml:
[mcp_servers.speech]
command = "tts-mcp"
args = ["--profile", "codex"]
Any client config can use uvx instead of installing globally:
{
"command": "uvx",
"args": ["--update", "tts-mcp", "--profile", "opencode"]
}
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).
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 managementtts-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 profile
Defaults:
--profiles: TTS_MCP_PROFILES_PATH env var or "" (then auto-discovery runs)--profile: TTS_MCP_PROFILE_NAME env var or "" (then default_profile is used)--doctor, --init, --force: falsetts-speak — synthesize text to audiotts-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.ogg
Options: --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-generates YYYYMMDD-HHMMSS-ms.ext in the current directory, local timezone)--usage-log: usage_log.csv--text nor --text-file is provided, the CLI reads piped stdin or prompts for texttts-voices — list available voicestts-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 results
Defaults:
--language: en-US--family: "" (no family filter)--limit: 0 (no limit)tts-batch — generate samples for multiple voicestts-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 only
Defaults:
--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: requiredProfiles 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.
gcloud auth application-default login, or confirm GOOGLE_APPLICATION_CREDENTIALS is set.afplay) exists, or change player_command in your profile.tool_timeout.tts-mcp --doctor checks auth, profile, voice, and player.git clone [email protected]: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 check
See CONTRIBUTING.md for details.
MIT
Run in your terminal:
claude mcp add tts-mcp -- npx Security
Low riskAutomated heuristic from public metadata — not a security guarantee.