LiveKit MCP Server
Provides tools for querying provider availability from a PostgreSQL database (assist_db), including evaluating recurring schedules and converting UTC working hours to the caller's local timezone.
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., "@LiveKit MCP ServerCan you initiate a call to the sales team?"
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.
LiveKit MCP Server
A high-performance Model Context Protocol (MCP 2.0) Server bridging AI Agents and Backend Services with the MantraCare LiveKit Voice & Telephony Engine.
Architecture • Quick Start • Configuration • Tools • Authentication • Connecting Clients • Development
📖 Overview
The LiveKit MCP Server acts as the central intelligence and scheduling hub. It connects backend databases (MantraAssist-backend), telephony voice agents (~/lkt), and OAuth security (~/mantra-auth), providing AI agents with real-time tools for doctor availability, appointment scheduling, and caller timezone resolution.
Key Capabilities
🚀 MCP 2.0 Compliance: Built on the official Python
mcpSDK using Server-Sent Events (SSE) and Streamable HTTP transports (/sse,/messages,/api/tools/call).🌍 International Timezone Auto-Detection: Automatically detects caller country and IANA timezone from international phone numbers (
+1US ➔ EDT/CDT,+44UK ➔ GMT/BST,+91India ➔ IST,+971UAE ➔ GST) using Google'sphonenumbersengine, converting UTC database slots to local time on the fly.👨⚕️ Multi-Provider Schedules: Handles arrays of doctors/providers and their respective available working hours in a single request.
🔐 OAuth 2.1 & Shared JWT Security: Native HS256 JWT validation compatible with
mantra-auth, supporting bothAuthorization: Bearer <token>headers and?token=<token>query parameters.⚡ Lightning Fast Async Core: Powered by Starlette,
asyncpgconnection pooling, and Uvicorn.🧠 Agentic Memory: Permanent Obsidian knowledge vault (
obsidian/) andAGENTS.mdrules.
Related MCP server: Agent Identity MCP Server
🏛️ System Architecture
┌─────────────────────────────────────────────────────────────────────────────┐
│ 1. mantra-auth (:3000) │
│ Next.js OAuth 2.1 Authorization Server │
│ • DB: postgres_auth (:5441 / mantra_auth_dev) │
│ • Issues HS256 JWT Tokens for Clients & Services │
└──────────────────────────────────────┬──────────────────────────────────────┘
│ Issues JWT Bearer Token
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ 2. MantraAssist-backend (:5500) [MCP CLIENT] │
│ Express.js / TypeScript Core Backend │
│ • Computes doctor working hours from assist_db │
│ • Calls MCP tool over SSE / HTTP (/sse?token=...) │
└──────────────────────────────────────┬──────────────────────────────────────┘
│ Invokes `receive_doctor_availability`
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ 3. livekit-mcp (:8000) [THIS MCP SERVER] │
│ Starlette + MCP 2.0 SSE Transport │
│ • Auth Middleware: Validates HS256 JWT │
│ • Timezone Resolver: Detects caller timezone from phone number │
│ • Formatter: Normalizes UTC slots ➔ Caller's localized 12-hour format │
│ • Public Endpoints: /health, / │
│ • Protected Endpoints: /sse, /messages, /api/tools/call │
└──────────────────────────────────────┬──────────────────────────────────────┘
│ Real-time Tool Result
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ 4. lkt (:8081) [VOICE TELEPHONY AGENT] │
│ MantraCare LiveKit Voice Telephony Engine │
│ • STT ➔ LLM ➔ TTS Voice Pipeline │
│ • Calls check_doctor_availability dynamically mid-call │
│ • Speaks localized doctor times naturally to the caller │
└─────────────────────────────────────────────────────────────────────────────┘📁 Repository Layout
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 & conventions
│
├── scripts/
│ └── generate_token.py # CLI utility to generate signed JWT tokens
│
└── 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
│ ├── db_client.py # Async PostgreSQL pool (asyncpg)
│ ├── lkt_client.py # Async HTTP client for lkt (:8081)
│ └── auth_client.py # Async HTTP client for mantra-auth (:3000)
├── utils/
│ ├── __init__.py
│ └── timezone.py # Phone number timezone auto-detection & UTC converter
└── tools/
├── __init__.py
├── greeting.py # `greet_user` health test tool
├── providers.py # `search_provider_availability` direct DB search
└── doctor_availability.py # `receive_doctor_availability` receiver tool🚀 Quick Start
1. Prerequisites
Python: 3.11 or higher
uv: Fast Python package manager (Install uv)
curl -LsSf https://astral.sh/uv/install.sh | sh
2. Installation & Configuration
cd ~/livekit-mcp
cp .env.example .env
uv sync3. Generate a JWT Access Token
To generate a signed 72-hour access token for testing or client configuration:
uv run python scripts/generate_token.py --hours 724. Start the Server
./dev.shServer runs at http://localhost:8000.
🛠 Available Tools
1. receive_doctor_availability
Receives calculated doctor availability and open time slots in UTC for multiple providers. Automatically detects the caller's timezone from their international phone number and returns formatted local times for the voice agent.
Arguments:
org_id(int): Organization ID.date(string): Target date (YYYY-MM-DD).caller_phone(string, optional): International phone number (+12025550123,+918360625862).providers(array of objects):user_id(int): Doctor ID (users.id).name(string): Doctor's name.available_slots(array of strings): UTC time ranges (["14:00 - 15:00", "16:00 - 17:00"]).
Example Payload:
{
"org_id": 66,
"date": "2026-08-25",
"caller_phone": "+12025550123",
"providers": [
{
"user_id": 12,
"name": "Dr. Ananya Sharma",
"available_slots": [
"14:00 - 15:00",
"16:00 - 17:00"
]
},
{
"user_id": 15,
"name": "Dr. Rajesh Kumar",
"available_slots": [
"15:00 - 16:00",
"17:00 - 18:00"
]
}
]
}Voice Agent Output:
📅 Available Doctors on Tuesday, Aug 25, 2026 (Local Timezone: America/New_York):
1. Dr. Ananya Sharma (User ID: 12)
• Available Slots: 10:00 AM – 11:00 AM EDT, 12:00 PM – 1:00 PM EDT
2. Dr. Rajesh Kumar (User ID: 15)
• Available Slots: 11:00 AM – 12:00 PM EDT, 1:00 PM – 2:00 PM EDT
Org ID: 66 | Caller Phone: +120255501232. search_provider_availability
Queries assist_db directly (asyncpg), evaluates RFC 5545 recurrence rules, and converts working hours to the organization's or caller's local timezone.
Arguments:
org_id(int): Organization ID.query_date(string): Date to search (YYYY-MM-DD).query(string, optional): Doctor name or specialty filter.caller_phone(string, optional): Caller phone number for timezone localization.
3. greet_user
Simple latency and connectivity verification tool.
🌐 API Endpoints
Endpoint | Method | Auth | Description |
|
| Public | Returns service status, version, and auth configuration |
|
| Public | Root welcome & discovery info |
|
| Bearer / | MCP Server-Sent Events connection stream |
|
| Bearer / | MCP JSON-RPC message transport |
|
| Bearer / | Direct tool execution endpoint for microservices |
🔐 Authentication
All protected endpoints (/sse, /messages, /api/tools/call) require a valid JWT token signed with JWT_SECRET.
Passing the Token:
Via Authorization Header:
Authorization: Bearer <YOUR_JWT_TOKEN>Via Query Parameter (Recommended for EventSource browser/SSE clients):
GET http://localhost:8000/sse?token=<YOUR_JWT_TOKEN>
🛠 Connecting MCP Clients
From Node.js / TypeScript (MantraAssist-backend):
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
const transport = new SSEClientTransport(
new URL(`http://localhost:8000/sse?token=${process.env.MCP_JWT_TOKEN}`)
);
const client = new Client({ name: "mantra-backend", version: "1.0.0" }, { capabilities: {} });
await client.connect(transport);
const result = await client.callTool({
name: "receive_doctor_availability",
arguments: { ... }
});💻 Development
Lint & Format:
uv run ruff check --fix . uv run ruff format .Token Generation:
uv run python scripts/generate_token.py --user "test-agent" --hours 24
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 Connectors
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Phone, SMS & email for AI agents — one remote MCP endpoint, OAuth login, zero install.
MCP server enabling AI agents to manage Bitrix24 features via standardized protocol
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Related MCP Servers
AlicenseAqualityFmaintenanceMCP Server that connects AI agents to Chargebee Platform.24716MIT- 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.83461MIT- 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
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/Mantracare-Org/livekit-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server