io.github.Engr-FaizanAli/text-to-speech
Text-to-speech MCP server that enables AI assistants to read text aloud on the user's computer using Windows SAPI, with no API key or cloud service required.
README
Text to Speech MCP Server
<!-- mcp-name: io.github.Engr-FaizanAli/text-to-speech -->
Text to Speech is an open-source Model Context Protocol (MCP) server that lets AI assistants read text aloud on the user's computer. On Windows it uses the built-in Speech API (SAPI) by default, so no API key, account, subscription, or cloud text-to-speech service is required.
The server exposes one model-controlled tool:
speak_text(text: string)
Use it for user-provided text, assistant answers, accessibility workflows, or spoken progress updates while an agent works.
Features
- Local playback through Windows SAPI by default.
- No cloud API and no API key for the default setup.
- FIFO playback: concurrent requests are spoken one at a time, in order.
- Blocking tool completion: each call returns after its audio finishes.
- Bounded input and queue sizes to prevent unbounded resource use.
- Temporary generated WAV files are removed after playback by default.
- Standard MCP
stdiotransport through the official Python SDK. - Optional Piper, Transformers MMS, and local HTTP backends for advanced users.
The MCP server source is open source under the MIT License. Windows SAPI is a proprietary component included with Windows; it is not an open-source speech engine.
Requirements
- Windows 10 or Windows 11 for the zero-configuration SAPI backend.
- Python 3.10 or newer.
- An MCP client such as Codex, Claude Desktop, or another compatible client.
uv/uvxis recommended for package-based MCP installation.
Install
After the package is published to PyPI, configure an MCP client to run:
uvx text-to-speech-mcp
For Codex, add this to ~/.codex/config.toml:
[mcp_servers.text_to_speech]
command = "uvx"
args = ["text-to-speech-mcp"]
startup_timeout_sec = 30
tool_timeout_sec = 300
enabled = true
Restart the MCP client after changing its configuration.
Install from source
git clone https://github.com/engr-faizanali/text-to-speech-mcp.git
cd text-to-speech-mcp
python -m pip install -e .
Then configure the client to run text-to-speech-mcp directly.
Prompt Examples
Read arbitrary text:
Use the Text to Speech tool to read aloud: The deployment completed successfully.
Read the final answer:
Use the Text to Speech tool to read your final response aloud before displaying it.
Read visible intermediate progress updates in order:
Use the text_to_speech MCP server's speak_text tool for spoken progress updates.
For every meaningful intermediate update that you display to me:
1. Write a concise, natural-language version of the update.
2. Call speak_text with that text.
3. Wait for the call to finish before producing or speaking the next update.
4. Then display the same update in text.
Also read the final answer aloud before displaying it. Never narrate hidden
reasoning, chain-of-thought, secrets, credentials, raw tool output, terminal
logs, or source code. Do not invoke speech calls in parallel. If the tool is
unavailable, continue normally in text and report the failure once.
The text_to_speech portion is the client-side server name from the Codex
configuration. Other clients may display a different namespace while keeping
the tool name speak_text.
Tool Contract
| Field | Value |
|---|---|
| Tool name | speak_text |
| Input | text, required string, 1-10,000 characters |
| Result | Completion message after local playback finishes |
| Ordering | FIFO, one active playback at a time |
| Queue limit | 32 pending requests |
| Network use with SAPI | None |
The tool is model-controlled under MCP. The user decides when to ask the model to call it, and the MCP client may show or require approval for tool calls.
Privacy
With the default SAPI backend, text is passed from the MCP client to a local
Python process and then to Windows speech components. It is not sent to this
project, an external API, or a cloud TTS provider. Generated WAV files are
written under %TEMP%\text-to-speech-mcp and deleted after playback unless
TEXT_TO_SPEECH_KEEP_AUDIO=true is set.
Do not ask an AI assistant to speak secrets, credentials, private keys, hidden reasoning, or sensitive tool output.
Optional Backends
The default requires no configuration:
TEXT_TO_SPEECH_BACKEND = "sapi"
Advanced users can set TEXT_TO_SPEECH_BACKEND to piper,
transformers_mms, or http. These options require their own local model,
binary, Python dependencies, or endpoint. See PACKAGE_MCP.md.
Legacy CODEX_TTS_BACKEND and CODEX_TTS_FALLBACK_BACKEND environment
variables remain supported for compatibility.
Development
python -m pip install -e ".[dev]"
python -m unittest discover -s tests -v
python scripts/validate_release.py --online
python -m build
python -m twine check dist/*
See MCP_PUBLIC_RELEASE.md for the full release process.
Standards
- MCP transport:
stdio - MCP tool implementation: official Python MCP SDK
- Registry metadata:
server.jsonusing the 2025-12-11 schema - Package registry: PyPI
- Registry ownership marker: this README's
mcp-namecomment - Registry namespace:
io.github.Engr-FaizanAli/text-to-speech
Official references:
- MCP tools specification
- MCP Registry publishing quickstart
- MCP Registry package types
- MCP Registry repository
License
MIT. See LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。