MCP 助手
- 作者仓库星标 39
- 作者仓库 awesome-omni-skill
Vox — Claude Code Skill
Project Overview
Vox is a lightweight voice MCP server (~1,500 lines of Rust) providing local text-to-speech (Kokoro) and speech-to-text (Moonshine Base) via the MCP protocol. It runs as a stdio subprocess per MCP client, or as a shared HTTP daemon.
Build & Test
cargo check # type-check only
cargo test # run all unit tests (84 tests across 10 modules)
cargo clippy -- -D warnings # lint — must pass with zero warnings
cargo build --release # optimized build (LTO + single codegen unit)
cargo bench -- resample # benchmark resampling
All of cargo test, cargo clippy -- -D warnings, and cargo fmt --check must pass before submitting changes.
Architecture
| Module | Purpose |
|---|---|
main.rs |
Entry point, config loading, model download, stdio/daemon startup |
cli.rs |
Clap CLI parser: daemon, config, download-models subcommands |
server.rs |
MCP tool handlers (say, listen, converse), streaming TTS pipeline |
tts.rs |
Kokoro TTS engine wrapper, voice name → speaker ID resolution, sentence splitting |
audio.rs |
cpal-based mic capture and speaker playback, Lanczos-3 sinc resampling |
stt.rs |
Moonshine Base STT engine wrapper |
vad.rs |
Voice activity detection (Silero ONNX) |
config.rs |
TOML config loading, env var overrides (VOX_* prefix), path resolution |
daemon.rs |
HTTP daemon lifecycle: daemonize, PID file, start/stop/status/log |
models.rs |
Model readiness checks and download/extraction |
lib.rs |
Public re-exports for benchmarks (audio, config, error, tts) |
error.rs |
VoiceError enum with thiserror derives |
Transport Modes
- Stdio (default):
rmcp::transport::stdio(). One process per MCP client. - Daemon (
vox daemon start [--port PORT]):StreamableHttpServicevia rmcp. Single process, models loaded once, multiple clients connect over HTTP/SSE. Factory closure creates aVoiceMcpServerper session with sharedArc<Mutex<TtsEngine>>andArc<Mutex<SttEngine>>.
Config System
Precedence (highest wins):
- Environment variables:
VOX_SPEED,VOX_VOICE,VOX_MODEL_DIR,VOX_LOG_LEVEL,VOX_PORT - TOML file:
$XDG_CONFIG_HOME/vox/config.toml - Compiled defaults (
Config::default())
CLI management: vox config get [key], vox config set <key> <value>, vox config path
MCP Tools
| Tool | Description |
|---|---|
say |
Speak text aloud through speakers (TTS only) |
listen |
Record from microphone and transcribe (STT only) |
converse |
Speak text then listen for response (TTS + STT round-trip) |
Available Voices
American female (af_*): heart, alloy, aoede, bella, jessica, kore, nicole, nova, river, sarah, sky
American male (am_*): adam, echo, eric, liam, michael, onyx, puck, santa
British female (bf_*): alice, emma, lily
British male (bm_*): daniel, fable, george, lewis
Default: af_heart (ID 0). Voices can be specified by name or numeric ID.
Code Conventions
- Edition 2024 — uses
letchains (if let Ok(x) = ... && let Ok(y) = ...) - Visibility:
pub(crate)for test-only exposure, not fullypub - Clippy: treat all warnings as errors (
-D warnings) - Tests: inline
#[cfg(test)] mod testsper module,tempfilefor filesystem tests unsafe impl Send:TtsEngineandCaptureHandlehave manualSendimpls due to non-Send cpal/sherpa internals confined to dedicated threads
Dev Workflow
- Make changes
cargo test— verify all 84 tests passcargo clippy -- -D warnings— zero warningscargo fmt --check— formatting- If touching
audio.rsresampling:cargo bench -- resample
- 流狐分类
- AI 智能 · mcp · voice · tts
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 98 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @diegosouzapw · v0.1.0 · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 需简单配置
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- 未声明
- 底层运行要求
- 未声明
- 检测到的文件与系统行为
-
- 只读
- Shell 执行
- 读取环境变量
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
作者没有在当前 SKILL.md 中定义固定输出样例。 Vox is a lightweight voice MCP server (~1,500 lines of Rust) providing local text-to-speech (Kokoro) and speech-to-text (Moonshine Base) via the MCP protocol. It runs as a stdio subprocess per MCP client, or as a shared HTTP daemon.
All of cargo test, cargo clippy -- -D warnings, and cargo fmt --check must pass before submitting changes.
Module · Purpose main.rs · Entry point, config loading, model download, stdio/daemon startup cli.rs · Clap CLI parser: daemon, config, download-models subcommands
Stdio (default): rmcp::transport::stdio(). One process per MCP client. Daemon (vox daemon start [--port PORT]): StreamableHttpService via rmcp. Single process, models loaded once, multiple clients connect over HTTP/SSE. Factory closure creates a VoiceMcpServer…
Precedence (highest wins): Environment variables: VOXSPEED, VOXVOICE, VOXMODELDIR, VOXLOGLEVEL, VOXPORT TOML file: $XDGCONFIGHOME/vox/config.toml
Tool · Description say · Speak text aloud through speakers (TTS only) listen · Record from microphone and transcribe (STT only)
# Vox — Claude Code Skill
## Project Overview
Vox is a lightweight voice MCP server (~1,500 lines of Rust) providing local text-to-speech (Kokoro) and speech-to-text (Moonshine Base) via the MCP protocol. It runs as a stdio subprocess per MCP client, or as a shared HTTP daemon.
## Build & Test
```bash
cargo check # type-check only
cargo test # run all unit tests (84 tests across 10 modules)
cargo clippy -- -D warnings # lint — must pass with zero warnings
cargo build --release # optimized build (LTO + single codegen unit)
cargo bench -- resample # benchmark resampling
```
All of `cargo test`, `cargo clippy -- -D warnings`, and `cargo fmt --check` must pass before submitting changes.
## Architecture
| Module | Purpose |
|--------|---------|
| `main.rs` | Entry point, config loading, model download, stdio/daemon startup |
| `cli.rs` | Clap CLI parser: daemon, config, download-models subcommands |
| `server.rs` | MCP tool handlers (`say`, `listen`, `converse`), streaming TTS pipeline |
| `tts.rs` | Kokoro TTS engine wrapper, voice name → speaker ID resolution, sentence splitting |
| `audio.rs` | cpal-based mic capture and speaker playback, Lanczos-3 sinc resampling |
| `stt.rs` | Moonshine Base STT engine wrapper |
| `vad.rs` | Voice activity detection (Silero ONNX) |
| `config.rs` | TOML config loading, env var overrides (`VOX_*` prefix), path resolution |
| `daemon.rs` | HTTP daemon lifecycle: daemonize, PID file, start/stop/status/log |
| `models.rs` | Model readiness checks and download/extraction |
| `lib.rs` | Public re-exports for benchmarks (`audio`, `config`, `error`, `tts`) |
| `error.rs` | `VoiceError` enum with `thiserror` derives |
## Transport Modes
… 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Project Overview → Build & Test → Architecture → Transport Modes → Config System → MCP Tools
要点 -> Stdio · Daemon · Edition 2024 · Visibility · Clippy · Tests · unsafe impl Send
文件/命令 -> cargo test · cargo clippy -- -D warnings · cargo fmt --check · main.rs · cli.rs · server.rs · say · listen
内容 SHA-256 -> 248b48e816d1
方法与流程
适用与边界
原文中的明确线索
cargo test、cargo clippy -- -D warnings、cargo fmt --check、main.rs、cli.rs、server.rs、say、listen