# Qencode MCP

> Qencode MCP Server automates high-performance video processing and live broadcasting. Connect your Qencode account to manage complex workflows—from initiating transcodes via `create_task` to setting up multi-target simulcasts with tools like `add_simulcast_target`. Your AI agent handles the whole pipeline, letting you monitor status, start streams, and update infrastructure directly from chat.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** video-transcoding, live-streaming, simulcast, video-api, cloud-encoding

## Description

**Qencode MCP Server** automates high-performance video processing and live broadcasting right through your chat interface. You don't have to juggle multiple dashboards or run complicated command lines; your AI agent handles the entire workflow—from encoding big files to setting up multi-location simulcasts.

When you use this server, your agent manages everything in one place: transcoding jobs, complex live streams, and infrastructure setup. It’s built for people who need reliable video delivery that scales fast. 

**Starting the Process: Transcoding Videos**

If you gotta convert source videos into different formats, you'll start by getting an access token using `get_access_token`. Once you have that key, you create a background job with `create_task`, defining exactly what sources and outputs you need. After the task is created, you kick off the actual conversion process by calling `start_encode`. You never forget where you left off because you can check the real-time progress of any running encoding job using its unique ID with `get_task_status`. This whole setup lets you manage massive batches of video files without ever leaving your chat.

**Running a Live Stream**

To go live, you first pull a temporary access key specific to streaming by calling `get_live_access_token`. Next, you define the entire stream using protocols like RTMP or WebRTC with `create_live_stream`, setting up all your initial parameters. Once everything's configured and ready to rock, you activate the feed with `start_live_stream`. When the broadcast is done, you terminate it cleanly using `stop_live_stream`. You can also fine-tune what’s happening during the stream; use `update_live_stream` if you need to change things like DVR retention settings or update encryption keys while the feed is running.

**Scaling and Infrastructure**

If one destination isn't enough, you gotta broadcast everywhere. If you want your content available on Twitch or YouTube simultaneously with your main stream, you use `add_simulcast_target` to send the signal to secondary destinations automatically. For rock-solid delivery, you can reserve a custom Content Delivery Network (CDN) domain name for all your video assets by calling `create_domain`. This gives you reliable endpoints for global distribution.

Your AI client handles this whole pipeline—it doesn't just run commands; it tracks the status of every task, manages credentials, and updates infrastructure settings using a single conversation thread. You get maximum control over your entire video lifecycle without touching a separate dashboard.

## Tools

### add_simulcast_target
Adds a secondary streaming destination (like Twitch or YouTube) to an already active live stream.

### create_domain
Creates and reserves a custom Content Delivery Network (CDN) domain name for your video assets.

### create_live_stream
Initializes and defines the settings for an entirely new live broadcast feed using specific protocols.

### create_task
Creates a background job to transcode one or more source videos into different output formats.

### get_access_token
Retrieves the temporary session token required before any video transcoding task can begin.

### get_live_access_token
Gets a specific, short-lived access key needed to start or manage live streaming sessions.

### get_task_status
Checks the current progress and final status of one or more running transcoding jobs using their unique IDs.

### start_encode
Kicks off a defined transcoding job, beginning the actual process of converting source video files.

### start_live_stream
Activates the live stream session after it has been successfully created and configured.

### stop_live_stream
Terminates an active live broadcast feed, ending the streaming connection gracefully.

### update_live_stream
Modifies existing live stream settings—things like changing DVR retention or updating keys.

## Prompt Examples

**Prompt:** 
```
Get a session access token for transcoding.
```

**Response:** 
```
I've retrieved your session token. You can now use it to initialize new transcoding tasks.
```

**Prompt:** 
```
Check the status of task tokens 550e8400-e29b and 660f9500-f30c.
```

**Response:** 
```
Task 550e8400-e29b is currently 'encoding' (45% complete), while task 660f9500-f30c has 'completed' successfully.
```

**Prompt:** 
```
Create a new live stream named 'Webinar' with RTMP input and HLS output.
```

**Response:** 
```
Live stream 'Webinar' has been created. Stream ID: st_98234. You can now start the stream using the `start_live_stream` tool.
```

## Capabilities

### Start Transcoding Jobs
The agent initializes video encoding tasks by accepting source/output parameters, creating a job ID for later monitoring.

### Manage Live Streams
You can create new live feeds (using protocols like RTMP or WebRTC), start them up, and stop them when done.

### Scale Broadcasts
The agent adds restreaming targets—like YouTube or Twitch—to an active stream so the content broadcasts to multiple places instantly.

### Monitor Progress
You track the real-time status of any encoding task, seeing if it's downloading, encoding, or finished.

### Configure Domains
The agent provisions and manages custom CDN domains needed for reliable video delivery.

## Use Cases

### Emergency Multi-Platform Broadcast
The platform architect needs to start an emergency live webinar. Instead of logging into three separate services, they ask their agent: 'Start a new stream named Beta with RTMP input.' The agent calls `create_live_stream` and `start_live_stream`. Then, it immediately runs `add_simulcast_target` for both YouTube and LinkedIn to ensure maximum reach.

### Automated VOD Prep
A video team finishes a raw recording. They prompt their agent: 'Transcode this file into 1080p MP4, 720p WebM, and generate thumbnails.' The agent calls `create_task`, waits for the token via `get_access_token`, then uses `start_encode`. They track progress until all formats are done using `get_task_status`.

### CDN Migration
The Ops Engineer needs to switch their primary CDN endpoint. Instead of updating configuration files manually, they tell the agent: 'Change our default domain.' The agent uses `create_domain` to provision and update the necessary endpoints via `update_live_stream`.

### Stream Maintenance
The broadcast needs a minor setting change (like increasing DVR retention). Rather than finding the specific panel in the dashboard, the engineer asks: 'Increase the stream's recorded history to 7 days.' The agent runs `update_live_stream` immediately.

## Benefits

- Transcoding doesn't wait. Use `start_encode` to kick off complex jobs, and then check the real-time progress with `get_task_status`. You never have to leave your editor just to monitor task completion.
- Scale live broadcasts instantly. After running `add_simulcast_target`, your single stream automatically hits YouTube, Twitch, and any other target you need. No manual setup required for every platform.
- Manage infrastructure without logging in. Use `create_domain` or `update_live_stream` to set up CDN endpoints or adjust DVR settings directly via a simple conversational prompt.
- It’s all about the keys. Your AI agent handles getting the necessary session tokens first—using `get_access_token` and `get_live_access_token`—before it attempts any action, preventing failed calls.
- The full lifecycle is covered. You can use `create_live_stream`, then `start_live_stream`, and finally `stop_live_stream`. It’s a complete control loop for your broadcast.

## How It Works

The bottom line is that instead of running commands sequentially in a terminal, you talk to your AI client, and it sequences all the necessary API calls for you.

1. First, your AI client calls `get_access_token` (or `get_live_access_token`) to grab the necessary session key.
2. Next, you use that key with a creation tool—like `create_task` or `create_live_stream`—to define the stream parameters and launch the setup.
3. Finally, your agent executes the action (`start_encode`, `start_live_stream`) and confirms the operation's status, giving you immediate confirmation.

## Frequently Asked Questions

**How do I check if my transcoding job worked using get_task_status?**
You pass the task ID(s) to `get_task_status`. The response tells you exactly what state it's in: 'downloading', 'encoding', or 'completed'. It’s great for debugging failed jobs too.

**What do I need before running start_live_stream?**
You first must call `get_live_access_token` to get the session key. Then you run `create_live_stream` to define the feed, and only after that can you use `start_live_stream`.

**How many targets can I add with add_simulcast_target?**
It adds one target per call. If you need multiple platforms (like YouTube and Twitch), you'll just run the `add_simulcast_target` tool once for each service.

**Can I update stream settings without stopping the feed? Use update_live_stream.**
Yes. The `update_live_stream` tool lets you modify things like DVR retention or keys while the broadcast is active, minimizing downtime and complexity.

**How do I get a session-based access token using get_access_token?**
You must call `get_access_token` first to generate the necessary API credentials. These tokens are session-based and required before you can use tools like `create_task` or `start_encode`.

**What steps are needed to set up a new endpoint using create_domain?**
Use `create_domain` to provision a unique, custom Content Delivery Network domain. This allows you to point your live streams or transcoded assets to your own branded URL instead of the default Qencode address.

**What specific JSON data must I pass to start_encode?**
You provide a JSON payload detailing the source, output format, and encoding parameters. The tool uses these explicit instructions to begin the transcoding process immediately after you have created a task.

**If I need to end a broadcast immediately, how does stop_live_stream work?**
Calling `stop_live_stream` terminates the active live feed instantly. This tool ensures that you can gracefully shut down your stream without manually interfering with the infrastructure setup or requiring an external client disconnect.

**How can I check if my video is finished encoding?**
Use the `get_task_status` tool with your task tokens. It returns the current state such as 'downloading', 'encoding', 'saving', or 'completed' for one or more tasks.

**Can I stream to multiple platforms like YouTube and Twitch at once?**
Yes! First create a stream with `create_live_stream`, then use `add_simulcast_target` to add external destinations to your live feed.

**Do I need to get an access token before every transcoding task?**
Yes, you must call `get_access_token` to receive a session-based token required by the `create_task` tool. For live streaming, use `get_live_access_token` instead.