Voice MCP Server
Provides text-to-speech generation and playback via the ElevenLabs API, enabling the server to speak aloud on demand.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Voice MCP ServerSay 'Hello, this is a test of the voice system.'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Voice MCP Server
MCP stdio server that lets Codex speak on demand. Codex starts the local stdio
process, calls voice_speak, the server generates the audio, plays it through
the system output, returns the tool result, and then waits for the next MCP
request from the client.
Quick Start
npm install
npm run buildSet a real provider before starting the MCP server. To use ElevenLabs:
export VOICE_PROVIDER="elevenlabs"
export ELEVENLABS_API_KEY="..."
npm run buildTo use OpenAI Realtime streaming audio:
export VOICE_PROVIDER="openai-realtime"
export OPENAI_API_KEY="..."
export OPENAI_REALTIME_MODEL="gpt-realtime-2.1-mini"
npm run buildThe Realtime provider is text-in/audio-out. It does not listen to the
microphone. voice_speak sends the requested text as a Realtime conversation
item, receives response.output_audio.delta chunks, and streams 24 kHz mono
PCM audio to the local player as it arrives.
The transport is MCP over stdio; Codex starts dist/index.js directly.
You do not run this as a daemon or keep a separate terminal open.
After changing configuration or rebuilding, restart the MCP client/session so it
loads the updated environment and compiled code.
Related MCP server: Kokoro TTS MCP Server
Provider Setup
The supported speech providers are elevenlabs and openai-realtime. The
server does not silently fall back to a local test tone when credentials are
missing; it fails startup with a configuration error instead.
Provider | Use it when | Billing model | Required key |
| You want regular text-to-speech with ElevenLabs voices, free-tier testing, and cached generated audio. | ElevenLabs credits/characters. The free plan is assigned automatically when you sign up. |
|
| You want OpenAI Realtime voices and low-latency streaming from the Realtime API. | OpenAI API usage. This consumes API credits and is separate from any ChatGPT/Codex subscription. |
|
ElevenLabs Free API Key
Create a free ElevenLabs account at elevenlabs.io.
Open the ElevenLabs dashboard.
Go to
Developersin the left sidebar, thenAPI Keys.Create a new API key. For this server, enable Text to Speech access; setting a key-specific credit limit is a good guardrail.
Copy the key when it is created. ElevenLabs only shows the full key once.
Set it in your MCP config or environment:
export VOICE_PROVIDER="elevenlabs"
export ELEVENLABS_API_KEY="..."
export ELEVENLABS_MODEL_ID="eleven_flash_v2_5"
export ELEVENLABS_FORMAT="mp3"The ElevenLabs API authenticates requests with the xi-api-key header. Keep the
key secret; do not commit it or expose it in client-side code. See the official
ElevenLabs API key docs
and authentication reference.
The free plan includes a monthly credit quota; generated speech consumes those
credits even when you use the API.
OpenAI Realtime API Key
Use openai-realtime only when you intentionally want to use OpenAI API
billing for speech output. This server defaults to gpt-realtime-2.1-mini for
OpenAI Realtime because it is much cheaper and is usually enough for text-to-speech
playback. Switch to gpt-realtime-2.1 only when you need the higher-quality model.
export VOICE_PROVIDER="openai-realtime"
export OPENAI_API_KEY="..."
export OPENAI_REALTIME_MODEL="gpt-realtime-2.1-mini"
export OPENAI_REALTIME_VOICE="marin"
export OPENAI_REALTIME_FORMAT="pcm16"This provider sends text to the Realtime API and receives streamed 24 kHz mono PCM audio. It does not listen to the microphone. Realtime is billed by tokens used, not by wall-clock session time alone. An idle open session should not be the expensive part; generated audio output tokens are. Apps that continuously send microphone audio can still spend audio input tokens while they are open, but this MCP does not send microphone audio. For cost predictability, this server closes the Realtime connection after each generated response instead of keeping a long conversation session open.
Pricing Reference
Prices change, so check the provider pricing pages before heavy usage: ElevenLabs API pricing and OpenAI pricing. The figures below were checked on 2026-08-02.
Provider/model | Unit | Price | Notes |
ElevenLabs Flash/Turbo TTS | 1,000 text characters | $0.05 | The default |
ElevenLabs Multilingual v2/v3 TTS | 1,000 text characters | $0.10 | Relevant if you switch to a multilingual model. |
OpenAI | 1M text tokens | $4.00 | This server sends text input. |
OpenAI | 1M text tokens | $24.00 | Usually not the main cost for this server. |
OpenAI | 1M audio tokens | $32.00 | Not normally used here because the server does not send microphone audio. |
OpenAI | 1M audio tokens | $64.00 | This is the main OpenAI Realtime cost for speech playback. |
OpenAI | 1M text tokens | $0.60 | Recommended OpenAI Realtime default for this server. |
OpenAI | 1M text tokens | $2.40 | Usually not the main cost for this server. |
OpenAI | 1M audio tokens | $20.00 | Lower-cost Realtime option if quality is good enough for your use case. |
Example phrase:
Hello, this is a quick voice test.That phrase has 34 text characters.
Provider | Example calculation | Estimated cost |
ElevenLabs Flash/Turbo |
|
|
ElevenLabs Multilingual v2/v3 |
|
|
OpenAI Realtime text input | Text input is roughly |
|
For OpenAI Realtime, the expensive line item is usually generated audio, output. There is no fixed character-to-audio conversion, but a practical
budgeting rule is to estimate about 1,200 audio output tokens for each minute of
generated assistant speech. Check the OpenAI dashboard for the actual billed
token usage.
estimated_audio_output_cost =
generated_speech_minutes * 1,200 * price_per_1m_audio_output_tokens / 1,000,000Estimated OpenAI Realtime audio-output cost:
Generated speech |
|
|
1 minute |
|
|
10 minutes |
|
|
60 minutes |
|
|
The OpenAI examples are illustrative because Realtime billing is based on actual token usage, including audio output tokens. Generated ElevenLabs audio is cached by this server by default; OpenAI Realtime streaming is not cached, so replaying the same text with OpenAI spends API credits again.
Example MCP client configuration:
{
"mcpServers": {
"voice": {
"command": "node",
"args": ["./dist/index.js"],
"cwd": "/Users/francescperez/Documents/voice mcp server",
"env": {
"VOICE_PROVIDER": "elevenlabs",
"ELEVENLABS_API_KEY": "...",
"ELEVENLABS_VOICE_ID": "hpp4J3VqNfWAUOO0d1Us",
"ELEVENLABS_MODEL_ID": "eleven_flash_v2_5",
"ELEVENLABS_FORMAT": "mp3"
}
}
}
}Example OpenAI Realtime MCP client configuration:
{
"mcpServers": {
"voice": {
"command": "node",
"args": ["./dist/index.js"],
"cwd": "/Users/francescperez/Documents/voice mcp server",
"env": {
"VOICE_PROVIDER": "openai-realtime",
"OPENAI_API_KEY": "...",
"OPENAI_REALTIME_MODEL": "gpt-realtime-2.1-mini",
"OPENAI_REALTIME_VOICE": "marin",
"OPENAI_REALTIME_FORMAT": "pcm16"
}
}
}
}The same block is available in .mcp.example.json. Keep real secrets in your
local .env or .mcp.json; both are ignored by git.
Tools
voice_speak: generate and play speech.voice_wait: wait for a playback id to finish.voice_stop: stop current playback and clear pending items.voice_status: return queue/current/history state plus provider diagnostics.voice_is_speaking: return whether audio is currently playing or being prepared.
voice_speak accepts:
{
"text": "Hello",
"waitUntilFinished": true,
"voiceId": "optional voice id",
"speed": 1.0,
"volume": 1.0,
"policy": "enqueue"
}Queue policies are enqueue, interrupt, replace, and discard.
Resources
voice://history: transcript/playback history as JSON.voice://status: current playback status as JSON.
Notifications
The server emits custom JSON-RPC notifications:
voice.startedvoice.progressvoice.finishedvoice.stoppedvoice.error
Configuration
Configuration can come from environment variables or from a file pointed at by
VOICE_MCP_CONFIG or --config. JSON is supported, plus a flat key = value
or key: value file for the keys shown in the design spec.
Example:
provider = "elevenlabs"
api_key = "${ELEVENLABS_API_KEY}"
voice_id = "hpp4J3VqNfWAUOO0d1Us"
model_id = "eleven_flash_v2_5"
format = "mp3"
volume = 1.0
speed = 1.0
output_device = "default"
cache = trueOnly ELEVENLABS_API_KEY is needed for normal ElevenLabs use. Everything else
has a default:
VOICE_PROVIDER: setelevenlabsoropenai-realtime. If unset, the server auto-selectselevenlabsonly whenELEVENLABS_API_KEYexists; otherwise it fails startup.ELEVENLABS_VOICE_ID: defaults tohpp4J3VqNfWAUOO0d1Us.ELEVENLABS_MODEL_ID: defaults toeleven_flash_v2_5.ELEVENLABS_MODEL: legacy alias forELEVENLABS_MODEL_ID.ELEVENLABS_FORMAT: defaults tomp3;mp3maps to ElevenLabsmp3_44100_128.pcm,pcm16, andaudio/pcmmap topcm_24000and are wrapped as WAV before local playback. Other ElevenLabsoutput_formatvalues can be passed through directly.OPENAI_API_KEY: required whenVOICE_PROVIDER=openai-realtime.OPENAI_REALTIME_VOICE: defaults tomarin.OPENAI_REALTIME_MODEL: defaults togpt-realtime-2.1-mini. Usegpt-realtime-2.1only when you need the higher-quality model.OPENAI_REALTIME_FORMAT: defaults topcm16, which maps to 24 kHz mono PCM.OPENAI_REALTIME_INSTRUCTIONS: optional narrator instructions for the Realtime model.VOICE_VOLUME: defaults to1.0.VOICE_SPEED: defaults to1.0.VOICE_OUTPUT_DEVICE: defaults todefault.AUDIO_PLAYER_CMD: optional player command override.AUDIO_STREAM_PLAYER_CMD: optional streaming player command override. Placeholders:{sampleRate},{channels},{encoding}, and{volume}.VOICE_MCP_CONFIG: optional external config file.VOICE_CACHE: defaults totrue. Cache keys include the provider and output format, so switching between providers or ElevenLabs formats does not reuse stale audio from another mode.VOICE_CACHE_DIR: defaults to.voice-cache.
Audio Playback
On macOS the server uses afplay. On Linux it uses aplay for WAV and
ffplay for other formats. You can override the command with
AUDIO_PLAYER_CMD.
ElevenLabs emits MP3 by default; PCM ElevenLabs responses are wrapped as WAV
before playback.
OpenAI Realtime streaming uses ffplay by default:
ffplay -nodisp -autoexit -loglevel quiet -f s16le -sample_rate 24000 -ch_layout mono -volume 100 -i pipe:0Troubleshooting
If playback sounds like a simple tone or beep, you are probably running an older
build or an already-started MCP process from before this change. Rebuild,
restart the MCP client/session, and call voice_status to confirm that
provider is elevenlabs or openai-realtime.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables agents to convert text to speech using OpenAI's TTS models with voice selection, delivery instructions, and queue-based audio playback. Supports both blocking and non-blocking modes for flexible audio generation and playback control.3BSD 3-Clause
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to generate and play high-quality text-to-speech audio using the Kokoro model, with support for multiple voices, adjustable speaking speed, and audio caching.
- FlicenseNot gradedqualityDmaintenanceProvides text-to-speech conversion through a unified MCP interface, supporting both local Kokoro and cloud OpenAI TTS engines with streaming audio, voice selection, and customization via natural language instructions.7
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to synthesize natural speech using either platform system voices or premium OpenAI TTS, with automatic engine selection and graceful fallback.12MIT
Related MCP Connectors
Hosted pay-per-use TTS: 54 neural voices, 9 languages incl. Brazilian Portuguese. $10 free credits.
Voice and chat for AI agents — Discord, Teams, Meet, Slack, Zoom, Telegram, WhatsApp, NC Talk, SIP
AI-manageable audio CDN: upload, transcode, normalize, stream & deliver audio, plus grounded docs.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/francbonet/voice-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server