RestfulTTS
Generates telephony-ready text-to-speech audio in Asterisk-compatible formats such as raw signed linear (sln/sln16) and G.711 µ-law/A-law, suitable for PBX announcements.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
RestfulTTS
Text-to-speech for PhonixPBX announcements, served over a REST API, an MCP server and a small web UI.
Language | Voices | Model |
German ( |
| Thorsten-Voice/Kokoro, a Kokoro-82M fine-tune on the CC0 Thorsten-Voice dataset |
English ( |
| |
French ( |
| hexgrad/Kokoro-82M |
Italian ( |
| hexgrad/Kokoro-82M; both voices are only graded "C" by Kokoro |
Inspired by nazdridoy/kokoro-tts. Unlike that project, it uses the
PyTorch kokoro package instead of kokoro-onnx, because the German model only exists as a PyTorch checkpoint.
It also needs the semidark forks of kokoro and misaki; only those
forks contain the German G2P.
Run
With Podman (CPU only), from the released image (linux/amd64 and linux/arm64):
podman run -d -p 8000:8000 -v restfultts_data:/data ghcr.io/phonixpbx/restfultts:latestOr built from source:
podman-compose up -d # or: podman build -t restfultts . && podman run -p 8000:8000 -v restfultts_data:/data restfulttsThe first start downloads about 650 MB of models and voices into the /data volume, which can take several minutes.
Later starts load them from the volume.
Locally with uv and Python 3.12:
uv sync --extra dev
uv run restfultts download # optional: fetch all models up front
uv run restfultts serve # http://127.0.0.1:8000
uv run restfultts say "Guten Tag." -o hallo.wav
uv run restfultts say "Buongiorno." -l it -f ulaw -o hallo.ulawThe UI is at /, the OpenAPI docs are at /docs, and the MCP endpoint is /mcp.
Related MCP server: Speechify MCP
Configuration
Environment variables (or an .env file):
Variable | Default | Description |
| empty | When set, REST and MCP need |
|
| Holds the audio cache. In the container it also holds the models ( |
| empty ( | Languages whose models are loaded at startup; others load on the first request. |
|
|
|
|
| Checkpoint of the German model (1–10). |
|
| Longer texts are rejected with 413. |
|
| Size limit of the audio cache; the least recently used files are removed first. |
|
| Listen address ( |
| empty | Comma separated host names the server answers to, e.g. |
REST API
Method and path | Description |
| Body |
| Same as |
| A file from the cache. |
| Deletes a file from the cache, with all formats derived from the same synthesis. Returns 204, or 404 if it is not in the cache. |
| Metadata. |
| Compatible with the |
Synthesis responses carry the headers X-Cache: hit|miss and X-Voice.
Formats:
Format | Rate | Content |
| 24 kHz | Original quality |
| 16 kHz | WAV |
| 8 kHz | WAV |
| 8 kHz | Asterisk raw signed linear, 16 bit |
| 16 kHz | Asterisk raw signed linear, 16 bit |
| 8 kHz | Raw G.711 µ-law |
| 8 kHz | Raw G.711 A-law |
The G.711 encoders give the same output as Python's audioop for every 16-bit sample.
curl -o ansage.wav -H 'Content-Type: application/json' \
-d '{"text": "Guten Tag und willkommen."}' http://localhost:8000/tts
curl -o ansage.ulaw 'http://localhost:8000/api/v1/synthesize?text=Benvenuti&language=it&format=ulaw'Each text is synthesized once and cached as 24 kHz WAV. Other formats of the same text are derived from that file.
MCP
The MCP endpoint uses Streamable HTTP (stateless, JSON responses) at http://<host>:8000/mcp. If a token is
configured, clients send it as a bearer token. It offers three tools:
list_voices(language?)list_formats()delete_audio(url)deletes a file and all its formats.synthesize(text, voice?, language?, speed?, format?)returns the audio as MCP audio content, plus a JSON text with the voice, the duration and the download path.
claude mcp add --transport http restfultts http://localhost:8000/mcp --header "Authorization: Bearer $TOKEN"Development
uv run pytest -q # unit, API, MCP and UI tests with a fake engine
uv run pytest -m models # real synthesis in all four languages (downloads the models)
uv run ruff check . && uv run ruff format --check . && uv run mypy src
scripts/test-container.sh <image> # smoke test of a built image, as in CI
scripts/vendor-update.sh # refresh Tabler 1.7.1 / htmx 4.0.0 (same versions as PhonixPBX)Releases are tagged vX.Y.Z. CI then builds and pushes the container image and creates the GitHub release from
CHANGELOG.md; see docs/RELEASING.md.
Licenses
RestfulTTS is licensed under Apache-2.0. Both models are Apache-2.0, and the Thorsten-Voice dataset is CC0.
For phonemization, misaki uses espeak-ng through phonemizer-fork and espeakng-loader. Both are GPL-3 and are
installed as unmodified Python dependencies. Unlike in PhonixPBX, espeak-ng does not produce the speech here; it only
converts text to phonemes for Kokoro. See NOTICE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Generate English and Chinese speech, split long text, track batch jobs, and download audio.
Synthesize short texts into WAV audio using offline formant voices in English, German and Spanish
Text to speech, voice listing and phrase library search for AI assistants. API key header.
Text to speech in 200+ languages, voice cloning, voice design and SRT captions.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables MCP clients to synthesize text into speech locally and play it through the machine's audio, with selectable voices and playback speed.262 PyPIApache 2.0
- FlicenseNot gradedqualityBmaintenanceEnables clients to browse available voices, generate speech audio from text or supported SSML, and produce UK English output via a convenience tool, while keeping API credentials server-side.-

audio.ditto/ttsofficial
FlicenseNot gradedqualityCmaintenanceEnables AI clients to browse voices and languages and synthesize text into downloadable audio links, including batch jobs of up to 1,000 texts.1-- AlicenseNot gradedqualityCmaintenanceEnables Claude and other MCP clients to generate local, offline text-to-speech audio in 31 languages, manage and install voices, and save or play audio files.Apache 2.0