# LiveKit Real-Time Rooms MCP

> LiveKit Real-Time Rooms MCP Server manages voice and video room lifecycles. Use this server to programmatically create, delete, and list rooms. You can control participants—like muting tracks or removing users—and broadcast data payloads to everyone in the session from your AI client.

## Overview
- **Category:** communication
- **Price:** Free
- **Tags:** livekit, voice-chat, video-rooms, webrtc, real-time, twirp, ai-agents, open-source

## Description

This MCP gives your AI client direct control over live voice and video sessions running on LiveKit. You're not just connecting; you're managing the entire lifecycle of a room from start to finish. It lets your agent act like a dedicated session operator, controlling everything programmatically without needing to touch an actual dashboard.

**Room Provisioning & Discovery**
You can manage the existence of rooms using **`create_room`**, which provisions a brand new LiveKit room based on specific parameters and requires access tokens. If you need to shut down an active session, **`delete_room`** handles it by immediately disconnecting every participant currently in that space. To see what's running, you use **`list_rooms`**; this tool gives you a full rundown of all active rooms across the entire LiveKit server instance.

**Participant and User Management**
The tools let you track who's connected and control their session state. You can pull up an inventory of everyone in a room using **`list_participants`**, which generates a list of every single user currently logged in. If you need deep details on just one person, **`get_participant`** retrieves all the specific information associated with that individual participant inside the room. When you decide to enforce removal, **`remove_participant`** forces an exit, revoking the user's access token and kicking them out of the session. You can also modify the data attached to a specific person by using **`update_participant_metadata`**, letting you change the structured information tied to their account within that room.

**Session Moderation & Control**
When moderation is necessary, you've got **`mute_track`**. This function allows you to silence or reactivate a participant’s specific published audio feed or video stream. For controlling core session settings—like timeouts or the formal name of the room itself—you use **`update_room_metadata`** to modify structured data that applies universally across the entire room environment.

**Data Broadcasting & State Updates**In terms of communication, you've got two main mechanisms. First, you can send a targeted message to every person in the room using **`send_data`**. This tool lets you choose between reliable delivery, ensuring the message gets through even if there are network hiccups, or lossy delivery for less critical status updates.

**Summary of Mechanisms**
*   **Creating and Deleting Rooms:** You use **`create_room`** to spin up a session and **`delete_room`** to terminate it.
*   **Listing Rooms:** **`list_rooms`** gives you the global view of all active sessions.
*   **Checking Users:** **`list_participants`** generates an immediate roster, while **`get_participant`** dives deep into a single user's specific data points.
*   **Controlling Users:** You can enforce removal with **`remove_participant`**, or update their profile details using **`update_participant_metadata`**.
*   **Managing Streams:** **`mute_track`** lets you control live audio and video feeds for moderation purposes.
*   **Broadcasting State:** **`send_data`** pushes messages to everyone, choosing whether they need guaranteed delivery or if a lossy update is fine.
*   **Setting Data:** You use **`update_room_metadata`** to adjust the core data structure of the room itself.

## Tools

### create_room
Creates a new LiveKit room using specified parameters and access tokens.

### list_rooms
Lists all active rooms running on the entire LiveKit server instance.

### delete_room
Deletes an active room, ensuring all connected participants are disconnected.

### get_participant
Retrieves detailed information about a specific participant currently in a room.

### list_participants
Generates a list of every user currently connected to the specified room.

### mute_track
Silences or reactivates a participant's published audio or video stream for moderation purposes.

### remove_participant
Forces a participant out of a room and revokes their associated access token.

### send_data
Broadcasts a data message to all participants in a room, choosing between reliable or lossy delivery modes.

### update_participant_metadata
Changes the metadata associated with an individual participant's account within the room.

### update_room_metadata
Modifies structured data that applies to the entire room session.

## Prompt Examples

**Prompt:** 
```
List all active rooms on my LiveKit server.
```

**Response:** 
```
I've queried your LiveKit server. There are currently 3 active rooms: 'support-call-42' (2 participants), 'team-standup' (5 participants), and 'demo-room' (0 participants). Which one would you like to manage?
```

**Prompt:** 
```
Create a room called 'interview-session' with a max of 3 participants.
```

**Response:** 
```
Done! Room 'interview-session' has been created on your LiveKit server with a 10-minute empty timeout and a max of 3 participants. Participants can now join using an access token scoped to this room.
```

**Prompt:** 
```
Remove the participant 'user-abc' from room 'support-call-42'.
```

**Response:** 
```
Participant 'user-abc' has been removed from room 'support-call-42'. Their access token has been revoked and they will need a new token to rejoin.
```

## Capabilities

### Provision Rooms
Create and delete voice/video rooms using `create_room` or `delete_room`.

### Manage Users in Sessions
List, inspect, remove participants, and update user metadata with tools like `list_participants`, `get_participant`, and `update_participant_metadata`.

### Moderate Audio/Video Feeds
Control live content streams by muting or unmuting a participant's specific audio or video track using `mute_track`.

### Broadcast State Data
Send targeted data messages to every person in the room with guaranteed or lossy delivery via `send_data`.

### Control Room Settings
Update core room information, like timeouts or session names, using `update_room_metadata`.

## Use Cases

### Automated Onboarding Call Setup
A sales agent needs to set up a demo call. The agent first calls `create_room` with specific limits. Once users join, the agent uses `update_participant_metadata` for each person (e.g., setting 'Role: Prospect') so that later tools can reference their correct identity.

### Real-Time Moderation During Broadcast
A live stream detects inappropriate content. The agent immediately calls `mute_track` on the offending user's feed. If they persist, the agent escalates by running `remove_participant`, ensuring clean session management.

### Group Status Broadcasting
In a large conference room setup, the moderator needs to announce key milestones. They use `send_data` to send a broadcast message (e.g., 'Break in 5 minutes') that all participants receive reliably.

### Audit and Cleanup
When a meeting ends, the agent first uses `list_participants` to verify everyone has left. Then, it calls `delete_room` to clean up the session resources entirely, preventing stale room records.

## Benefits

- Automate moderation instantly. Instead of manually muting streams, your agent runs `mute_track` to enforce content policies in real-time.
- Maintain session state perfectly. Use `update_room_metadata` to ensure all participants see the latest room status (like 'Meeting Topic: Q3 Budget').
- Control who's present. With `list_participants`, your agent can check occupancy before starting a call, and use `remove_participant` if someone misbehaves.
- Guarantee data transfer. Use `send_data` to broadcast critical updates (e.g., 'Session paused') with guaranteed or low-latency delivery modes.
- Manage the entire lifecycle. You can build complex flows using `create_room` and ensure cleanup by calling `delete_room` when the session ends.

## How It Works

The bottom line is, your AI client treats real-time room management like calling a function: input parameters, get guaranteed results.

1. Your AI client calls a tool (e.g., `create_room`) and passes necessary parameters.
2. The MCP server executes the corresponding LiveKit API call to manage the room state on the backend.
3. The server returns a status confirmation or the requested data payload (e.g., a list of participants).

## Frequently Asked Questions

**Can I use the `list_rooms` tool with LiveKit Real-Time Rooms MCP Server?**
Yes, you can. It lists all active rooms on your server instance, which is useful for auditing or finding a specific room ID to target later.

**How do I make sure data gets delivered using `send_data`?**
You specify the delivery mode when calling `send_data`. Use "reliable" if you absolutely must guarantee the message gets through, or use "lossy" for messages where speed is more important than perfect receipt.

**`remove_participant` revokes their access token automatically?**
Yes. When your agent runs `remove_participant`, it handles the cleanup by revoking the user's token, ensuring they can't rejoin using old credentials.

**Does updating metadata require knowing every single participant ID?**
No. For general room status changes, you use `update_room_metadata`. If you only need to change one person's details, use `get_participant` first to confirm the ID and then run `update_participant_metadata`.

**What parameters can I set when using the `create_room` tool?**
You define timeouts and participant limits in the request. This lets you control how long a room stays open or how many people can join, which is key for managing session scope.

**How does `get_participant` help me verify who is currently active?**
You pass the participant's ID to this tool. It returns detailed info—like their current status and metadata—so you don't have to list everyone just to check one person.

**Can I use `mute_track` if a user hasn't started broadcasting audio or video?**
No. You must first confirm the participant is publishing an active track before calling `mute_track`. Otherwise, the API call will fail because the resource doesn't exist.

**Is updating metadata via `update_participant_metadata` safe for other profile data?**
Yes. This tool only touches the participant's stored metadata fields. It won't change their username, display name, or general connection status.

**Can I list all active rooms on my LiveKit server?**
Yes! Use the `list_rooms` tool. It calls the LiveKit RoomService ListRooms endpoint and returns all currently open rooms with their participant count, metadata, and creation time.

**How do I mute a participant's microphone?**
First use `list_participants` to get the track SID for the participant's audio track. Then call `mute_track` with the room name, participant identity, track SID, and muted set to 'true'.

**Does this work with self-hosted LiveKit servers?**
Yes! Just provide your self-hosted server's URL (e.g., https://livekit.yourserver.com) as the Host URL, along with the API Key and Secret from your server's config.yaml.