
Mux Video and Data Platform
OfficialProvides API access to Mux's video platform for uploading videos, managing live streams, and retrieving analytics data. Enables AI assistants to programmatically interact with video infrastructure without using Mux's web dashboard.
Integrates with Mux's Video and Data platform to enable video upload, live stream management, analytics querying, and performance metrics tracking across video infrastructure without manual dashboard interaction.
What it does
- Upload videos to Mux platform
- Manage live streaming sessions
- Query video analytics and metrics
- Track video performance data
- Create and configure video assets
- Retrieve playback statistics
Best for
About Mux Video and Data Platform
Mux Video and Data Platform is an official MCP server published by muxinc that provides AI assistants with tools and capabilities via the Model Context Protocol. Integrate seamlessly with the Mux Video and Data Platform for easy video uploads, live stream control, analytics, and pe It is categorized under developer tools.
How to install
You can install Mux Video and Data Platform in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
License
Mux Video and Data Platform is released under the Apache-2.0 license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
Mux Node API Library
This library provides convenient access to the Mux REST API from server-side TypeScript or JavaScript.
[!NOTE] In February 2024 this SDK was updated to Version 8.0. For upgrading to 8.x see UPGRADE_8.x.md
The REST API documentation can be found on docs.mux.com. The full API of this library can be found in api.md.
MCP Server
Use the Mux MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
Note: You may need to set environment variables in your MCP client.
Installation
npm install @mux/mux-node
Usage
The full API of this library can be found in api.md.
import Mux from '@mux/mux-node';
const client = new Mux({
tokenId: process.env['MUX_TOKEN_ID'], // This is the default and can be omitted
tokenSecret: process.env['MUX_TOKEN_SECRET'], // This is the default and can be omitted
});
const asset = await client.video.assets.create({
inputs: [{ url: 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4' }],
playback_policies: ['public'],
});
console.log(asset.id);
Request & Response types
This library includes TypeScript definitions for all request params and response fields. You may import and use them like so:
import Mux from '@mux/mux-node';
const client = new Mux({
tokenId: process.env['MUX_TOKEN_ID'], // This is the default and can be omitted
tokenSecret: process.env['MUX_TOKEN_SECRET'], // This is the default and can be omitted
});
const params: Mux.Video.AssetCreateParams = {
inputs: [{ url: 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4' }],
playback_policies: ['public'],
};
const asset: Mux.Video.Asset = await client.video.assets.create(params);
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
JWT Helpers (API Reference)
You can use any JWT-compatible library, but we've included some light helpers in the SDK to make it easier to get up and running.
// Assuming you have your signing key specified in your environment variables:
// Signing token ID: process.env.MUX_SIGNING_KEY
// Signing token secret: process.env.MUX_PRIVATE_KEY
// Most simple request, defaults to type video and is valid for 7 days.
const token = mux.jwt.signPlaybackId('some-playback-id');
// https://stream.mux.com/some-playback-id.m3u8?token=${token}
// If you wanted to sign a thumbnail
const thumbParams = { time: 14, width: 100 };
const thumbToken = mux.jwt.signPlaybackId('some-playback-id', {
type: 'thumbnail',
params: thumbParams,
});
// https://image.mux.com/some-playback-id/thumbnail.jpg?token=${token}
// If you wanted to sign a gif
const gifToken = mux.jwt.signPlaybackId('some-playback-id', { type: 'gif' });
// https://image.mux.com/some-playback-id/animated.gif?token=${token}
// Here's an example for a storyboard
const storyboardToken = mux.jwt.signPlaybackId('some-playback-id', {
type: 'storyboard',
});
// https://image.mux.com/some-playback-id/storyboard.jpg?token=${token}
// You can also use `signViewerCounts` to get a token
// used for requests to the Mux Engagement Counts API
// https://docs.mux.com/guides/see-how-many-people-are-watching
const statsToken = mux.jwt.signViewerCounts('some-live-stream-id', {
type: 'live_stream',
});
// https://stats.mux.com/counts?token={statsToken}
Signing multiple JWTs at once
In cases you need multiple tokens, like when using Mux Player, things can get unwieldy pretty quickly. For example,
const playbackToken = await mux.jwt.signPlaybackId(id, {
expiration: "1d",
type: "playback"
})
const thumbnailToken = await mux.jwt.signPlaybackId(id, {
expiration: "1d",
type: "thumbnail",
})
const storyboardToken = await mux.jwt.signPlaybackId(id, {
expiration: "1d",
type: "storyboard"
})
const drmToken = await mux.jwt.signPlaybackId(id, {
expiration: "1d",
type: "drm_license"
})
<mux-player
playback-token={playbackToken}
thumbanil-token={thumbnailToken}
storyboard-token={storyboardToken}
drm-token={drmToken}
playbackId={id}
></mux-player>
To simplify this use-case, you can provide multiple types to signPlaybackId to recieve multiple tokens. These tokens are provided in a format that Mux Player can take as props:
// { "playback-token", "thumbnail-token", "storyboard-token", "drm-token" }
const tokens = await mux.jwt.signPlaybackId(id, {
expiration: "1d",
type: ["playback", "thumbnail", "storyboard", "drm_license"]
})
<mux-player
{...tokens}
playbackId={id}
></mux-player>
If you would like to provide params to a single token (e.g., if you would like to have a thumbnail time), you can provide [type, typeParams] instead of type:
const tokens = await mux.jwt.signPlaybackId(id, {
expiration: "1d",
type: ["playback", ["thumbnail", { time: 2 }], "storyboard", "drm_license"]
})
Parsing Webhook payloads
To validate that the given payload was sent by Mux and parse the webhook payload for use in your application,
you can use the mux.webhooks.unwrap utility method.
This method accepts a raw body string and a list of headers. As long as you have set your webhookSecret in the
appropriate configuration property when instantiating the library, all webhooks will be verified for authenticity automatically.
The following example shows how you can handle a webhook using a Next.js app directory API route:
// app/api/mux/webhooks/route.ts
import { revalidatePath } from 'next/cache';
import { headers } from 'next/headers';
import Mux from '@mux/mux-node';
const mux = new Mux({
webhookSecret: process.env.MUX_WEBHOOK_SECRET,
});
export async function POST(request: Request) {
const headersList = headers();
const body = await request.text();
const event = mux.webhooks.unwrap(body, headersList);
switch (event.type) {
case 'video.live_stream.active':
case 'video.live_stream.idle':
case 'video.live_stream.disabled':
/**
* `event` is now understood to be one of the following types:
*
* | Mux.Webhooks.VideoLiveStreamActiveWebhookEvent
* | Mux.Webhooks.VideoLiveStreamIdleWebhookEvent
* | Mux.Webhooks.VideoLiveStreamDisabledWebhookEvent
*/
if (event.data.id === 'MySpecialTVLiveStreamID') {
revalidatePath('/tv');
}
break;
default:
break;
}
return Response.json({ message: 'ok' });
}
Verifying Webhook Signatures
Verifying Webhook Signatures is optional but encouraged. Learn more in our Webhook Security Guide
/*
If the header is valid, this function will not throw an error and will not return a value.
If the header is invalid, this function will throw one of the following errors:
- new Error(
"The webhook secret must either be set using the env var, MUX_WEBHOOK_SECRET, on the client class, Mux({ webhookSecret: '123' }), or passed to this function",
);
- new Error('Could not find a mux-signature header');
- new Error(
'Webhook body must be passed as the raw JSON string sent from the server (do not parse it first).',
);
- new Error('Unable to extract timestamp and signatures from header')
- new Error('No v1 signatures found');
- new Error('No signatures found matching the expected signature for payload.')
- new Error('Webhook timestamp is too old')
*/
/*
`body` is the raw request body. It should be a string representation of a JSON object.
`headers` is the value in request.headers
`secret` is the signing secret for this configured webhook. You can find that in your webhooks dashboard
(note that this secret is different than your API Secret Key)
*/
mux.webhooks.verifySignature(body, headers, secret);
Note that when passing in the payload (body) you want to pass in the raw un-parsed request body, not the parsed JSON. Here's an example if you are using express.
const Mux = require('@mux/mux-node');
const mux = new Mux();
const express = require('express');
const bodyParser = require(
---
*README truncated. [View full README on GitHub](https://github.com/muxinc/mux-node-sdk).*
Alternatives
Related Skills
Browse all skillsUse when working with the OpenAI API (Responses API) or OpenAI platform features (tools, streaming, Realtime API, auth, models, rate limits, MCP) and you need authoritative, up-to-date documentation (schemas, examples, limits, edge cases). Prefer the OpenAI Developer Documentation MCP server tools when available; otherwise guide the user to enable `openaiDeveloperDocs`.
Execute complete platform migrations to or from MaintainX. Use when migrating from legacy CMMS systems, performing major re-platforming, or transitioning to MaintainX from spreadsheets or other tools. Trigger with phrases like "migrate to maintainx", "maintainx migration", "cmms migration", "switch to maintainx", "maintainx data migration".
Use when building MCP servers or clients that connect AI systems with external tools and data sources. Invoke for MCP protocol compliance, TypeScript/Python SDKs, resource providers, tool functions.
CCXT cryptocurrency exchange library for TypeScript and JavaScript developers (Node.js and browser). Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors. Use when working with crypto exchanges in TypeScript/JavaScript projects, trading bots, arbitrage systems, or portfolio management tools. Includes both REST and WebSocket examples.
Complete integration guide for the Fliz REST API - an AI-powered video generation platform that transforms text content into professional videos with voiceovers, AI-generated images, and subtitles. Use this skill when: - Creating integrations with Fliz API (WordPress, Zapier, Make, n8n, custom apps) - Building video generation workflows via API - Implementing webhook handlers for video completion notifications - Developing automation tools that create, manage, or translate videos - Troubleshooting Fliz API errors or authentication issues - Understanding video processing steps and status polling Key capabilities: video creation from text/Brief, video status monitoring, translation, duplication, voice/music listing, webhook notifications.
.NET/C# backend developer for ASP.NET Core APIs with Entity Framework Core. Builds REST APIs, minimal APIs, gRPC services, authentication with Identity/JWT, authorization, database operations, background services, SignalR real-time features. Activates for: .NET, C#, ASP.NET Core, Entity Framework Core, EF Core, .NET Core, minimal API, Web API, gRPC, authentication .NET, Identity, JWT .NET, authorization, LINQ, async/await C#, background service, IHostedService, SignalR, SQL Server, PostgreSQL .NET, dependency injection, middleware .NET.