LiveKit MCP Server
Servidor MCP de LiveKit
Un servidor de Protocolo de Contexto de Modelo (MCP 2.0) de alto rendimiento que conecta Agentes de IA con el Motor de Voz y Telefonía MantraCare LiveKit.
Arquitectura • Inicio rápido • Configuración • Conexión de clientes • Autenticación • Herramientas • Desarrollo
📖 Descripción general
El Servidor MCP de LiveKit permite a los LLM y asistentes de codificación con IA (como Antigravity, Claude, Cursor y agentes personalizados) controlar, inspeccionar y activar de forma segura canalizaciones de telefonía de voz impulsadas por LiveKit (~/lkt) y autenticadas mediante Mantra Auth (~/mantra-auth).
Capacidades clave
🚀 Cumplimiento con MCP 2.0: Construido sobre el SDK oficial de Python
mcputilizando transportes de Eventos Enviados por el Servidor (SSE) y HTTP Streamable.🔐 Seguridad OAuth 2.1 y JWT compartido: Validación nativa de JWT HS256 que coincide con
mantra-auth, con soporte tanto para cabecerasAuthorization: Bearercomo para parámetros de consulta?token=.⚡ Núcleo asíncrono ultrarrápido: Impulsado por Starlette, Uvicorn y la gestión de paquetes
uv.🧩 Arquitectura de herramientas modular: Herramientas separadas por dominio para telefonía, análisis de llamadas, búsqueda en la base de conocimiento y troncales SIP.
🧠 Memoria agéntica: Base de conocimiento completa de Obsidian (
obsidian/) y reglasAGENTS.mdpara la preservación del contexto en la programación en pareja con IA.
Related MCP server: Agent Identity MCP Server
🏛️ Arquitectura del sistema
┌─────────────────────────────────────────────────────────────┐
│ AI Client (Cursor / Claude / Antigravity / Web Agent) │
└──────────────────────────────┬──────────────────────────────┘
│ 1. Bearer Token / ?token= (OAuth 2.1)
▼
┌─────────────────────────────────────────────────────────────┐
│ [3. mantra-auth (:3000)] │
│ Next.js + Prisma OAuth 2.1 Authorization Server │
│ - Issues HS256 JWTs and verifies via /api/oauth/introspect │
└──────────────────────────────┬──────────────────────────────┘
│ Shared JWT Secret Verification
▼
┌─────────────────────────────────────────────────────────────┐
│ [2. livekit-mcp (:8000)] (This Server) │
│ - Starlette ASGI + MCP 2.0 SSE Transport │
│ - Pure ASGI Auth Middleware (HS256 JWT validation) │
│ - Public Endpoints: /health, / │
│ - Protected Endpoints: /sse, /messages │
│ - Registered Tools: greet_user, [Telephony/KB/SIP coming] │
└──────────────────────────────┬──────────────────────────────┘
│ 2. Async HTTP (REST)
▼
┌─────────────────────────────────────────────────────────────┐
│ [1. lkt (:8081)] │
│ MantraCare LiveKit Voice Agent & Telephony Engine │
│ - SIP Trunks (Plivo, Zadarma, VoiceLink, Twilio) │
│ - LiveKit Cloud WebRTC Rooms & STT→LLM→TTS Voice Pipeline │
│ - PostgreSQL (call_logs, kb_pages) & Redis (queues, locks) │
└─────────────────────────────────────────────────────────────┘📁 Estructura del repositorio
livekit-mcp/
├── .env.example # Sample environment variables
├── .gitignore # Git ignore definitions
├── .python-version # Python version pin (3.11)
├── AGENTS.md # Agent Memory instructions
├── dev.sh # Development startup script
├── pyproject.toml # UV package specification & build settings
├── uv.lock # Deterministic lockfile
├── README.md # Project documentation
│
├── obsidian/ # Permanent Agentic Knowledge Base
│ ├── Home.md # Project navigation hub
│ ├── Architecture/ # System design, data flow, security & APIs
│ ├── Context/ # Stack, project summary & repository map
│ ├── Development/ # Sprint tracking, TODO & Changelog
│ ├── Features/ # Feature specifications (tools, auth)
│ └── Knowledge/ # Coding standards & architectural conventions
│
├── src/
│ └── livekit_mcp/
│ ├── __init__.py
│ ├── config.py # Pydantic Settings & environment validation
│ ├── server.py # MCPServer & Starlette app factory
│ ├── main.py # CLI runner with Uvicorn
│ ├── auth/
│ │ ├── __init__.py
│ │ ├── jwt.py # HS256 JWT decoding & claims validation
│ │ └── middleware.py # Pure ASGI auth middleware (headers & ?token=)
│ ├── clients/
│ │ ├── __init__.py
│ │ ├── lkt_client.py # Async HTTP client for lkt FastAPI (:8081)
│ │ └── auth_client.py # Async HTTP client for mantra-auth (:3000)
│ └── tools/
│ ├── __init__.py
│ └── greeting.py # Initial `greet_user` verification tool
│
└── tests/
├── __init__.py
├── conftest.py # Fixtures for tokens, settings & test client
├── test_config.py # Configuration unit tests
├── test_auth.py # JWT verification & claims unit tests
├── test_greeting.py # Tool registration & execution tests
└── test_server.py # Endpoints, SSE & Auth integration tests🚀 Inicio rápido
1. Requisitos previos
Python: 3.11 o superior
uv: Gestor de paquetes de Python rápido (Instalar uv)
curl -LsSf https://astral.sh/uv/install.sh | sh
2. Instalación y configuración
Clona el repositorio y entra en el directorio:
cd ~/livekit-mcpCrea la configuración de tu entorno:
cp .env.example .envInstala las dependencias con
uv:uv sync
3. Ejecución del servidor
Inicia el servidor de desarrollo con recarga automática:
./dev.shO ejecútalo directamente usando uv:
uv run python -m livekit_mcp.mainEl servidor estará disponible en http://localhost:8000.
⚙️ Configuración
Todos los ajustes se gestionan en src/livekit_mcp/config.py usando pydantic-settings y se cargan desde .env:
Variable | Tipo | Valor predeterminado | Descripción |
| cadena |
| Dirección de enlace del servidor |
| entero |
| Puerto de escucha del servidor |
| cadena |
|
|
| cadena |
| Nivel de registro ( |
| booleano |
| Aplicar autenticación JWT en los endpoints protegidos |
| cadena |
| Clave secreta compartida para la verificación de firma JWT HS256 |
| cadena |
| Algoritmo de firma JWT (coincide con |
| cadena |
| URL base del servidor Mantra Auth |
| cadena |
| Reclamación de emisor JWT esperada ( |
| cadena | (vacío) | Reclamación de audiencia esperada opcional ( |
| cadena |
| URL base de la API del Agente de Voz LKT |
| flotante |
| Tiempo de espera de solicitud HTTP en segundos para llamadas LKT |
| cadena | (vacío) | URL WebSocket directa de LiveKit Cloud (opcional) |
| cadena | (vacío) | Clave de API directa de LiveKit Cloud (opcional) |
| cadena | (vacío) | Secreto de API directo de LiveKit Cloud (opcional) |
📡 Endpoints
Endpoint | Método | Autenticación requerida | Descripción |
|
| ❌ No | Comprobación pública de salud y disponibilidad que devuelve el estado del servicio |
|
| ❌ No | Estado del servicio y metadatos de los endpoints |
|
| ✅ Sí | Abre un flujo persistente de Eventos Enviados por el Servidor (SSE) para clientes MCP |
|
| ✅ Sí | Endpoint JSON-RPC 2.0 para solicitudes MCP (ejecución de herramientas, listados) |
Ejemplo de comprobación de salud
curl http://localhost:8000/health{
"status": "healthy",
"service": "livekit-mcp",
"version": "0.1.0",
"auth_enabled": true,
"environment": "development",
"lkt_api_configured": true,
"timestamp": "2026-08-20T12:30:00.000000+00:00"
}🔐 Autenticación
El servidor implementa Autenticación JWT compartida OAuth 2.1 / HS256 compatible con mantra-auth.
Cómo proporcionar las credenciales
Cabecera de autorización (estándar):
GET /sse HTTP/1.1 Host: localhost:8000 Authorization: Bearer <your-jwt-access-token>Parámetro de consulta (para clientes SSE / EventSource):
GET /sse?token=<your-jwt-access-token> HTTP/1.1 Host: localhost:8000
Reclamaciones JWT esperadas
{
"sub": "user-123",
"aud": "client-app",
"iss": "http://localhost:3000",
"exp": 1755694800,
"iat": 1755691200,
"scope": "openid profile telephony:call",
"token_type": "access_token"
}Consejo de desarrollo: Establece
AUTH_ENABLED=falseen.envpara desactivar la verificación de tokens durante las pruebas locales.
🛠️ Herramientas disponibles
1. greet_user
Una herramienta de verificación que valida la conectividad MCP, el análisis de parámetros y el estado del servidor.
Parámetros:
name(cadena, obligatorio): Nombre del usuario o agente que invoca la herramienta.message(cadena, opcional): Mensaje de saludo personalizado.
Devuelve:
👋 Hello, Alice! Welcome to MantraCare LiveKit MCP! --- System Status --- • Service: LiveKit MCP Server • Status: Operational & Ready • Timestamp: 2026-08-20T12:30:00.000000+00:00 • Protocol: MCP 2.0 (SSE / HTTP)
🔌 Conexión de clientes MCP
1. Antigravity / CLI de Gemini (~/.gemini/config/mcp_config.json)
{
"mcpServers": {
"livekit": {
"serverUrl": "http://localhost:8000/sse"
}
}
}2. IDE de Cursor (.cursor/mcp.json)
{
"mcpServers": {
"livekit": {
"url": "http://localhost:8000/sse",
"headers": {
"Authorization": "Bearer <YOUR_JWT_TOKEN>"
}
}
}
}3. Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"livekit": {
"command": "uv",
"args": [
"--directory",
"/home/fardeen/livekit-mcp",
"run",
"python",
"-m",
"livekit_mcp.main"
],
"env": {
"AUTH_ENABLED": "false"
}
}
}
}🧪 Desarrollo y pruebas
Ejecución de pruebas
El proyecto incluye un conjunto completo de pruebas que cubren configuración, verificación JWT, middleware y herramientas:
uv run pytest -vFormato de código y linting
Aplica estándares de codificación limpios usando ruff:
# Check code
uv run ruff check .
# Auto-fix issues & format
uv run ruff check --fix .
uv run ruff format .Añadir nuevas herramientas
Para añadir una nueva herramienta a livekit-mcp:
Crea un módulo en
src/livekit_mcp/tools/<dominio>.py.Define una función de registro:
from mcp.server.mcpserver import MCPServer def register_telephony_tools(server: MCPServer) -> None: @server.tool(name="trigger_call", description="Trigger an outbound call") async def trigger_call(phone_number: str, prompt: str) -> str: # Call LktClient here return f"Call initiated to {phone_number}"Registra la función en
src/livekit_mcp/server.pydentro decreate_mcp_server().Añade pruebas unitarias en
tests/test_<dominio>.py.
📚 Memoria agéntica
Este repositorio sigue el patrón de Memoria agéntica. Antes de realizar cambios arquitectónicos, revisa el repositorio de conocimiento de Obsidian en obsidian/:
obsidian/Home.md— Centro de navegación del proyectoobsidian/Architecture/Overview.md— Diseño del sistema y topologíaobsidian/Development/Current Sprint.md— Estado de desarrollo activoobsidian/Development/TODO.md— Hoja de ruta próximaobsidian/Knowledge/Coding Standards.md— Convenciones de código
📄 Licencia
Propietaria © MantraCare. Todos los derechos reservados.
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
AlicenseAqualityFmaintenanceMCP Server that connects AI agents to Chargebee Platform.27315MIT- AlicenseNot gradedqualityDmaintenanceMCP Server for AI agent identity and authorization. Create, verify, and manage agent identities with trust scores and scoped authorization tokens.MIT

Smallest MCP Serverofficial
AlicenseAqualityAmaintenanceMCP server for the Smallest AI platform that enables managing AI voice agents, debugging calls, and viewing analytics directly from your IDE.832661MIT- AlicenseAqualityDmaintenanceMCP server for enterprise authentication and authorization — JWT validation, OIDC token inspection, OAuth 2.0 introspection, and role-based access control for AI agents.8MIT
Related MCP Connectors
Phone, SMS & email for AI agents — one remote MCP endpoint, OAuth login, zero install.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
MCP Hub: AI service discovery, per-user OAuth, and multi-service workflow orchestration
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/FardeenSK004/livekit-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server