Voice interaction capabilities for Model Context Protocol (MCP) servers
Project description
Voice Mode
Install via:
uvx voice-mode|pip install voice-mode| getvoicemode.com
Natural voice conversations for AI assistants. Voice Mode brings human-like voice interactions to Claude, ChatGPT, and other LLMs through the Model Context Protocol (MCP).
๐ฅ๏ธ Compatibility
Runs on: Linux โข macOS โข Windows (WSL) | Python: 3.10+ | Tested: Ubuntu 24.04 LTS, Fedora 42
โจ Features
- ๐๏ธ Voice conversations with Claude - ask questions and hear responses
- ๐ Multiple transports - local microphone or LiveKit room-based communication
- ๐ฃ๏ธ OpenAI-compatible - works with any STT/TTS service (local or cloud)
- โก Real-time - low-latency voice interactions with automatic transport selection
- ๐ง MCP Integration - seamless with Claude Desktop and other MCP clients
๐ฏ Simple Requirements
All you need to get started:
- ๐ OpenAI API Key (or compatible service) - for speech-to-text and text-to-speech
- ๐ค Computer with microphone and speakers OR โ๏ธ LiveKit server (LiveKit Cloud or self-hosted)
Quick Start
claude mcp add --scope user voice-mode uvx voice-mode
export OPENAI_API_KEY=your-openai-key
claude
> /converse
๐ฌ Demo
Watch Voice Mode in action:
Example Usage
Once configured, try these prompts with Claude:
"Let's have a voice conversation""Ask me about my day using voice""Tell me a joke"(Claude will speak and wait for your response)"Say goodbye"(Claude will speak without waiting)
The new converse function makes voice interactions more natural - it automatically waits for your response by default.
Installation
Prerequisites
- Python >= 3.10
- Astral UV - Package manager (install with
curl -LsSf https://astral.sh/uv/install.sh | sh) - OpenAI API Key (or compatible service)
System Dependencies
Ubuntu/Debian
sudo apt install python3-dev libasound2-dev libportaudio2 portaudio19-dev ffmpeg
Fedora/RHEL
sudo dnf install python3-devel alsa-lib-devel portaudio-devel ffmpeg
macOS
# Install Homebrew if not already installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install dependencies
brew install portaudio ffmpeg
Windows (WSL)
Follow the Ubuntu/Debian instructions above within WSL.
Quick Install
# Using Claude Code (recommended)
claude mcp add --scope user voice-mode uvx voice-mode
# Using UV
uvx voice-mode
# Using pip
pip install voice-mode
Manual Configuration for Different Clients
Claude Code (CLI)
claude mcp add voice-mode -- uvx voice-mode
Or with environment variables:
claude mcp add voice-mode --env OPENAI_API_KEY=your-openai-key -- uvx voice-mode
Claude Desktop
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"voice-mode": {
"command": "uvx",
"args": ["voice-mode"],
"env": {
"OPENAI_API_KEY": "your-openai-key"
}
}
}
}
Cline
Add to your Cline MCP settings:
Windows:
{
"mcpServers": {
"voice-mode": {
"command": "cmd",
"args": ["/c", "uvx", "voice-mode"],
"env": {
"OPENAI_API_KEY": "your-openai-key"
}
}
}
}
macOS/Linux:
{
"mcpServers": {
"voice-mode": {
"command": "uvx",
"args": ["voice-mode"],
"env": {
"OPENAI_API_KEY": "your-openai-key"
}
}
}
}
Continue
Add to your .continue/config.json:
{
"experimental": {
"modelContextProtocolServers": [
{
"transport": {
"type": "stdio",
"command": "uvx",
"args": ["voice-mode"],
"env": {
"OPENAI_API_KEY": "your-openai-key"
}
}
}
]
}
}
Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"voice-mode": {
"command": "uvx",
"args": ["voice-mode"],
"env": {
"OPENAI_API_KEY": "your-openai-key"
}
}
}
}
VS Code
Add to your VS Code MCP config:
{
"mcpServers": {
"voice-mode": {
"command": "uvx",
"args": ["voice-mode"],
"env": {
"OPENAI_API_KEY": "your-openai-key"
}
}
}
}
Windsurf
{
"mcpServers": {
"voice-mode": {
"command": "uvx",
"args": ["voice-mode"],
"env": {
"OPENAI_API_KEY": "your-openai-key"
}
}
}
}
Zed
Add to your Zed settings.json:
{
"context_servers": {
"voice-mode": {
"command": {
"path": "uvx",
"args": ["voice-mode"],
"env": {
"OPENAI_API_KEY": "your-openai-key"
}
}
}
}
}
Roo Code
Add to your Roo Code MCP configuration:
{
"mcpServers": {
"voice-mode": {
"command": "uvx",
"args": ["voice-mode"],
"env": {
"OPENAI_API_KEY": "your-openai-key"
}
}
}
}
Alternative Installation Options
Using Docker
docker run -it --rm \
-e OPENAI_API_KEY=your-openai-key \
--device /dev/snd \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=$DISPLAY \
ghcr.io/mbailey/voicemode:latest
Using pipx
pipx install voice-mode
From source
git clone https://github.com/mbailey/voicemode.git
cd voicemode
pip install -e .
Tools
| Tool | Description | Key Parameters |
|---|---|---|
converse |
Have a voice conversation - speak and optionally listen | message, wait_for_response (default: true), listen_duration (default: 10s), transport (auto/local/livekit) |
listen_for_speech |
Listen for speech and convert to text | duration (default: 5s) |
check_room_status |
Check LiveKit room status and participants | None |
check_audio_devices |
List available audio input/output devices | None |
start_kokoro |
Start the Kokoro TTS service | models_dir (optional, defaults to ~/Models/kokoro) |
stop_kokoro |
Stop the Kokoro TTS service | None |
kokoro_status |
Check the status of Kokoro TTS service | None |
Note: The converse tool is the primary interface for voice interactions, combining speaking and listening in a natural flow.
Configuration
๐ See docs/configuration.md for complete setup instructions for all MCP hosts
๐ Ready-to-use config files in config-examples/
Quick Setup
The only required configuration is your OpenAI API key:
export OPENAI_API_KEY="your-key"
Optional Settings
# Custom STT/TTS services (OpenAI-compatible)
export STT_BASE_URL="http://localhost:2022/v1" # Local Whisper
export TTS_BASE_URL="http://localhost:8880/v1" # Local TTS
export TTS_VOICE="alloy" # Voice selection
# LiveKit (for room-based communication)
# See docs/livekit/ for setup guide
export LIVEKIT_URL="wss://your-app.livekit.cloud"
export LIVEKIT_API_KEY="your-api-key"
export LIVEKIT_API_SECRET="your-api-secret"
# Debug mode
export VOICEMODE_DEBUG="true"
# Save all audio (TTS output and STT input)
export VOICEMODE_SAVE_AUDIO="true"
# Audio format configuration (default: pcm)
export VOICEMODE_AUDIO_FORMAT="pcm" # Options: pcm, mp3, wav, flac, aac, opus
export VOICEMODE_TTS_AUDIO_FORMAT="pcm" # Override for TTS only (default: pcm)
export VOICEMODE_STT_AUDIO_FORMAT="mp3" # Override for STT upload
# Format-specific quality settings
export VOICEMODE_OPUS_BITRATE="32000" # Opus bitrate (default: 32kbps)
export VOICEMODE_MP3_BITRATE="64k" # MP3 bitrate (default: 64k)
Audio Format Configuration
Voice Mode uses PCM audio format by default for TTS streaming for optimal real-time performance:
- PCM (default for TTS): Zero latency, best streaming performance, uncompressed
- MP3: Wide compatibility, good compression for uploads
- WAV: Uncompressed, good for local processing
- FLAC: Lossless compression, good for archival
- AAC: Good compression, Apple ecosystem
- Opus: Small files but NOT recommended for streaming (quality issues)
The audio format is automatically validated against provider capabilities and will fallback to a supported format if needed.
Local STT/TTS Services
For privacy-focused or offline usage, Voice Mode supports local speech services:
- Whisper.cpp - Local speech-to-text with OpenAI-compatible API
- Kokoro - Local text-to-speech with multiple voice options
These services provide the same API interface as OpenAI, allowing seamless switching between cloud and local processing.
OpenAI API Compatibility Benefits
By strictly adhering to OpenAI's API standard, Voice Mode enables powerful deployment flexibility:
- ๐ Transparent Routing: Users can implement their own API proxies or gateways outside of Voice Mode to route requests to different providers based on custom logic (cost, latency, availability, etc.)
- ๐ฏ Model Selection: Deploy routing layers that select optimal models per request without modifying Voice Mode configuration
- ๐ฐ Cost Optimization: Build intelligent routers that balance between expensive cloud APIs and free local models
- ๐ง No Lock-in: Switch providers by simply changing the
BASE_URL- no code changes required
Example: Simply set OPENAI_BASE_URL to point to your custom router:
export OPENAI_BASE_URL="https://router.example.com/v1"
export OPENAI_API_KEY="your-key"
# Voice Mode now uses your router for all OpenAI API calls
The OpenAI SDK handles this automatically - no Voice Mode configuration needed!
Architecture
โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ
โ Claude/LLM โ โ LiveKit Server โ โ Voice Frontend โ
โ (MCP Client) โโโโโโโบโ (Optional) โโโโโโบโ (Optional) โ
โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ Voice MCP Server โ โ Audio Services โ
โ โข converse โ โ โข OpenAI APIs โ
โ โข listen_for_speechโโโโโโบโ โข Local Whisper โ
โ โข check_room_statusโ โ โข Local TTS โ
โ โข check_audio_devices โโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโ
Troubleshooting
Common Issues
- No microphone access: Check system permissions for terminal/application
- WSL2 Users: See WSL2 Microphone Access Guide
- UV not found: Install with
curl -LsSf https://astral.sh/uv/install.sh | sh - OpenAI API error: Verify your
OPENAI_API_KEYis set correctly - No audio output: Check system audio settings and available devices
Debug Mode
Enable detailed logging and audio file saving:
export VOICEMODE_DEBUG=true
Debug audio files are saved to: ~/voicemode_recordings/
Audio Diagnostics
Run the diagnostic script to check your audio setup:
python scripts/diagnose-wsl-audio.py
This will check for required packages, audio services, and provide specific recommendations.
Audio Saving
To save all audio files (both TTS output and STT input):
export VOICEMODE_SAVE_AUDIO=true
Audio files are saved to: ~/voicemode_audio/ with timestamps in the filename.
Links
- Website: getvoicemode.com
- GitHub: github.com/mbailey/voicemode
- PyPI: pypi.org/project/voice-mcp
- npm: npmjs.com/package/voicemode
Community
- Discord: Join our community
- Twitter/X: @getvoicemode
- YouTube: @getvoicemode
License
MIT - A Failmode Project
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file voice_mcp-2.3.0.tar.gz.
File metadata
- Download URL: voice_mcp-2.3.0.tar.gz
- Upload date:
- Size: 67.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
850f2d5d43f659bd42b7242425cbbd200ae56ea63b87c4da410e2af9203eaf3d
|
|
| MD5 |
a92c13300c8a3e767afcb03b85577dad
|
|
| BLAKE2b-256 |
480ff9076ea8d1c1c4edf65289dfad16634d2b155ceff3f0740b2b4896c17387
|
File details
Details for the file voice_mcp-2.3.0-py3-none-any.whl.
File metadata
- Download URL: voice_mcp-2.3.0-py3-none-any.whl
- Upload date:
- Size: 75.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8230151349020535ba29b2f4be3ad44cf67a51560cc54f8e7b2aa8fce7d5f8cc
|
|
| MD5 |
10d5e4cad72beafe179edd62d216fbe5
|
|
| BLAKE2b-256 |
f200e32caa2edaa978768d020b9e9b7fc3b4c7c5537d95d2a3329941c8aea142
|