Text to Speech

io.github.Engr-FaizanAli由 GitHub 账号 Engr-FaizanAli 发布v0.4.1更新于 Oct 24, 2026

Reads text aloud locally on Windows, macOS, and Linux. No API key, account, or cloud service.

已验证STDIO仅桌面沟通与协作媒体与设计

概览

AI 生成的概览

本地文本转语音 MCP 服务器,让助手通过操作系统自带的语音引擎朗读文本,无需 API 密钥或云服务

可以做什么
朗读文本:提供 speak_text 一个工具,把传入的字符串(1 至 50,000 字符)交给本机语音合成器朗读,播放结束后返回。播放按先进先出排队,一次只播一条,队列长度有上限。默认使用系统自带引擎:Windows SAPI、macOS say,Linux 上为 espeak-ng。可通过配置选用可选后端(Piper、Transformers MMS、本地 HTTP 端点)。附带一个助手朗读技能,规定何时以及如何朗读可见的进度更新和最终回答。
适用场景
适合希望助手在本机朗读回答、用户提供的文本、进度更新或无障碍内容的场景,并且更倾向离线、零成本的语音而非云端 TTS 接口。
运行要求
以 PyPI 包形式通过 stdio 在本地运行,通常用 uvx 启动。需要 Python 3.10 或更高版本,以及支持 stdio 服务器的 MCP 客户端。Windows 和 macOS 无需额外安装;Linux 需安装 espeak-ng 和一个音频播放器(如 alsa-utils)。可选后端需要各自的模型、可执行文件、依赖或端点。
安装前请注意
音频会在本机外放,朗读内容可能被他人听到。不要让助手朗读机密、凭据、私钥、隐藏推理或原始工具输出。生成的 WAV 文件写入系统临时目录,播放后删除,除非设置了 TEXT_TO_SPEECH_KEEP_AUDIO。可选的 http 后端会把文本发送到你配置的端点,文本可能离开本机。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Text to Speech,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Text to Speech MCP Server

[PyPI version] [Downloads] [Python versions] [License: MIT] [CI]

Give your AI assistant a voice — locally, with no API key, no account, and no cloud service.

Text to Speech is an open-source Model Context Protocol (MCP) server that lets AI assistants read text aloud on the user's computer. It uses the speech synthesizer already present on the host operating system, so nothing you ask it to say ever leaves your machine.

Runs on Windows, macOS, and Linux. Install is one line:

text
uvx text-to-speech-mcp

The server exposes one model-controlled tool:

text
speak_text(text: string)

Use it for user-provided text, assistant answers, accessibility workflows, or spoken progress updates while an agent works.

Why this one

Most text-to-speech MCP servers wrap a cloud API, which means an account, a key, per-character billing, and your text leaving the machine. This one uses the speech engine your operating system already ships, so it works offline, costs nothing, and keeps text local — which matters if you work anywhere that regulates where data may go.

It also ships an agent narration skill, so an assistant knows how to narrate, not just that it can.

Features

  • Local playback through the platform's built-in synthesizer by default: Windows SAPI, macOS say, or espeak-ng on Linux.
  • 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 stdio transport 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 and the macOS say command are proprietary components of their operating systems; they are not open-source speech engines. espeak-ng is separately licensed open-source software.

Requirements

  • Python 3.10 or newer.
  • An MCP client that supports stdio MCP servers.
  • uv/uvx is recommended for package-based MCP installation.

Per platform, for the zero-configuration default:

PlatformSynthesisPlaybackExtra install
Windows 10/11SAPI via PowerShellSystem.Media.SoundPlayerNone
macOSsayafplayNone
Linux / other Unixespeak-ng or espeakaplay, paplay, play, or ffplayespeak-ng and one player

On Debian or Ubuntu that is typically:

bash
sudo apt install espeak-ng alsa-utils

Set TEXT_TO_SPEECH_BACKEND or TEXT_TO_SPEECH_PLAYER to override either choice. If a required command is missing, the server reports which one and how to install it rather than failing silently.

Install

Configure an MCP client to run the published PyPI package:

text
uvx text-to-speech-mcp

For MCP clients that accept command-based server configuration, use:

toml
command = "uvx"args = ["text-to-speech-mcp"]startup_timeout_sec = 30tool_timeout_sec = 300enabled = true

Some clients use TOML, JSON, or a graphical settings page. Use uvx text-to-speech-mcp as the server command and restart the client after changing its configuration.

Install from source

powershell
git clone https://github.com/Engr-FaizanAli/text-to-speech-mcp.gitcd text-to-speech-mcppython -m pip install .

Then configure the client to run text-to-speech-mcp directly.

Prompt Examples

Read arbitrary text:

text
Use the Text to Speech tool to read aloud: The deployment completed successfully.

Read the final answer:

text
Use the Text to Speech tool to read your final response aloud before displaying it.

Read visible intermediate progress updates in order:

text
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. Call speak_text with the exact update text you are about to display.2. Wait for the call to finish before producing or speaking the next update.3. Then display the same update in text.
Also call speak_text with the exact final answer before displaying it. Nevernarrate hidden reasoning, chain-of-thought, secrets, credentials, raw tooloutput, terminal logs, or source code unless I explicitly ask you to read thatcontent aloud. Do not invoke speech calls in parallel. If the tool isunavailable, continue normally in text and report the failure once.

The text_to_speech portion is an example client-side server name. Clients may display a different namespace while keeping the tool name speak_text.

Tool Contract

FieldValue
Tool namespeak_text
Inputtext, required string, 1-50,000 characters
ResultCompletion message after local playback finishes
OrderingFIFO, one active playback at a time
Queue limit32 pending requests
Network use with a built-in backendNone

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 any of the built-in backends, text is passed from the MCP client to a local Python process and then to the operating system's speech components. It is not sent to this project, an external API, or a cloud TTS provider. Generated WAV files are written to a text-to-speech-mcp directory inside the system temporary directory (%TEMP% on Windows, /tmp on macOS and Linux) and deleted after playback unless TEXT_TO_SPEECH_KEEP_AUDIO=true is set.

The http backend is the exception: whether text leaves the machine depends entirely on the endpoint you configure.

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 is unset and the server selects sapi, say, or espeak to match the host platform.

To pin one explicitly, or to use a backend that is not built into the OS, set TEXT_TO_SPEECH_BACKEND to sapi, say, espeak, piper, transformers_mms, or http. The last three require their own local model, binary, Python dependencies, or endpoint. TEXT_TO_SPEECH_FALLBACK_BACKEND names a second backend to try if the first fails. See backend configuration.

Agent Narration Skill

A speech tool alone does not tell an assistant when or how to speak. Left to improvise, agents narrate hidden reasoning, skip the parts you actually needed, or read a paraphrase instead of what is on screen.

skills/project-tts-responder/SKILL.md is a ready-made narration policy built on speak_text. Copy it into your project's .claude/skills/ directory:

ModeBehaviour
Batch (default)One playback at the end of a turn, covering every visible update plus the final answer
StreamingNarrate each update as it appears — good for demos and walkthroughs
Read on requestRead a named file or block of text verbatim

It also handles the parts that are easy to get wrong:

  • Interactive questions are narrated before the picker opens. An interactive question tool is itself the pause, and its options live in the tool's parameters rather than in visible text — so any rule that narrates "once the options are visible" fires only after the user has already answered. This is the most common way narration silently fails.
  • Speaks exactly what is on screen, never a paraphrase.
  • Never speaks hidden reasoning, secrets, credentials, or raw tool output.
  • One playback call per turn, never parallel, with defined behaviour when a call fails.

The skill applies when you ask for audio. To make a project narrate every response, say so in that project's own agent instructions — for example "narrate every response in Batch mode unless I opt out".

MCP Compatibility

  • MCP transport: stdio
  • MCP tool implementation: official Python MCP SDK
  • Registry metadata: server.json using the 2025-12-11 schema
  • Package registry: PyPI
  • Registry ownership marker: this README's mcp-name comment
  • Registry namespace: io.github.Engr-FaizanAli/text-to-speech

License

MIT. See LICENSE.

来源:README.md,提交 6d20209

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.4.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分