
Voice Bridge
io.github.dwarmerdam由 GitHub 帳號 dwarmerdam 發布v0.1.5更新於 Oct 24, 2026
Multi-engine TTS for AI coding assistants. 5 engines, free engine included.
概覽
本機文字轉語音 MCP 伺服器,讓 AI 助理透過五種 TTS 引擎之一把回覆朗讀出來。
- 可以做什麼
- 朗讀文字,可為單次呼叫指定引擎;朗讀前會過濾程式碼、密鑰、檔案路徑、URL 和 Markdown,並在句子邊界截斷過長文字。在 auto、edge-tts、ElevenLabs、Kokoro、macOS say 和 espeak-ng 之間切換預設引擎。查看目前模式、目前引擎以及可用引擎。列出某個引擎提供的語音,省略時使用目前引擎。
- 適用情境
- 適合在有喇叭的桌面上使用程式設計助理並希望把回覆讀出來時使用,例如免持操作或無障礙情境,也適合想免 API 金鑰使用免費神經網路語音的使用者。
- 執行需求
- 以本機程序執行。需要 Python 3.10+ 和 pip;npm 套件只是自動安裝 Python 套件的封裝,仍需要 PATH 中有 Python 和 pip。需要音訊輸出和播放器:macOS 用 afplay,Linux 用 mpv 或 ffplay,Windows 用 ffplay 或 mpv。可選 ElevenLabs 金鑰,存放在本機 .env 檔案中;Kokoro 需下載約 200MB 模型。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Voice Bridge,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Voice Bridge
Multi-engine text-to-speech for AI coding assistants. Speaks responses aloud from Claude Code, Cursor, or VS Code via a Claude Code plugin, MCP server, or CLI pipe.
Features
- Free by default -- edge-tts uses Microsoft Neural voices, no API key needed
- 5 engines -- edge-tts, ElevenLabs, Kokoro (local ONNX), macOS say, espeak-ng
- Text safety filter -- strips code blocks, secrets, file paths, URLs, and markdown before speaking
- Claude Code plugin -- Stop hook speaks responses automatically, MCP server for tool-based control
- Voice discovery -- browse, filter by gender/locale, and preview voices interactively
Prerequisites
Voice Bridge is a Python package that plays audio on your local machine. It requires:
Audio player fallback order: macOS uses afplay (always available). Linux tries mpv then ffplay. Windows tries ffplay then mpv.
Not supported: headless servers, Docker containers, SSH sessions, and CI runners typically lack audio output. Voice Bridge will install and run the MCP server, but
speakcommands will fail silently without an audio player and sound hardware.
Quick Start
Install
Test
The setup wizard walks you through: detecting installed engines, testing audio output, optionally entering an ElevenLabs API key (if the SDK is installed), writing default state, and showing Claude Code integration options.
Use
Claude Code Integration
Option 1: Install as a Plugin (Recommended)
This installs the plugin with a Stop hook (auto-speaks responses), the /speak skill, and the MCP server. Auto-installs ai-voice-bridge[edge,mcp] on first session.
Option 2: Manual Hook Setup
Add to your .claude/settings.json:
Then add to your CLAUDE.md:
Option 2: Always-On Mode
Skip the <speak> tag convention entirely:
Now every Claude response is spoken automatically. Toggle off with voice-bridge off.
Hook Details
The Stop hook runs in the background so it doesn't block Claude Code. It:
- Extracts text from
<speak>tags (single-turn mode) or the full response (always-on mode) - Truncates to 2,000 characters before speaking
- Uses a fallback chain: configured engine > espeak > say
- Logs to
~/.voice-bridge/voice-bridge.log(auto-rotated at 1MB, keeps 2 backups) - Runs
vb-speak --streamfor sentence-by-sentence playback
Engines
When engine is set to auto (default), Voice Bridge picks the first available in this order: edge-tts > say > espeak > kokoro > elevenlabs. ElevenLabs is only considered "available" if the SDK is installed AND a valid API key is configured -- it will never be auto-selected without credentials.
Discovering Voices
Filtering options: --gender (Male/Female) works with edge-tts and kokoro. --locale (e.g. en-US, en-GB) works with edge-tts and say. --sample N picks N random voices. All combine with --preview for interactive audition.
ElevenLabs preview uses free pre-recorded samples when available (no API credits consumed).
Switching Engines
ElevenLabs Setup
Kokoro Setup (Offline)
Configuration
Voice Bridge stores configuration in ~/.voice-bridge/ (macOS), ~/.local/share/voice-bridge/ (Linux, respects XDG_DATA_HOME), or %APPDATA%\voice-bridge\ (Windows).
Override with the VOICE_BRIDGE_HOME environment variable.
State Variables
The .state file is a shell-sourceable key-value file. All values are optional — defaults apply if unset.
Text Safety Filter
Before any text reaches the TTS engine, Voice Bridge strips:
- Code blocks (fenced
```and inline`) - Secrets: OpenAI/Anthropic keys (
sk-...), GitHub tokens (ghp_,gho_), AWS keys (AKIA...), PEM private keys, 64+ char hex strings - File paths: Unix (
/Users/...,/home/...) and Windows (C:\Users\...) - URLs:
http://andhttps:// - Markdown: headers, bold/italic markers, list bullets, table rows
Text is truncated to 4,000 characters at the nearest sentence boundary (. ). The Claude hook applies a separate 2,000 character limit before passing text to vb-speak.
CLI Reference
Streaming mode (--stream): reads stdin, splits text at sentence boundaries (. , ! , ? ), and speaks each sentence as it completes. For edge-tts, sentences are queued so the next one generates while the current one plays.
Speed Control
Each engine accepts a different speed format:
Speed applies to whichever engine is currently active. Check with voice-bridge speed (no value).
MCP Server
Voice Bridge includes an MCP (Model Context Protocol) server so any MCP-compatible tool can speak text aloud.
npm shim (
npx ai-voice-bridge): The npm package is a thin wrapper that auto-installs the Python package. It requires Python 3.10+ and pip on yourPATH. On startup it checks for audio players and warns if none are found. See Prerequisites for full requirements.
Setup with Claude Desktop
Add to your claude_desktop_config.json:
Or after npm publish, use the npm shim:
Setup with Cursor / VS Code
Add the same MCP server config in your editor's MCP settings. The config format is the same as Claude Desktop.
Setup with Claude Code
MCP Tools
Install with MCP support
This installs the voice-bridge-mcp command as an alternative to python3 -m voice_bridge.mcp.server.
Development
License
MIT. See LICENSE for details.
The edge-tts optional dependency is licensed under GPL-3.0. It is not included in the base install.
來源:README.md,提交 113e0bc
工具
0版本歷史
1- v0.1.5最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分