Tencent RTC MCP Server for AI IDEs
Streamline AI IDE integration with Tencent RTC using the MCP server to simplify building audio/video call applications for developers.
npx -y @Tencent-RTC/mcpOverview
The Tencent RTC MCP (Model Context Protocol) Server is a lightweight backend component designed to bridge AI IDEs and Tencent Real-Time Communication (TRTC). It provides common server-side functionality for managing audio/video rooms, generating secure tokens, relaying stream metadata, and integrating with model-driven experiences in development environments. By centralizing session and token logic, the MCP server reduces the amount of RTC-specific code developers need to write inside AI-powered IDEs or assistants.
MCP is particularly useful when you need consistent room management, recording orchestration, or secure short‑lived credentials for clients that will publish or subscribe to audio/video streams. It can be deployed as a standalone service or run alongside other microservices in an AI IDE stack to handle real-time collaboration, interviews, pair-programming sessions, and other multimodal workflows.
Features
- Room lifecycle management (create/join/leave rooms)
- Secure token generation for TRTC client authentication
- Stream publish/subscribe coordination and metadata exchange
- Session recording controls and retrieval hooks
- WebSocket/HTTP APIs for low-latency event delivery
- Configurable storage and persistence (Redis / Mongo / file-based)
- Example client integrations (web, desktop, mobile)
- Docker-friendly deployment and environment-based configuration
- Basic observability endpoints (health, metrics)
Installation / Configuration
Below are quick-start steps for running a typical MCP server. The repository supports containerized deployment and local development.
Clone the repo:
Run with Node.js (example):
# install dependencies
# set env vars (example)
# start in development
# or production
Run with Docker:
# build image
# run container
Common environment variables
| Variable | Description |
|---|---|
| MCP_PORT | HTTP/WebSocket port (default 8080) |
| TRTC_APP_ID | Tencent TRTC Application ID |
| TRTC_SECRET | Secret key for generating TRTC tokens |
| SESSION_STORE | Session backend: memory |
| REDIS_URL | Redis connection string (if using Redis) |
| MONGO_URI | MongoDB connection string (if using Mongo) |
| TLS_CERT, TLS_KEY | Optional TLS cert/key paths for HTTPS |
Adjust values based on your infrastructure and secret management practices.
Available Resources
- GitHub repository: https://github.com/Tencent-RTC/mcp
- Tencent TRTC SDKs and docs (useful for client-side integration)
- Example clients: web demo (WebRTC + TRTC), minimal CLI tools for testing
- API docs: OpenAPI/Swagger (if included in repository) or built-in /docs endpoints
- Health endpoints: /health, /metrics for monitoring
Check the repo’s examples/ and docs/ folders for language-specific samples and ready-to-run demos.
Typical API Endpoints
The MCP server exposes HTTP and WebSocket endpoints used by clients and AI IDE backends. Example endpoints (names may vary slightly by release):
| Method | Path | Description |
|---|---|---|
| POST | /rooms | Create a new room |
| POST | /rooms/{id}/join | Join an existing room and get client token |
| POST | /tokens | Generate a short-lived TRTC token for a user |
| POST | /rooms/{id}/record/start | Start recording a room |
| POST | /rooms/{id}/record/stop | Stop recording |
| GET | /rooms/{id}/state | Get current room state & active streams |
| WS | /events | WebSocket for realtime room events |
Example: request a TRTC token
Response typically includes token, expiry, and any client connection metadata.
Use Cases
- AI Pair-Programming: An AI assistant inside an IDE opens a TRTC room via the MCP server so collaborators can join with low-latency voice/video while the assistant synchronizes code context and annotations.
- Remote Interviews / Coding Sessions: Orchestrate interview rooms, generate per-user tokens, and record sessions for later review or model training while protecting credentials through MCP-generated short-lived tokens.
- Live Code Review with Commentary: Use MCP to manage who can publish audio/video streams while the IDE overlays AI-generated suggestions or annotations tied to stream metadata.
- Multimodal Assistants: Combine audio streams with code context and LLM-based suggestions; MCP acts as the boundary that connects real-time media to model inputs and logs relevant session data.
- Automated Session Archival: Start/stop recording via API hooks so recordings are stored in object storage and linked to session metadata for compliance or training datasets.
Getting Started Tips
- Secure secrets: Never embed TRTC secrets in client apps—use MCP to mint transient tokens.
- Start locally with memory store, then switch to Redis or Mongo for production scale.
- Use TLS in production; configure reverse proxy (nginx) or provide TLS certs directly.
- Monitor /metrics and log critical events (token generation, join/leave, recording) for auditing.
For developer reference and sample integrations, consult the GitHub repository and the related Tencent TRTC SDK documentation for client-side wiring.