Agentic Voice
Local voice output for coding agents, backed by a local TTS bridge. The default backend (bridge/) runs Kokoro-82M — an open TTS model by hexgrad, unrelated to NVIDIA — via FluidAudio's Apple Neural Engine runtime, entirely on-device.
The MVP exposes a single MCP tool, speak, and a small CLI, both in one Swift command, agentic-voice. Both paths share the same application service, so agent-triggered speech and deterministic lifecycle hooks do not duplicate TTS or playback logic.
Goals
- Let an agent speak short questions, blockers, and completion summaries.
- Keep detailed output in the normal text UI; voice is a concise attention layer.
- Run TTS locally or on another machine reachable over HTTP.
- Keep the implementation small enough to understand and modify without framework overhead.
Non-goals
- Speech-to-text or full duplex conversation.
- An embedded LLM summarizer. The calling agent should summarize before invoking
speak.
- Queues, persistence, web UI, telemetry, or multi-provider abstraction in the MVP.
Architecture
Agent / lifecycle hook
|
+-- MCP speak tool
| |
+-- CLI -+
|
VoiceService
/ \
TTS client Audio player
| |
POST /v1/audio/synthesize afplay/custom command
The HTTP endpoint above is served locally by the bundled bridge/ by default; any HTTP service implementing the same contract (see "TTS HTTP contract" below) works.
Responsibilities are intentionally narrow. The command is in bridge/Sources/AgenticVoiceCLI/, everything it runs in the AgenticVoiceKit library (bridge/Sources/AgenticVoiceKit/), which the macOS app shares:
MCPServer.swift (CLI) — MCP boundary and startup/shutdown wiring, on the official MCP Swift SDK.
Speak.swift and InstallClients.swift (CLI) — command-line boundaries only.
VoiceService.swift — use-case orchestration and speech-length policy.
TTSClient.swift — TTS HTTP client only.
BridgeProcess.swift — readiness and ownership of the separate bridge process.
AudioPlayer.swift — local playback and the speaking lock only.
Config.swift — configuration (environment, .env, settings file) only.
Clients/ — writing agentic-voice entries into client config files only.
SpeechEvents.swift — the speech started/ended notifications the app's speaking overlay listens for only.
Requirements
- macOS 26+ on Apple Silicon with Xcode 26+ / Swift 6.2+ to build.
- A built bundled bridge, or an externally managed TTS backend. MCP automatically starts the bundled bridge at
http://127.0.0.1:9000 when needed.
- A local WAV player:
afplay, unless overridden.
The TTS backend can run on a separate machine reachable over HTTP — set TTS_URL to that host.
Configure
cp .env.example .env
Create .env in the plugin/repository root. MCP and CLI resolve it from the location of the agentic-voice executable (<root>/bridge/.build/release/agentic-voice), independently of the calling project's working directory. Existing environment variables take precedence over .env.
Voice and speed can also come from the shared settings file ~/Library/Application Support/AgenticVoice/config.json ({"voice": "af_bella", "speed": 1.1}), which the Agentic Voice macOS app writes. Precedence: environment variables, then .env, then the settings file, then defaults. The MCP server re-reads voice and speed on every speak call, so changes apply without a restart; TTS_URL is fixed when MCP starts. A .env copied from an older .env.example sets TTS_VOICE and VOICE_SPEED, which hide the settings file; remove those lines to use it.
Environment variables:
| Variable | Default | Purpose |
|---|
TTS_URL | http://127.0.0.1:9000 | Base URL of the TTS backend |
TTS_VOICE | am_michael | Voice id — see bridge/README.md for the full roster |
TTS_LANGUAGE | en-US | Locale sent to TTS |
VOICE_SPEED | 1.0 | Playback speed multiplier sent to TTS |
VOICE_MAX_CHARS | 1200 | Hard limit for spoken text. Longer text is synthesized in chunks of up to 320 characters, each prepared while the one before it plays |
VOICE_PLAYBACK_COMMAND | auto | Optional playback executable |
Install and run
swift build -c release --package-path bridge # agentic-voice, TTSBridge and the app
swift test --package-path bridge
Run the MCP server over stdio:
bridge/.build/release/agentic-voice mcp