LiveKit MCP Server
LiveKit MCP サーバー
AIエージェントとMantraCare LiveKit Voice & Telephony Engineを橋渡しする、高性能なModel Context Protocol(MCP 2.0)サーバーです。
アーキテクチャ • クイックスタート • 設定 • クライアントの接続 • 認証 • ツール • 開発
📖 概要
LiveKit MCP Server は、LLMやAIコーディングアシスタント(Antigravity、Claude、Cursor、カスタムエージェントなど)が、LiveKit(~/lkt)を利用した音声テレフォニーパイプラインを安全に制御・検査・トリガーし、Mantra Auth(~/mantra-auth)を介して認証できるようにします。
主な機能
🚀 MCP 2.0 準拠: 公式 Python
mcpSDK をベースとし、Server-Sent Events (SSE) と Streamable HTTP トランスポートを使用。🔐 OAuth 2.1 & 共有 JWT セキュリティ:
mantra-authに一致するネイティブなHS256 JWT検証。Authorization: Bearerヘッダーと?token=クエリパラメータの両方をサポート。⚡ 超高速非同期コア: Starlette、Uvicorn、
uvパッケージ管理を採用。🧩 モジュール式ツールアーキテクチャ: テレフォニー、通話分析、ナレッジベース検索、SIPトランキング用にドメイン分離されたツール。
🧠 エージェントメモリ: 完全な Obsidian ナレッジベース(
obsidian/)とAGENTS.mdルールにより、AIペアプログラミングのコンテキストを保持します。
Related MCP server: Agent Identity MCP Server
🏛️ システムアーキテクチャ
┌─────────────────────────────────────────────────────────────┐
│ 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) │
└─────────────────────────────────────────────────────────────┘📁 リポジトリ構成
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🚀 クイックスタート
1. 前提条件
Python: 3.11 以上
uv: 高速な Python パッケージマネージャー (uv のインストール)
curl -LsSf https://astral.sh/uv/install.sh | sh
2. インストールとセットアップ
リポジトリをクローンしてディレクトリに入ります:
cd ~/livekit-mcp環境設定ファイルを作成します:
cp .env.example .envuvで依存関係をインストールします:uv sync
3. サーバーの起動
自動リロード付きで開発サーバーを起動します:
./dev.shまたは、uv を使って直接実行します:
uv run python -m livekit_mcp.mainサーバーは http://localhost:8000 で利用可能になります。
⚙️ 設定
すべての設定は src/livekit_mcp/config.py で pydantic-settings を使用して管理され、.env から読み込まれます。
変数 | 型 | デフォルト | 説明 |
| string |
| サーバーのバインドアドレス |
| integer |
| サーバーの待受ポート |
| string |
|
|
| string |
| ログレベル ( |
| boolean |
| 保護されたエンドポイントでJWT認証を強制する |
| string |
| HS256 JWT 署名検証用の共有シークレットキー |
| string |
| JWT 署名アルゴリズム( |
| string |
| Mantra Auth サーバーのベースURL |
| string |
| 期待されるJWT発行者クレーム( |
| string | (空) | 期待されるオーディエンスクレーム( |
| string |
| LKT Voice Agent API のベースURL |
| float |
| LKT API へのHTTPリクエストのタイムアウト(秒) |
| string | (空) | LiveKit Cloud の WebSocket URL |
| string | (空) | LiveKit Cloud API キー |
| string | (空) | LiveKit Cloud API シークレット |
📡 エンドポイント
エンドポイント | メソッド | 認証必須 | 説明 |
|
| ❌ いいえ | サービスステータスと依存関係の健全性を確認する公開エンドポイント |
|
| ❌ いいえ | サービス情報と設定 |
|
| ✅ はい | MCP ツール呼び出しのための JSON-RPC エンドポイント |
|
| ✅ はい | MCP のStreamable HTTPトランスポートエンドポイント |
ヘルスチェック例
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"
}🔐 認証
サーバーは、mantra-auth と互換性のある OAuth 2.1 & 共有 JWT 認証 を実装しています。
認証情報の提供
Authorization ヘッダー(標準):
GET /sse HTTP/1.1 Host: localhost:8000 Authorization: Bearer <your-jwt-access-token>クエリパラメータ(SSE / EventSource クライアント用):
GET /sse?token=<your-jwt-access-token> HTTP/1.1 Host: localhost:8000
期待される JWT クレーム
{
"sub": "user-123",
"aud": "client-app",
"iss": "http://localhost:3000",
"exp": 1755694800,
"iat": 1755691200,
"scope": "openid profile telephony:call",
"token_type": "access_token"
}開発時のヒント: ローカルテスト中は、
.env内でAUTH_ENABLED=falseに設定するとトークン検証を無効化できます。
🛠️ 利用可能なツール
1. greet_user
認証、パラメータ解析、サーバー状態を検証するためのシンプルなテストツールです。
パラメータ:
name(文字列, 必須): ツールを呼び出すユーザーまたはエージェントの名前。message(文字列, 任意): カスタム挨拶メッセージ。
戻り値:
👋 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)
🔌 MCP クライアントの接続
1. Antigravity / Gemini CLI (~/.gemini/config/mcp.json)
{
"mcpServers": {
"livekit": {
"serverUrl": "http://localhost:8000/sse"
}
}
}2. Cursor IDE (.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"
}
}
}
}🧪 開発とテスト
テストの実行
このプロジェクトには、設定、JWT検証、ミドルウェア、ツールをカバーする包括的なテストスイートが含まれています:
uv run pytest -vコードフォーマットとリンティング
ruff を使用してクリーンなコーディング標準を適用します:
# Check code
uv run ruff check .
# Auto-fix issues & format
uv run ruff check --fix .
uv run ruff format .新しいツールの追加
新しいツールを livekit-mcp に追加するには:
src/livekit_mcp/tools/<domain>.pyにモジュールを作成します。モジュール内でツールを定義します:
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}"create_mcp_server()内のsrc/livekit_mcp/server.pyに関数を登録します。
📚 ナレッジベース
このプロジェクトは、AI ペアプログラミングのコンテキストを提供するために、AGENTS.md ファイルと完全な Obsidian ナレッジベース (obsidian/) を維持しています:
obsidian/Home.md— プロジェクトのホームobsidian/Architecture.md— システムアーキテクチャのドキュメントobsidian/Development.md— 開発プロセスとガイドラインobsidian/Knowledge.md— ドメイン知識とベストプラクティス
📄 ライセンス
Proprietary © MantraCare. 無断複写・転載を禁じます。
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