Skip to main content

Voice interaction capabilities for Model Context Protocol (MCP) servers

Project description

voice-mcp - Voice Mode for Claude Code

A Model Context Protocol (MCP) server that enables voice interactions with Claude and other LLMs. Requires only an OpenAI API key and microphone/speakers.

๐Ÿ–ฅ๏ธ 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:

  1. ๐Ÿ”‘ OpenAI API Key (or compatible service) - for speech-to-text and text-to-speech
  2. ๐ŸŽค Computer with microphone and speakers OR โ˜๏ธ LiveKit server (LiveKit Cloud or self-hosted)

Quick Start

Setup for Claude Code:

export OPENAI_API_KEY=your-openai-key
claude mcp add voice-mcp uvx voice-mcp
claude

Try: "Let's have a voice conversation"

๐ŸŽฌ Demo

Watch voice-mcp in action:

voice-mcp Demo

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.

Claude Desktop Setup

Add to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

Using uvx (recommended)
{
  "mcpServers": {
    "voice-mcp": {
      "command": "uvx",
      "args": ["voice-mcp"],
      "env": {
        "OPENAI_API_KEY": "your-openai-key"
      }
    }
  }
}
Using pip install
{
  "mcpServers": {
    "voice-mcp": {
      "command": "voice-mcp",
      "env": {
        "OPENAI_API_KEY": "your-openai-key"
      }
    }
  }
}

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 VOICE_MCP_DEBUG="true"

# Save all audio (TTS output and STT input)
export VOICE_MCP_SAVE_AUDIO="true"

Local STT/TTS Services

For privacy-focused or offline usage, voice-mcp 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-mcp enables powerful deployment flexibility:

  • ๐Ÿ”€ Transparent Routing: Users can implement their own API proxies or gateways outside of voice-mcp 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-mcp 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-mcp now uses your router for all OpenAI API calls

The OpenAI SDK handles this automatically - no voice-mcp 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
  • UV not found: Install with curl -LsSf https://astral.sh/uv/install.sh | sh
  • OpenAI API error: Verify your OPENAI_API_KEY is set correctly
  • No audio output: Check system audio settings and available devices

Debug Mode

Enable detailed logging and audio file saving:

export VOICE_MCP_DEBUG=true

Debug audio files are saved to: ~/voice-mcp_recordings/

Audio Saving

To save all audio files (both TTS output and STT input):

export VOICE_MCP_SAVE_AUDIO=true

Audio files are saved to: ~/voice-mcp_audio/ with timestamps in the filename.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

voice_mcp-0.1.24.tar.gz (27.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

voice_mcp-0.1.24-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

Details for the file voice_mcp-0.1.24.tar.gz.

File metadata

  • Download URL: voice_mcp-0.1.24.tar.gz
  • Upload date:
  • Size: 27.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for voice_mcp-0.1.24.tar.gz
Algorithm Hash digest
SHA256 8c31c7213bc798b17e2dc268297d8b7bdc2ec2f7fe719bb907f6265e87fd65ab
MD5 8df63818897f3d6e7d0ff14f864ecbcf
BLAKE2b-256 8cda6a6c53d35d5fbe9295c1cb3aca50bbe42bb4fec498c91f2a30d879a02731

See more details on using hashes here.

File details

Details for the file voice_mcp-0.1.24-py3-none-any.whl.

File metadata

  • Download URL: voice_mcp-0.1.24-py3-none-any.whl
  • Upload date:
  • Size: 27.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for voice_mcp-0.1.24-py3-none-any.whl
Algorithm Hash digest
SHA256 87e8fe0c694d1960c3baa9248387d5abfce640cfcd795bde815e434956ea555e
MD5 4112a8b52719c0923f78819551e062e7
BLAKE2b-256 8ce649e845f006cb4b1ecfd50d38274a54df3e9839fca0937becf5be96855559

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page