# Qencode MCP

> Qencode automates high-performance video transcoding and live broadcasting using your AI client. Manage complex tasks—from creating custom CDN domains to running simulcasts on Twitch or YouTube—all through natural conversation with no command line required. It handles the entire media pipeline.

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

## Description

**Qencode MCP Server: Full-Stack Video Management**

Your AI client connects to Qencode for heavy-lifting video processing and live broadcasting. You don't touch a command line; your agent manages complex media pipelines—transcoding, setup, simulcasting—using nothing but natural conversation.

### Getting Started & Infrastructure Prep

Before you do anything else, your agent needs credentials. It first grabs an access token for encoding jobs using `get_access_token` or gets a specific live stream token via `get_live_access_token`. For reliable content delivery, the system lets your agent create and register custom Content Delivery Network (CDN) domains with `create_domain`. This ensures where you're sending your video is solid.

### Transcoding Jobs: Encoding Videos

The server handles creating and managing encoding tasks. You tell your agent to define a new job using `create_task`, specifying both the source file and all desired output formats in structured JSON. Once the task definition is locked down, you kick off the process with `start_encode`. The system keeps tabs on everything; if you need to know what's happening—whether it's encoding, failed, or complete—your agent checks the real-time status for multiple jobs using `get_task_status`.

### Live Broadcast Setup and Control

Starting a live stream requires setup. You first establish a brand new instance of the broadcast feed using `create_live_stream`, specifying all required protocols like RTMP or WebRTC, along with necessary delivery formats such as HLS/CMAF. Once the infrastructure is ready, your agent initiates the flow with `start_live_stream`. If you need to tweak anything about an active stream—say, changing DVR settings or adjusting protocols—you modify those existing configurations using `update_live_stream`. When you're done, your agent shuts it down cleanly and immediately with `stop_live_stream`.

### Multi-Platform Simulcasting

This thing handles broadcasting everywhere at once. You can tell your agent to add multiple restreaming destinations—like Twitch *and* YouTube—to an already running stream using `add_simulcast_target`. This keeps your live feed active and visible across every platform simultaneously, all from one spot.

### How It Works With Your Agent

Your AI client manages the entire sequence. When you say, "Set up a webinar broadcast," your agent understands it needs to first get the proper token, then maybe create a CDN domain if none exists, define the stream parameters, start the feed, and finally configure all the required restreaming targets—all without you ever touching the terminal. It's just talking to your AI client that handles the whole damn media pipeline.

## Tools

### add_simulcast_target
Adds a specific restreaming destination (like Twitch or YouTube) to an active live stream.

### create_domain
Creates and registers a custom Content Delivery Network (CDN) domain for your content.

### create_live_stream
Sets up a brand new live stream instance, requiring a valid live access token.

### create_task
Initializes and registers a new transcoding job, allowing you to define source and output formats.

### get_access_token
Retrieves a session-based access token required before running any transcoding tasks.

### get_live_access_token
Gets an access token needed specifically for managing and operating live streams.

### get_task_status
Checks the real-time status (encoding, failed, complete) for one or more registered transcoding tasks.

### start_encode
Begins a specific transcoding job using defined parameters and the required session token.

### start_live_stream
Initiates a live broadcast feed, starting the stream flow after setup is complete.

### stop_live_stream
Shuts down an active live broadcast feed gracefully and immediately.

### update_live_stream
Modifies existing live stream configurations, such as changing DVR settings or protocols.

## 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

### Manage transcoding jobs
Your agent creates new encoding tasks using `create_task` and starts them with parameters via `start_encode`. You can track progress for multiple running videos using `get_task_status`.

### Set up live broadcast infrastructure
You establish a new live stream instance using `create_live_stream`, specifying the necessary protocols (RTMP, WebRTC) and delivery formats.

### Manage streaming targets
The agent adds restreaming destinations like YouTube or Twitch to an existing broadcast using `add_simulcast_target`.

### Control stream lifecycle
You can start a feed with `start_live_stream`, modify its settings with `update_live_stream`, and shut it down cleanly using `stop_live_stream`.

### Configure CDN domains
The agent handles the creation of custom CDN domains using `create_domain`, which is necessary for reliable content delivery.

## Use Cases

### Running a multi-channel corporate webinar
The Content Platform Manager needs to broadcast a single event simultaneously on YouTube, Vimeo, and the company intranet. They use `create_live_stream` for setup, then call `add_simulcast_target` three times—once for each platform—to ensure perfect redundancy and coverage.

### Processing a large video archive nightly
The Video Engineer has hundreds of raw videos that need to be converted from MOV to MP4, HLS, and WebM. They call `create_task` for each file and then loop through `start_encode`, using `get_task_status` hourly until everything shows 'completed'.

### Setting up a temporary live stream quickly
A Product Team needs to run an emergency demo stream. They use the agent to first call `create_live_stream`, then get the necessary `get_live_access_token`. Finally, they execute `start_live_stream` in under five steps.

### Updating broadcast delivery settings mid-event
During a live stream, the Content Manager realizes the DVR window needs to be extended. Instead of logging into the dashboard, they call `update_live_stream`, making the necessary configuration change programmatically while the feed stays active.

## Benefits

- Streamline multi-platform delivery. Use `add_simulcast_target` to automatically push a single live feed to multiple services (like YouTube, Twitch) instantly.
- Manage complex media workflows from chat. You can initiate encoding runs with `create_task` and start them with `start_encode`, all without ever touching the CLI.
- Never lose track of jobs. Check real-time progress on batches of videos using `get_task_status`. The server tracks downloading, encoding, and saving status for you.
- Build reliable infrastructure fast. Use `create_domain` to provision custom CDN domains before setting up a stream, ensuring your audience always gets the content they expect.
- Full lifecycle control. Start with `create_live_stream`, update settings with `update_live_stream`, and wrap it all up cleanly using `stop_live_stream`.

## How It Works

The bottom line is that Qencode handles the entire media pipeline—from authentication and infrastructure setup to task execution and status reporting—all through tool calls.

1. First, your AI client must call `get_live_access_token` or `get_access_token` to retrieve the necessary session key.
2. Next, you tell your agent the objective—for example, 'Create a stream' or 'Encode this video.' The agent then executes setup tools (`create_domain`, `create_live_stream`).
3. Finally, once everything is configured and tokens are acquired, the agent runs the action tool (e.g., `start_live_stream` or `start_encode`) to execute your request.

## Frequently Asked Questions

**How do I start encoding videos using the Qencode server?**
You must first call `get_access_token` to get your session key. Then, use `create_task` to define the source and output formats, followed by `start_encode`.

**What's the difference between creating a live stream and starting it?**
`create_live_stream` only sets up the infrastructure—it reserves the slot on the platform. You must call `start_live_stream` afterward to actually begin sending video data.

**Can I connect my own custom CDN domain?**
Yes, you use the `create_domain` tool to provision and manage your custom CDN domains within the Qencode ecosystem.

**What should I do if a simulcast target fails?**
You can check the status of all running tasks using `get_task_status`. This helps you pinpoint whether the failure is in the encoding step or the delivery step.

**What is required before using the `create_task` tool?**
You must first call the `get_access_token` tool. This establishes a session-based token that your AI agent uses to authenticate all subsequent encoding commands and manage resources.

**How does the `get_task_status` tool report transcoding progress?**
It provides a real-time status for one or more tasks. The output includes the current stage (like 'encoding' or 'downloading') and a percentage complete, letting your agent track progress across multiple task IDs.

**Can I change live stream settings after calling `create_live_stream`?**
Yes, you use the `update_live_stream` tool. This function lets you adjust configurations—like DVR settings or output protocols—without needing to delete and recreate the entire broadcast setup.

**If I need to shut down a live session, how do I use `stop_live_stream`?**
Running the `stop_live_stream` tool immediately ends the active broadcast feed. This ensures resources are released cleanly and prevents continued streaming until you manually start it again.

**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.