Piper TTS MCP Server
Enables AI models to generate high-quality voice messages from text using the Piper TTS engine, with automatic model management and audio streaming.
README
Piper TTS MCP Server
A Model Context Protocol (MCP) server that provides Text-to-Speech (TTS) capabilities using the Piper engine. This server allows AI models to "speak" by generating high-quality voice messages from text.
Features
- High-Quality TTS: Uses Piper for fast, local speech synthesis.
- MCP Integration: Compatible with any MCP client supporting HTTP transport.
- Audio Streaming: Returns a URL to the generated audio in Ogg Opus format (optimized for web/mobile).
- Automatic Model Management: Automatically downloads requested models if they are not present locally.
- LRU Caching: Stores the last 3 generated audio files in memory for retrieval.
Installation & Setup
Prerequisites
- Docker and Docker Compose
- Or Python 3.12 with
uv
Using Docker (Recommended)
-
Build the image:
docker compose build -
Start the server:
docker compose up piper-mcpThe server will be running at
http://localhost:8000.
Local Development
-
Install dependencies:
uv sync -
Run the server:
# Use HTTP transport by default export MCP_TRANSPORT=http uv run server.py
MCP Server Connection
To connect, use the following configuration (HTTP transport):
{
"mcpServers": {
"piper-tts": {
"type": "http",
"url": "http://localhost:8000/mcp"
}
}
}
Testing
To run the automated tests using Docker (uses the test profile):
docker compose --profile test up tests
Or locally:
pytest tests/
MCP Tool
After connecting, the following tool will be available:
speak: Generates a voice message from text.- Arguments:
text(string) — the text to speak. - Result: A JSON object containing
status,audio_url, and metadata (size, format).
- Arguments:
Model Selection
The voice model is selected using the MODEL environment variable.
- Default Model:
ru_RU-denis-medium. - Logic:
- At startup, the server checks for
.onnxand.onnx.jsonfiles in the working directory. - If not found, it automatically downloads them from the official Piper repository.
- Change the
MODELvalue indocker-compose.ymlto switch voices.
- At startup, the server checks for
Project Repositories
- Piper Engine: https://github.com/OHF-Voice/piper1-gpl
- Piper Voices (Model List): https://github.com/OHF-Voice/piper1-gpl/blob/main/docs/VOICES.md — check this repository to see all available voices and their names.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.