TTS MCP Server

TTS MCP Server

Text-to-speech MCP server using Microsoft Edge TTS, supporting multiple voices and async processing.

Category
Visit Server

README

VoiceOver MCP Server

Text-to-speech server exposing one MCP tool (voice_over) over SSE, plus a matching REST API. Audio is generated to a temp directory (safe for ephemeral disks on Render/Railway/Fly/etc.) and served back over HTTP so any LLM client or frontend can render it.

Project layout

app/
├── main.py              # FastAPI app factory: middleware, lifespan, routers
├── config.py             # all env-var configuration in one place
│
├── models/
│   └── schemas.py         # TTSRequest / TTSResponse Pydantic models
│
├── core/                    # transport-agnostic business logic
│   ├── tts.py                 # edge-tts wrapper (generate_audio_core, list_available_voices)
│   ├── files.py                 # filename generation, temp-path resolution, cleanup
│   └── logging.py                 # in-memory request log
│
├── mcp/                              # MCP protocol layer
│   ├── server.py                       # Server("voiceover-mcp-server") instance
│   ├── tools.py                          # tool schema: single "voice_over" tool
│   └── handlers.py                         # call_tool dispatch -> core.tts
│
├── routes/                                    # REST layer (one file per resource)
│   ├── root.py                                  # GET / , GET /health
│   ├── mcp_sse.py                                 # GET /mcp/sse
│   ├── tts.py                                       # POST /api/v1/tts
│   ├── voices.py                                      # GET /api/v1/voices
│   ├── audio.py                                         # GET /api/v1/audio/{filename}
│   └── logs.py                                            # GET /api/v1/logs
│
└── utils/
    └── formatting.py                                        # file-size + timestamp helpers

tests/                                                            # pytest suite (27 tests)
run.py                                                              # entry point

Run it

pip install -r requirements.txt
cp .env.example .env   # edit as needed
python run.py

Server starts on http://0.0.0.0:8080 by default. Docs at /docs.

The voice_over MCP tool

Connect an MCP client to GET /mcp/sse. The single exposed tool:

  • Input: text (required), voice, rate, pitch, volume, output_filename
  • Output: { "success": true, "content": "<original text>", "filename": "<name>.mp3", "timestamp": "..." }

The tool does not return audio bytes or a filesystem path — only the filename. Fetch the actual file with:

GET /api/v1/audio/{filename}

This is what your deploy/render layer should call to play or download the generated clip.

REST API (mirrors the MCP tool 1:1)

Method Path Purpose
GET / Service info
GET /health Health + temp dir status
GET /mcp/sse MCP SSE connection
POST /api/v1/tts Generate speech, returns filename + download URL
GET /api/v1/voices List/filter available edge-tts voices
GET /api/v1/audio/{filename} Download/stream a generated clip
GET /api/v1/logs Recent request log (monitoring)

Storage model

  • All audio is written to a single ephemeral temp directory (TEMP_DIR, defaults to the OS temp dir + voiceover_mcp).
  • Filenames are sanitized and resolved with Path(...).name only — no path traversal via output_filename or the download route.
  • AUDIO_TTL_SECONDS (default 1 hour) controls a startup cleanup sweep that deletes stale files.
  • Because storage is ephemeral, files will not survive a server restart on most PaaS platforms — by design. The download endpoint returns a clear 404 if a file has expired or the instance was recycled.

Testing

python -m pytest tests/ -v

27 tests covering: filename/path safety, TTS core logic (edge-tts mocked, no real network calls), the MCP voice_over tool handler, and all REST routes.

Environment variables

See .env.example. Key ones:

  • PORT, HOST — server binding
  • TEMP_DIR — override the audio temp directory
  • AUDIO_TTL_SECONDS — cleanup age threshold
  • DEFAULT_VOICE, DEFAULT_RATE, DEFAULT_PITCH, DEFAULT_VOLUME — TTS defaults

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured