# Livepeer MCP

> Livepeer manages your entire decentralized video pipeline. Use this MCP Server to upload assets from external URLs, create live streams, generate short clips from active broadcasts, and monitor real-time viewership metrics—all via conversation with your AI agent.

## Overview
- **Category:** cloud-infrastructure
- **Price:** Free
- **Tags:** video-streaming, decentralized-video, live-streaming, video-api, web3-video

## Description

**Livepeer manages your whole decentralized video pipeline.** You're gonna use this MCP Server to handle everything from uploading raw assets and setting up live broadcasts, to generating short clips and tracking viewership numbers—all through conversation with your AI agent.

### Asset Ingestion and Management

To start working with video, you gotta get the assets into Livepeer first. You can list every asset already stored in your account's library using `list_assets`. If you need details on a specific file, `get_asset` pulls all that metadata for you. For bringing content in, you have two main options: you can use `request_asset_upload` to get a direct, temporary URL from Livepeer and start the upload process there, or if your asset is already hosted somewhere else (like HTTP, IPFS, or Arweave), you just run `upload_asset_via_url`. Once you're done with an asset—whether it's old garbage or something that broke—you can delete it using `delete_asset`.

### Stream Setup and Control

Setting up your stream is where the magic happens. To start a totally new, dedicated live broadcast session, you run `create_stream`. If you need to shut down an active feed immediately, you use `terminate_stream`, which forces the cleanup of any running session. For advanced distribution, you can create a multi-platform target using `create_multistream_target` if you want one source beamed out to places like YouTube or Twitch; you'll then manage those settings by calling `update_multistream_target` and check their config with `get_multistream_target`. To deal with private meetings, you can establish a new WebRTC multi-participant room using `create_room`, and then add specific users to that meeting via `create_room_user`. You'll need to update the stream settings—like changing the title or bitrate—by running `update_stream`, and check the status of any active feed with `get_stream` or see a list of all your streams (active or paused) using `list_streams`. The room you created can even broadcast its output out to a standard live platform (RTMP) by calling `start_room_egress`. You can also delete an entire multi-platform target setup using `delete_multistream_target`.

### Content Processing & Clipping

Don't let great footage sit there. If you want to pull a short segment out of an ongoing live broadcast, run `create_clip`, which generates that timestamped clip instantly. For background processing—say, converting your raw footage into multiple formats or resolutions for on-demand use—you schedule the job with `create_transcode_job`. You can track the progress and see if it succeeded or failed by running `get_task` against a specific job ID, and you get a list of all past jobs using `list_tasks`. When you're done with your content management, remember you can also delete any associated assets via `delete_asset`.

### Real-Time Analytics Retrieval & Monitoring

This is how you see if people are actually watching. To get the live count of viewers connected to a stream right now, use `get_realtime_viewership`. For historical data on who's watching—like breakdowns by device type or location—you run `get_viewership_metrics`. You can figure out your overall operational costs and usage numbers (total minutes transcoded, data delivered) using `get_usage_metrics`. To check the details of past broadcasts, you list all finished sessions with `list_sessions` then pull specific info for one session ID using `get_session`. If that session created clips, you can see a list by running `get_session_clips`. For persistent notifications about what's happening in your infrastructure (like when an asset finishes processing), you set up a callback URL with `create_webhook`, monitor its details with `get_webhook`, and clean it up later using `delete_webhook`.

### Other Tools You Need to Know

To keep everything organized, you can list all past broadcast sessions that have wrapped up by running `list_sessions`. If you need the necessary URLs or metadata just to play back a specific asset or stream, `get_playback_info` gives it to you. Finally, if you're managing your webhooks and need to change their destination parameters, use `update_webhook`, and likewise, if you want to modify an existing multi-platform target's keys or URLs, you run `update_multistream_target`.

## Tools

### create_clip
Generates a short video clip from an active live broadcast session using time markers.

### create_multistream_target
Sets up a single content source to be broadcast across multiple destinations like YouTube or Twitch.

### create_room
Establishes a new, private WebRTC multi-participant video room for real-time collaboration.

### create_room_user
Adds a specific user identity to an existing WebRTC meeting room.

### create_stream
Initializes and sets up a brand new, dedicated live streaming session.

### create_transcode_job
Schedules the processing of a video file into different formats or resolutions for on-demand use.

### create_webhook
Sets up a callback URL to receive real-time event notifications from the Livepeer infrastructure.

### delete_asset
Removes an existing video asset from your account storage.

### delete_multistream_target
Deactivates and removes a configured multi-platform broadcast target.

### delete_stream
Permanently shuts down and removes an active live stream session.

### delete_webhook
Removes a configured webhook subscription endpoint.

### get_asset
Retrieves all metadata and details for a specific stored video asset.

### get_multistream_target
Fetches the current configuration details of a multi-platform broadcast target.

### get_playback_info
Retrieves necessary URLs and metadata needed to play back any asset or active stream.

### get_realtime_viewership
Queries the current number of viewers connected to a live session in real time.

### get_session_clips
Lists and retrieves all generated video clips associated with a given session ID.

### get_session
Retrieves overall details about a specific completed broadcast session.

### get_stream
Fetches the current configuration status and details of an active stream.

### get_task
Retrieves the status (success/failure) and output of a background job, like transcoding or uploading.

### get_usage_metrics
Calculates total usage metrics, including minutes transcoded and data delivered via CDN.

### get_viewership_metrics
Provides a historical breakdown of audience data by device type, browser, or geographic location.

### get_webhook
Retrieves the configuration and status of an existing webhook endpoint.

### list_assets
Lists all video assets currently stored in your account's asset library.

### list_sessions
Retrieves a list of all past broadcast sessions you have run.

### list_streams
Lists the status and details of all streams, both active and paused.

### list_tasks
Retrieves a list of all background processing jobs that have run on your account.

### request_asset_upload
Requests a direct, temporary URL from Livepeer to begin uploading a new asset securely.

### start_room_egress
Broadcasts the output of an active WebRTC room session out to a standard live stream platform (RTMP).

### terminate_stream
Forces the immediate shutdown and cleanup of any running live streaming session.

### update_asset
Modifies metadata or settings for an existing video asset without changing its content.

### update_multistream_target
Changes the destination details (like keys or URLs) for a configured multi-platform broadcast target.

### update_stream
Modifies settings of an existing live stream, such as its title or bitrate.

### update_webhook
Changes the parameters and destination URL for a configured webhook endpoint.

### upload_asset_via_url
Upload an asset using an external URL (HTTP, IPFS, Arweave)

## Prompt Examples

**Prompt:** 
```
List all my video assets on Livepeer.
```

**Response:** 
```
I've retrieved your assets. You have 3 videos: 'Intro.mp4' (ID: asset_123), 'Tutorial.mov' (ID: asset_456), and 'Webinar_Rec.mp4' (ID: asset_789). Would you like details on any of them?
```

**Prompt:** 
```
Create a new live stream called 'Community Call'.
```

**Response:** 
```
Stream 'Community Call' has been created successfully. Your Stream Key is `xxxx-xxxx-xxxx` and the RTMP ingest URL is `rtmp://rtmp.livepeer.com/live`. Ready to broadcast!
```

**Prompt:** 
```
Show me the usage metrics for my account.
```

**Response:** 
```
Fetching usage data... This month you have transcoded 450 minutes of video and delivered 1.2TB of data via the CDN. Your current storage usage is at 85GB.
```

## Capabilities

### Stream Setup and Control
Creates, updates, or terminates live broadcast sessions and multi-platform distribution targets.

### Asset Ingestion and Management
Uploads video files from external URLs (HTTP/IPFS) and allows retrieval or deletion of stored media assets.

### Content Processing & Clipping
Generates specific, timestamped short clips from ongoing live streams or schedules background transcode jobs for raw footage.

### Real-Time Analytics Retrieval
Queries current audience numbers and detailed usage statistics (bandwidth, minutes) in real time.

## Use Cases

### The Post-Event Recap
A content creator just finished a 4-hour webinar. Instead of downloading hours of footage to manually find clips, they tell their agent: 'Generate three 60-second clips from the last hour covering Q&A.' The agent runs `create_clip` with precise timestamps and delivers the ready-to-use assets.

### The Live Incident Response
An engineer detects a sudden drop in viewership. They ask their agent to run `get_realtime_viewership`. The agent returns data showing that 80% of viewers are on mobile Chrome, leading the engineer to adjust stream settings via `update_stream` immediately.

### Cross-Platform Launch
A marketing team needs a single live event broadcast everywhere. They tell their agent: 'Set up multi-platform delivery for the new product.' The agent runs `create_multistream_target`, linking one source to both Twitch and YouTube simultaneously.

### The Clean Up Crew
A developer finishes a test stream. Instead of manually logging into three different dashboards, they ask their agent: 'Terminate the stream and delete all associated assets.' The agent runs `terminate_stream` followed by `delete_asset`, cleaning up everything in one command.

## Benefits

- Instantly get performance data. Instead of manually checking dashboards, call `get_realtime_viewership` to know the audience size and location breakdown instantly.
- Automate content processing. Use `create_clip` to generate highlight reels from an active stream—no manual recording or timeline scrubbing required.
- Handle massive scale without effort. Set up multi-platform delivery using `create_multistream_target`, routing your single source feed to multiple services simultaneously.
- Track costs and usage accurately. Run `get_usage_metrics` anytime to get a precise count of total minutes transcoded and data delivered, simplifying billing audits.
- Manage entire rooms via code. Use `create_room` or `start_room_egress` to set up private collaboration spaces and then broadcast them live—all within the agent workflow.

## How It Works

The bottom line is you run complex, multi-stage video operations—from ingest to analysis—using simple natural language commands.

1. 1. Subscribe to the Livepeer server and input your API Key.
2. 2. Tell your AI client exactly what needs doing (e.g., 'Start a stream for my new product launch').
3. 3. The agent executes the necessary tool calls (like `create_stream`), managing the entire video infrastructure setup in chat.

## Frequently Asked Questions

**How do I check how many people are watching right now using get_realtime_viewership?**
You call `get_realtime_viewership` and the agent returns a live count. This query gives you instant metrics, preventing the need to refresh complex dashboard pages.

**Can I use create_clip for old streams or only active ones?**
`create_clip` is designed specifically for generating short videos from an *active* live stream. For clips from past sessions, you should first retrieve the session details using `get_session`, and then check if associated clips exist via `get_session_clips`.

**What's the difference between list_assets and get_asset?**
`list_assets` gives you a directory, showing names and IDs of all stored videos. `get_asset` requires you to specify one asset ID and returns all its detailed metadata.

**How do I make my stream available on multiple platforms?**
You use `create_multistream_target`. This tool sets up the connection, allowing your content source to automatically broadcast across several different services simultaneously.

**When I use `create_stream`, what information does it need besides a title?**
It requires specific parameters like bitrate, codec, and duration settings. You must provide these details so the server can correctly initialize the streaming pipeline.

**If I change my delivery platform, how do I update my targets using `update_multistream_target`?**
You need to pass the existing target ID and the new configuration parameters. The tool validates these changes before applying them across all connected endpoints.

**How can I check if a background job, like transcoding, finished using `get_task`?**
The function returns a status code that tells you the current state. Look for 'completed' or 'failed'; otherwise, it means the task is still processing.

**Before uploading a large file, how do I get an upload URL using `request_asset_upload`?**
The tool immediately generates a secure, temporary URL for you. You use this link to push your data directly, bypassing the need for client-side uploads.

**Can I upload videos directly from IPFS or Arweave?**
Yes! Use the `upload_asset_via_url` tool and provide the decentralized storage URL. Livepeer will ingest the asset and make it available for playback.

**How do I create a highlight clip from a running stream?**
Use the `create_clip` action by providing the `streamId` and the specific `startTime` and `endTime`. The agent will trigger the clipping process on the Livepeer network.

**Can I monitor how many viewers are currently watching my stream?**
Absolutely. Use the `get_realtime_viewership` tool with your playback ID to fetch current audience metrics directly from the Livepeer analytics engine.