Start a Voice AI App with npm create micdrop
One command writes a project that runs as it is: the client, the Node server
that runs the AI, a .env to fill with your keys, and a README.
npm create micdrop@latestIt asks where to write the project, which template to start from and which AI runs the call, then offers to install the dependencies. With pnpm, Yarn or Bun:
pnpm create micdropyarn create micdropbun create micdropFill the .env it wrote, then start the project with npm run dev.
Templates
| Template | What you get | Flag |
|---|---|---|
| Next.js | A Next.js page that holds the call, and a WebSocket server next to Next.js | nextjs |
| Vite + React | A React page built with Vite, a Fastify server, and Silero voice detection shipped with the app | vite-react |
| Expo | An iOS and Android app with React Native, and the server it talks to | expo |
| Phone agent | A phone number answered by the agent, through Twilio, Telnyx, Vonage or Plivo | phone |
| Node server | A WebSocket server alone, for any Micdrop client | node |
Every template gives the assistant a first message and the
end call tool, and keeps the AI providers in one
file, ai.ts, so swapping one touches nothing else.
Next.js
A call keeps a WebSocket open for its whole length, which the route handlers of
Next.js do not hold, so the voice server runs as a Node process next to Next.js.
npm run dev starts both. The page loads the call in the browser only, since
it needs the microphone, and reads its state with the
React hooks.
Vite + React
Vite hands /call to the Fastify server, so the page and the call share one
address in development. The Micdrop Vite plugin
ships the Silero model with the app, and the call combines the volume and
Silero voice detection.
Expo
The app runs from a development build, as any app that records audio natively.
It finds the server on the machine Expo served it from, so a simulator and a
phone on the same Wi-Fi work without configuration. The keys stay in
server/.env, out of the app. See React Native for what the
client does.
Phone agent
The template answers a phone number on your own server. You pick the
telephony provider when creating the project, and the generated
src/telephony.ts answers its webhook and opens its media stream. The agent:
- Greets the caller as soon as the call connects
- Hangs up once the caller says goodbye
- Transfers the caller to a person when
TRANSFER_NUMBERis set, at once or after briefing them, throughtransferCallTool() - Reads the keys pressed on the keypad, and checks in when the caller stays silent
- Places calls with
POST /callwhenOUTBOUND_API_KEYis set, and leaves a message when a voicemail picks up, as outbound calls explain - Refuses the webhooks your provider did not sign, unless
VERIFY_SIGNATURES=false, as securing the webhooks explains - Saves the audio and the transcript of each call when
RECORDINGS_DIRis set, through the recorder - Logs the conversation once the call is over, ready to send to your CRM
The server finds the turns of the caller itself with Silero, since a phone line has no client to do it. See Telephony for each provider, and Migrate from Vapi to move an assistant from a hosted platform to this template.
Node server
The smallest project: a WebSocket server that runs each connection as a call. Connect any client to it, in a browser or on a phone.
AI providers
A preset sets the three parts of a call at once:
| Preset | What runs the call | Keys |
|---|---|---|
openai | OpenAI speech to text, GPT and OpenAI voices | One |
openai-realtime | The OpenAI Realtime API, one speech to speech model | One |
gemini-live | Gemini Live, one speech to speech model | One |
grok-voice | Grok Voice by xAI, one speech to speech model | One |
mistral | Voxtral to transcribe and speak, Mistral Medium to answer | One |
europe | Speechmatics, Mistral Medium and Gradium, on their EU endpoints | Three |
local | Whisper, an Ollama model and Kokoro, on your machine | None |
Or pick each part:
| Part | Flag | Choices |
|---|---|---|
| Speech to text | --stt | openai, gladia, mistral, gemini, deepgram, deepgram-flux, assemblyai, speechmatics, grok, whisper |
| Agent | --agent | openai, mistral, gemini, mastra, openai-agents, ollama |
| Text to speech | --tts | openai, elevenlabs, cartesia, mistral, gemini, deepgram, inworld, gradium, grok, kokoro |
| Speech to speech | --realtime | openai, gemini, grok |
The local models run on your machine with no key: pull the
Ollama model before the first call. The mastra and openai-agents agents
build a Mastra or OpenAI Agents SDK
agent at the top of ai.ts, running an OpenAI model, ready to receive the
tools, workflows or handoffs of your framework. Every other provider listed in
AI providers plugs into ai.ts the same way.
Without questions
Every answer has a flag, so a script or a CI job creates a project without a
prompt. Anything left out takes its default with --yes, or is asked.
npm create micdrop@latest my-agent -- --template phone --telephony twilio --ai openai --installpnpm create micdrop my-app --template nextjs --stt gladia --agent mistral --tts elevenlabs| Flag | Values |
|---|---|
--template, -t | nextjs, vite-react, expo, phone, node |
--ai | openai, openai-realtime, gemini-live, grok-voice, mistral, europe, local |
--stt, --agent, --tts | One part of the call, on top of a preset |
--realtime | A speech to speech model, in place of the three parts |
--telephony | twilio, telnyx, vonage, plivo, for the phone template |
--pm | npm, pnpm, yarn, bun, the one running the command by default |
--install, --no-install | Installs the dependencies, or leaves it to you |
--yes, -y | Takes the defaults instead of asking |
npm passes flags to the command after --, as in the first example. pnpm,
Yarn and Bun need no separator.
Build it with a coding agent
To vibe code your Micdrop implementation faster with Cursor, Claude Code or any other agent, install Context7 MCP.
Once the MCP is installed, you can prompt like this:
create a turbo monorepo in current folder with a client and a server in a new /apps folder:- server: a simple fastify server with Typescript that implements a micdrop server (use context7)- client: a simple React webapp with micdrop client. show play/stop/pause buttons and conversation, no other UI. make it beautiful and futuristic.