Skip to main content
Glama
README.md
<!-- mcp-name: io.github.RIAEvangelist/roshi-speech-mcp -->

<p align="center">
  <a href="https://riaevangelist.github.io/roshi-speech-mcp/"><img src="https://raw.githubusercontent.com/RIAEvangelist/roshi-speech-mcp/main/assets/roshi-speech-mcp-header.png" alt="Roshi's Speech MCP — Roshi meditating in a warm acoustic voice studio with glowing speaker medallion and soundwaves" width="100%"></a>
</p>

<h1 align="center">Roshi's Speech MCP</h1>

<p align="center">
  <strong>100% Local Fast &amp; High-Quality Speech Output, Audio Generation &amp; Trigger Daemon</strong><br>
  Antigravity Plugin · Claude Code &amp; Codex Plugin · Open MCP 2.x Server · Standalone CLI · OpenAI-Compatible Local TTS API
</p>

<p align="center">
  <a href="https://riaevangelist.github.io/roshi-speech-mcp/"><strong>Live Documentation Site</strong></a> ·
  <a href="https://riaevangelist.github.io/roshi-speech-mcp/engines.html"><strong>Audio Samples (Kokoro, Magpie, Qwen3)</strong></a> ·
  <a href="https://riaevangelist.github.io/roshi-speech-mcp/triggers.html"><strong>Hooks &amp; Trigger Daemon</strong></a> ·
  <a href="https://pypi.org/project/roshi-speech-mcp/"><strong>PyPI (<code>uvx</code>)</strong></a> ·
  <a href="https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.RIAEvangelist/roshi-speech-mcp"><strong>Official MCP Registry</strong></a> ·
  <a href="https://glama.ai/mcp/servers/RIAEvangelist/roshi-speech-mcp"><strong>Glama</strong></a>
</p>

---

## Why Roshi's Speech MCP?

Give Antigravity, your scripts, watch rules, and automations a **100% local voice** — so your system can speak to you when builds finish, when an agent needs your attention, or when a Recorder/Signal event arrives, **without** cloud TTS APIs, latency spikes, or overlapping chaotic audio.

Just like **Roshi's Transcription MCP**, you get **fast**, **native CUDA C++**, and **expressive high-quality** local tiers side by side:

| Profile | Engine | Hardware | Speed / Footprint | Best For |
|---|---|---|---|---|
| **`instant`** | OS Native (`System.Speech` SAPI / `say` / `espeak-ng`) | Any CPU | ~50 ms · 0 downloads | Guaranteed offline safety fallback |
| **`fast`** *(default)* | **Kokoro-82M (`kokoro-onnx`)** | CPU or GPU | ~80–600 ms warm · ~350 MB | Crisp, natural everyday updates, attention hooks, 50+ voices & **voice blending** (`af_heart:0.6+am_michael:0.4`) |
| **`magpie`** | **NVIDIA Magpie TTS 357M (`NeMo-Speech.cpp` + NanoCodec)** | NVIDIA GPU (CUDA C++) / CPU | Fast native C++ · ~600 MB GGUF | Zero-Python native GPU voices (`Aria`, `Jason`, `John`, `Leo`, `Sofia`) across 12 languages — shares the exact same `nemo-speech` runtime as **Roshi's Transcription MCP** |
| **`quality`** | **Qwen3-TTS (`1.7B` / `0.6B` CustomVoice)** | NVIDIA GPU (CUDA) | ~1–3s warm on RTX GPU · isolated venv | Expressive studio-grade speech with **natural-language style/emotion instructions** (`instruct`) |
| **`design`** | **Qwen3-TTS (`1.7B-VoiceDesign`)** | NVIDIA GPU (CUDA) | ~1–3s warm on RTX GPU | Invent any custom voice from a plain-English description |
| **`clone`** | **Qwen3-TTS (`1.7B-Base` / `0.6B-Base`)** | NVIDIA GPU (CUDA) | ~1–3s warm on RTX GPU | 3-second zero-shot voice cloning from any local audio clip |

---

## Triggered by Anything (One Clean Non-Overlapping Speaker Queue)

<p align="center">
  <img src="https://raw.githubusercontent.com/RIAEvangelist/roshi-speech-mcp/main/assets/roshi-spoken-briefing.png" alt="Roshi listening hands-free over tea as his computer delivers a glowing local spoken briefing and chime notification" width="100%">
</p>

1. **MCP Tools** (`speak`, `notify`, `generate_audio`, `play_audio`, `stop_speaking`, `manage_voice_profiles`, `manage_settings`, `manage_trigger_daemon`, `manage_hooks`).
2. **Antigravity Lifecycle Hooks** (`hooks.json` + `run_hook.py`): Non-blocking spoken alerts when Antigravity asks a question (`ask_question`), hits an error, pauses at a limit, or finishes a turn. Toggle anytime with `manage_hooks(action="enable"|"disable")`.
3. **Warm Local Trigger Daemon (`http://127.0.0.1:8765`)**:
   - Keeps models warm in memory and serializes audio from all callers into one priority queue (with `interrupt=True`, quiet hours, mute toggle, and cooldown deduplication).
   - `POST /speak`, `POST /notify`, `POST /chime`, `POST /play`, `POST /generate`, `POST /stop`, `GET /health`.
   - **OpenAI-Compatible `POST /v1/audio/speech`** (`tts-1` -> Kokoro fast; `tts-1-hd` -> Qwen3-TTS quality) so Open WebUI, Home Assistant, n8n, or any OpenAI TTS client works 100% locally.
4. **Drop-Folder Inbox Watcher (`~/RoshiSpeech/inbox/`)**: Drop any `.txt` or `.json` file from a batch script, cron job, or external automation and the daemon speaks it immediately.
5. **Cross-MCP Integration**: Plug `speech-tool.ps1 notify attention "..."` directly into **Roshi's Recorder MCP** or **Roshi's Signal MCP** watch rules.

---

## Quick Setup (Windows)

```powershell
# Install plugin into ~/.gemini/config/plugins/roshi-speech-mcp + download fast Kokoro-82M models + start trigger daemon
.\setup.ps1 -InstallPlugin -StartDaemon

# Also install isolated CUDA GPU venv for high-quality Qwen3-TTS
.\setup.ps1 -InstallPlugin -InstallQuality -PreloadQwenModel 1.7b-custom -StartDaemon
```

### Quick CLI Examples

```powershell
# Speak immediately (fast Kokoro-82M)
.\speech-tool.ps1 speak "Hey Roshi, the deployment succeeded." --chime done

# Native CUDA C++ NVIDIA Magpie 357M (NeMo-Speech.cpp)
.\speech-tool.ps1 speak "Morning briefing ready via NVIDIA Magpie." --profile magpie --voice Aria --speed 1.05

# Voice blending (Kokoro-82M)
.\speech-tool.ps1 speak "Blending two Kokoro voices." --voice "af_heart:0.6+am_michael:0.4"

# Attention notification
.\speech-tool.ps1 notify attention "Antigravity needs your input."

# High-quality GPU narration with style instruction
.\speech-tool.ps1 generate "Welcome to your morning briefing." --profile quality --voice Ryan --instruct "Speak warmly and calmly like a studio narrator" --out "$HOME\RoshiSpeech\briefing.wav" --play

# Trigger over localhost HTTP from any script
Invoke-RestMethod -Uri "http://127.0.0.1:8765/notify" -Method Post -ContentType "application/json" -Body '{"event_type":"done","message":"Tests passed!"}'
```