voice-mcp
Offers an optional fallback text-to-speech using Google Cloud TTS with a Wavenet voice when gTTS fails, requiring explicit credentials.
Provides text-to-speech using Google Translate TTS (gTTS) for Vietnamese and other supported languages, generating an mp3 which is transcoded to Ogg/Opus.
Outputs audio in Ogg/Opus format at 48 kbit/s, which is the native format for Telegram voice messages, allowing direct use in Telegram.
Click on "Install 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., "@voice-mcptranscribe the attached voice message"
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.
voice-mcp
Speech-to-text and text-to-speech as one small service, exposed over both an MCP (streamable-HTTP) interface and a plain REST interface.
STT — faster-whisper on CPU (int8). Transcribe voice messages (ogg/opus, mp3, wav, m4a…) to text.
TTS — Vietnamese speech via gTTS, with an optional Google Cloud TTS fallback. Server-side ffmpeg transcodes the mp3 to Ogg/Opus (
libopus, 48 kbit/s) so the clip renders as a native Telegram voice bubble. Returns a URL to a cached.ogg, never a base64 blob. No bot needs ffmpeg — it is baked into the image.
This is the packaged evolution of the original single-file whisper-mcp (STT
only); the STT behaviour and API are kept 100% backward-compatible.
About
voice-mcp gives AI agents (Claude Code, chat bots, automation) a single, self-hosted voice endpoint: send audio, get text back; send text, get a shareable voice clip back. It runs on a modest CPU VPS, keeps audio on your own infrastructure (nothing is sent to a third-party STT/TTS service beyond the optional cloud-TTS fallback you opt into), and exposes the same two capabilities over both MCP and REST so any tool can consume it. Built for Vietnamese first (Whisper + gTTS), usable for any language Whisper/gTTS support.
Related MCP server: voice-audio-mcp
Interfaces
Route | Auth | Description |
| Bearer | tools: |
| Bearer | → |
| Bearer | → |
| none | serves a cached |
| none | liveness / model info |
MCP endpoint path is /mcp with no trailing slash.
speak (both the MCP tool and REST) returns a short URL string to an
.ogg (Ogg/Opus) clip, never base64 audio — a base64 blob in a tool result
would blow up the model's context window. The file is served by
GET /audio/<sha>.ogg with Content-Type: audio/ogg (the same route also
serves the intermediate .mp3 as audio/mpeg).
Run
Prebuilt image (GHCR)
docker run -d --name voice-mcp \
-p 127.0.0.1:8767:8767 \
-e MCP_TOKEN=your-secret \
-e WHISPER_MODEL=small \
-e PUBLIC_BASE_URL=https://whisper.veasy.vn \
-v voice-models:/models \
-v voice-audio:/audio \
--memory 1200m --cpus 2 \
ghcr.io/<owner>/voice-mcp:latestBuild locally
docker build -t voice-mcp .
# or, without Docker:
pip install -e ".[dev]"
MCP_TOKEN=dev PUBLIC_BASE_URL=http://localhost:8767 voice-mcpConfig (env)
See .env.example: MCP_TOKEN, WHISPER_MODEL, AUDIO_DIR,
PUBLIC_BASE_URL, and the optional GOOGLE_APPLICATION_CREDENTIALS.
Model sizing
CPU int8, rough footprint / accuracy trade-off:
Model | RAM (approx) | Notes |
| ~0.3–0.5 GB | fastest, lower accuracy |
| ~0.7–1 GB | default — good VN accuracy / speed balance |
| ~2–3 GB | better accuracy, heavier |
| ~4–5 GB | best accuracy, needs plenty of RAM |
Cap the container (e.g. --memory 1200m --cpus 2) on small hosts so it can't OOM
the box; small fits comfortably.
TTS engine rationale
The provider chain lives in src/voice_mcp/tts.py:
gTTS (Google Translate TTS,
lang="vi") — primary, free, no credentials, outputs mp3.Google Cloud TTS (voice
vi-VN-Wavenet-A, female) — fallback, only used when gTTS raises (e.g. HTTP 429). RequiresGOOGLE_APPLICATION_CREDENTIALS; skipped entirely when unset.
Deliberately not used (do not re-add):
Piper — voice quality rejected.
edge-tts — Microsoft blocks datacenter IPs (403 from the VPS).
The mp3 is then transcoded to Ogg/Opus by ffmpeg
(ffmpeg -y -loglevel error -i in.mp3 -c:a libopus -b:a 48k out.ogg), baked
into the image. Both the .mp3 (kept for the chain) and the returned .ogg are
cached content-addressed by sha256(text + lang + engine) in AUDIO_DIR, so
repeated requests return the .ogg instantly without re-running gTTS or ffmpeg.
Serving audio
The app serves GET /audio/<file> itself (streams the .ogg/.mp3 with the
matching Content-Type, no auth — the filename is an opaque hash), so no extra
web-server config is required. For efficiency you can instead let nginx serve
AUDIO_DIR directly:
location /audio/ {
alias /path/to/audio/;
add_header Cache-Control "public, max-age=31536000, immutable";
}Speech-to-speech helper pattern
Chain the two tools for a voice-in → voice-out loop:
text = transcribe(audio_base64=clip_b64, language="vi") # STT
reply = my_llm(text) # your logic
url = speak(text=reply, lang="vi") # TTS -> Ogg/Opus URL
# download `url` (an .ogg) and send it back as a Telegram voice messageDevelopment
pip install -e ".[dev]"
ruff check .
pytest # pure-logic tests (cache keying, config parsing) — no network/modelsContributing
Contributions are welcome. See CONTRIBUTING.md for the dev setup,
the ruff + pytest checks to run before a PR, and the design principles (two APIs /
never return bulk audio inline / engines as a fallback chain).
License
MIT © Edward Nguyen
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/trongnguyenbinh/voice-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server