Talk to your
coding agent

A local MCP server that lets your coding agent talk to you. Sonic 3.6 reads the agent's message aloud. Ink 2 then listens, decides when you have finished, and hands your words back to the agent.
Claude Codecartesia-voice
Done
let's talk
converse

The tests pass. Should I open the pull request?

Yes, open it as a draft.
Opening a draft pull request.
Answer out loud. Ink 2 ends your turn when you stop.

Example run. A scripted example of the app at work, not a recording.

Models
sonic-3.6, ink-2
Languages
English, Spanish, French, Hindi, Japanese
License
Apache-2.0
Stack
PythonFastMCPsounddeviceuv
Cartesia products
Sonic 3.6Ink 2

What it does

It works with Claude Code, Cursor and Codex. There is no push-to-talk key and no silence timeout to tune, because Ink 2 decides when you have finished. It works the same way as mbailey/voicemode, an open-source voice server for coding agents, so an agent that knows one can use the other.

Run it yourself

  1. Get the server

    Run the commands below. You need uv, a microphone and headphones. On Linux, install libportaudio2 first.

    npx degit cartesia-ai/cookbook/examples/coding-voice-mode coding-voice-mode
    cd coding-voice-mode
    export CARTESIA_API_KEY=your-key
    # or cursor, codex, all
    ./setup.sh claude --save-key
    

    Environment variables
    CARTESIA_API_KEY
    play.cartesia.ai/keys
    CARTESIA_VOICE_ID
    Optional. A voice from play.cartesia.ai/voices. Defaults to Daniel (en-US)
    CARTESIA_TURN_END_TIMEOUT_MS
    Optional. 640 to 11200, how long a pause can be before Ink 2 ends your turn
    CARTESIA_KEYTERMS
    Optional. Comma-separated names to bias transcription toward
  2. Install it in your agent

    setup.sh runs uv sync and cartesia-voice-mode install for claude, cursor, codex or all. Add --dry-run to see what would change.

  3. Start talking

    Restart the agent and say, or type, "let's talk" or "voice mode". If nothing happens, uv run cartesia-voice-mode doctor checks the key.

Build it with your coding agent

One prompt that tells your coding agent where to start and what to read first.

Prompt

Claude CodeCursorCodex

Set up voice mode for my coding agent with Cartesia. Start from https://github.com/cartesia-ai/cookbook/tree/main/examples/coding-voice-mode and follow its AGENTS.md for the commands, files and rules. It is a local stdio MCP server with a converse tool: Sonic 3.6 (sonic-3.6) speaks the message over /tts/sse, then Ink 2 (ink-2) on /stt/turns/websocket listens until turn.end and returns the transcript as the tool result. Install it with ./setup.sh for my client, and keep the API key out of the client config. If I don't have a Cartesia API key yet, follow https://www.cartesia.ai/agent-quickstart.md to get one.

How it works

converseThe agent calls the tool with a message
Sonic 3.6Streams the message over /tts/sse and plays it
MicOpens only after playback ends
Ink 2Turn detection on /stt/turns/websocket
Tool resultThe turn.end transcript, read as your next message

Why it works this way

Turn detection ends your turn

The server waits for Ink 2's turn.end event, which means Ink 2 thinks you have finished. A pause mid-sentence does not cut you off the way a fixed silence timeout would.

Long waits need a longer timeout in Codex

Codex stops a tool call after 60 seconds by default. One voice turn plays the message and then listens for up to 120 seconds, so the setup script raises Codex's tool_timeout_sec to 180. It edits your Codex config in place and keeps your comments. If you let it listen longer, raise that timeout too.

Make it yours

Change the voice

Set CARTESIA_VOICE_ID, or ask the agent to call the list_voices tool and pick one.

Speak another language

Ink 2 detects English, Spanish, French, Hindi and Japanese by itself. Set CARTESIA_LANGUAGE and a matching CARTESIA_VOICE_ID so Sonic answers in the same language.

Teach it your words

Put repo and library names in CARTESIA_KEYTERMS so Ink 2 spells them the way your code does.

Questions

Which coding agents does it work with?

Claude Code, Cursor and Codex. The setup script installs it for one of them or all three.

Is my Cartesia API key safe?

Yes. The installer writes only the command that starts the server into your agent's config. The key stays in your shell, or in a file only you can read if you pass --save-key, and it never shows up in error messages or logs.

Can I interrupt the agent while it talks?

No. The microphone opens only after the agent finishes speaking, so it never hears itself, and there is no echo cancellation. Use headphones.

How fast is it?

It depends on your network and region. The server prints how long Sonic took to start speaking on every call, so you can check. To change how long a pause has to be before your turn ends, set CARTESIA_TURN_END_TIMEOUT_MS.

How is this different from mbailey/voicemode?

That project can also run local models and use other voice providers. This server uses Cartesia only.

Is there a step-by-step guide to this template?

Yes. The recipe walks through the code, the README covers setup, environment variables and deployment, and the Ink 2 turn detection docs explain the Cartesia side.

Get started today

Talk to an expert.

Connect with a member of our team and learn how Cartesia can help you build world-class voice experiences.

Contact Sales

Start building.

Access our models via API and bring a voice agent into production in minutes.

Try Cartesia