---
title: "Server (Node.js) | Micdrop"
description: "Micdrop server orchestrates voice conversations by integrating AI agents, speech-to-text, and text-to-speech services with WebSocket communication."
url: "https://micdrop.dev/docs/server"
---

*   [Getting Started](/docs/getting-started)
*   [Examples and demos](/docs/examples)
*   [Client (Browser)](/docs/client)
    
    *   [Installation](/docs/client/installation)
    *   [React Hooks](/docs/client/react-hooks)
    *   [Start/Stop Call](/docs/client/start-stop-call)
    *   [Pause/Resume Call](/docs/client/pause-resume-call)
    *   [Mute/Unmute Call](/docs/client/mute-unmute-call)
    *   [Call State](/docs/client/call-state)
    *   [Display Conversation Messages](/docs/client/display-conversation-messages)
    *   [Handling Tool Calls](/docs/client/handling-tool-calls)
    *   [Device Management](/docs/client/devices-management)
    *   [Voice Activity Detection (VAD)](/docs/client/vad)
    *   [Turn Detection](/docs/client/turn-detection)
    *   [Reducing Latency](/docs/client/latency)
    *   [Error Handling](/docs/client/error-handling)
    *   Utility Classes
        
        *   [Mic](/docs/client/utility-classes/mic)
        *   [MicdropClient](/docs/client/utility-classes/micdrop-client)
        *   [MicRecorder](/docs/client/utility-classes/mic-recorder)
        *   [Speaker](/docs/client/utility-classes/speaker)
        
    
*   [Client (React Native)](/docs/react-native)
    
    *   [Installation](/docs/react-native/installation)
    *   [Hooks and Call State](/docs/react-native/hooks)
    *   [Audio Output and Devices](/docs/react-native/audio-output)
    *   [Voice Activity Detection (VAD)](/docs/react-native/vad)
    *   [Turn Detection](/docs/react-native/turn-detection)
    *   [Using Another Audio Library](/docs/react-native/custom-audio)
    
*   [Server (Node.js)](/docs/server)
    
    *   [Installation](/docs/server/installation)
    *   [With Fastify](/docs/server/with-fastify)
    *   [With NestJS](/docs/server/with-nestjs)
    *   [Auth and Parameters](/docs/server/auth-and-parameters)
    *   [First Message](/docs/server/first-message)
    *   [Dictation and Text-Only Calls](/docs/server/dictation)
    *   [Realtime Models](/docs/server/realtime)
    *   [Partial Messages](/docs/server/partial-messages)
    *   [Save Messages](/docs/server/save-messages)
    *   [Resume a Conversation](/docs/server/resume-conversation)
    *   [Recording Audio](/docs/server/recording-audio)
    *   [Error Handling](/docs/server/error-handling)
    *   [Tools](/docs/server/tools)
    *   [Extract Value from Answer](/docs/server/extract)
    *   [Classifier](/docs/server/classifier)
    *   [Auto End Call](/docs/server/auto-end-call)
    *   [Semantic Turn Detection](/docs/server/semantic-turn-detection)
    *   [Noise Filtering](/docs/server/noise-filtering)
    *   [Micdrop Protocol](/docs/server/protocol)
    
*   [AI Integrations](/docs/ai-integration)
    
    *   Provided Integrations
        
        *   [AI SDK](/docs/ai-integration/provided-integrations/ai-sdk)
        *   [Cartesia](/docs/ai-integration/provided-integrations/cartesia)
        *   [ElevenLabs](/docs/ai-integration/provided-integrations/elevenlabs)
        *   [Gemini](/docs/ai-integration/provided-integrations/gemini)
        *   [Gladia](/docs/ai-integration/provided-integrations/gladia)
        *   [Gradium](/docs/ai-integration/provided-integrations/gradium)
        *   [Kokoro](/docs/ai-integration/provided-integrations/kokoro)
        *   [Mistral](/docs/ai-integration/provided-integrations/mistral)
        *   [OpenAI](/docs/ai-integration/provided-integrations/openai)
        *   [Piper](/docs/ai-integration/provided-integrations/piper)
        *   [Pocket TTS](/docs/ai-integration/provided-integrations/pocket-tts)
        *   [Qwen3-TTS](/docs/ai-integration/provided-integrations/qwen-tts)
        *   [Jev (TypeSafe)](/docs/ai-integration/provided-integrations/typesafe)
        *   [Whisper](/docs/ai-integration/provided-integrations/whisper)
        
    *   Custom Integrations
        
        *   [Agent (LLM)](/docs/ai-integration/custom-integrations/custom-agent)
        *   [Speech-to-Text (STT)](/docs/ai-integration/custom-integrations/custom-stt)
        *   [Text-to-Speech (TTS)](/docs/ai-integration/custom-integrations/custom-tts)
        *   [Classifier](/docs/ai-integration/custom-integrations/custom-classifier)
        
    *   Fallback Strategies
        
        *   [FallbackAgent](/docs/ai-integration/fallback-strategies/agent-fallback)
        *   [FallbackSTT](/docs/ai-integration/fallback-strategies/stt-fallback)
        *   [FallbackTTS](/docs/ai-integration/fallback-strategies/tts-fallback)
        
    *   [Local Models](/docs/ai-integration/local-models)
        
        *   [Local LLM](/docs/ai-integration/local-models/agent)
        *   [Local STT](/docs/ai-integration/local-models/speech-to-text)
        *   [Local TTS](/docs/ai-integration/local-models/text-to-speech)
        *   [Latency and Memory](/docs/ai-integration/local-models/performance)
        *   [Explorations](/docs/ai-integration/local-models/explorations)
            
            *   [MiniCPM5-2B](/docs/ai-integration/local-models/explorations/minicpm)
            *   [Mistral 7B](/docs/ai-integration/local-models/explorations/mistral-7b)
            *   [Voxtral Mini 3B](/docs/ai-integration/local-models/explorations/voxtral-stt)
            *   [Voxtral TTS 4B](/docs/ai-integration/local-models/explorations/voxtral-tts)
            *   [AuK and AuK-Flash](/docs/ai-integration/local-models/explorations/auk)
            
        
    *   [IA Vocale Souveraine 🇫🇷🇪🇺](/docs/ai-integration/sovereign-voice-ai)
    
*   [Migration](/docs/migration)
    
    *   [Upgrade to v3](/docs/migration/v3)
    

[Micdrop](/)›[Documentation](/docs/getting-started)

# Server (Node.js)

**Micdrop server** orchestrates voice conversations by integrating AI agents, speech-to-text, and text-to-speech services with WebSocket communication.

## Installation

Terminal window

```
npm install @micdrop/server
```

See [Installation](/docs/server/installation) for more details.

## Quick Example

```
import { MicdropServer } from '@micdrop/server'import { OpenaiAgent } from '@micdrop/openai'import { GladiaSTT } from '@micdrop/gladia'import { ElevenLabsTTS } from '@micdrop/elevenlabs'import { WebSocketServer } from 'ws'
const wss = new WebSocketServer({ port: 8081 })
wss.on('connection', (socket) => {  // Handle voice conversation  new MicdropServer(socket, {    firstMessage: 'How can I help you today?',
    agent: new OpenaiAgent({      apiKey: process.env.OPENAI_API_KEY,      systemPrompt: 'You are a helpful assistant',    }),
    stt: new GladiaSTT({      apiKey: process.env.GLADIA_API_KEY,    }),
    tts: new ElevenLabsTTS({      apiKey: process.env.ELEVENLABS_API_KEY,      voiceId: process.env.ELEVENLABS_VOICE_ID,    }),  })})
```

## Calls that transcribe or write

`agent` and `tts` are optional. A server given a speech to text alone transcribes and stays quiet, which is all a dictation tool needs. One given an agent and no voice answers in writing.

```
new MicdropServer(socket, {  stt: new GladiaSTT({ apiKey: process.env.GLADIA_API_KEY }),})
```

See [Dictation and text-only calls](/docs/server/dictation).

## Demo

The [basic example](https://github.com/Godefroy/micdrop/tree/main/examples/basic) is the shortest server you can write, a `ws` server and the three OpenAI providers in forty lines.

For a wider tour, check out the [advanced example](https://github.com/Godefroy/micdrop/tree/main/examples/advanced), it shows:

*   Setting up a Fastify server with WebSocket support
*   Configuring the MicdropServer with custom handlers
*   Basic authentication flow
*   Example agent, speech-to-text and text-to-speech implementations
*   Error handling patterns

## Core Components

*   **MicdropServer** - Main server class for conversation orchestration
*   **[Agent](/docs/ai-integration/custom-integrations/custom-agent)** - AI agent base class and implementations, optional
*   **[STT](/docs/ai-integration/custom-integrations/custom-stt)** - Speech-to-text base class and implementations
*   **[TTS](/docs/ai-integration/custom-integrations/custom-tts)** - Text-to-speech base class and implementations, optional
*   **[Realtime](/docs/server/realtime)** - Speech-to-speech models, in place of the three above
*   **[Classifier](/docs/server/classifier)**, typed decisions about what the user says, optional

## Framework Integrations

*   **[Installation](/docs/server/installation)** - Basic Node.js setup
*   **[With Fastify](/docs/server/with-fastify)** - Fastify framework integration
*   **[With NestJS](/docs/server/with-nestjs)** - NestJS framework integration

[Previous← Using Another Audio Library](/docs/react-native/custom-audio)[NextInstallation →](/docs/server/installation)

On this page

*   [Installation](#installation)
*   [Quick Example](#quick-example)
*   [Calls that transcribe or write](#calls-that-transcribe-or-write)
*   [Demo](#demo)
*   [Core Components](#core-components)
*   [Framework Integrations](#framework-integrations)
