RE

Restream MCP Server for Multi-Platform Stream Management

Manage multi-platform live streams with the Restream MCP server, control channels, and access real-time streaming analytics.

Quick Install
npx -y @shaktech786/restream-mcp-server

Overview

Restream MCP Server is a lightweight API server that helps teams manage multi-platform live streaming workflows and collect real-time analytics. It centralizes control of streaming channels and abstracts platform-specific operations (start/stop streams, update destinations), while providing unified metrics about stream health and audience engagement across destinations.

Designed for developers and operations teams, the server acts as a control plane and telemetry collector: it exposes REST endpoints for channel and stream management, and provides real-time analytics feeds (WebSocket / SSE) for dashboards or automation. This makes it easier to build monitoring tools, automate stream actions, and integrate streaming data into analytics pipelines without dealing with each platform’s API directly.

Features

  • Channel management: create, update, list, and delete stream channels and destinations
  • Stream control: start, stop, and schedule streams across multiple platforms
  • Real-time telemetry: WebSocket / Server-Sent Events (SSE) feeds for live metrics
  • Unified analytics: aggregated metrics (viewers, bitrate, dropped frames) across destinations
  • Authentication: API key / token-based access control
  • Extensible configuration: plugin hooks or connectors for new streaming platforms
  • Docker-friendly: run as a container for production deployments
  • Logging and metrics: request logging and basic observability hooks

Installation / Configuration

Clone the repository and install dependencies (Node.js example):

git clone https://github.com/shaktech786/restream-mcp-server.git
cd restream-mcp-server
npm install

Create a .env file with required variables (example):

PORT=3000
API_KEY=supersecretapikey
MONGO_URI=mongodb://localhost:27017/restream
LOG_LEVEL=info
WEBSOCKET_PATH=/ws

Start the server in development:

npm run dev
# or
node ./src/index.js

Run with Docker:

docker build -t restream-mcp-server .
docker run -p 3000:3000 --env-file .env restream-mcp-server

Configuration notes:

  • API_KEY (or token provider) secures administrative endpoints.
  • MONGO_URI (or other DB connection) stores channel and analytics metadata.
  • You can swap persistence to Redis or another store by editing the connector layer in configuration.

Available Tools / Resources

  • REST HTTP API (JSON) — primary interface for management operations
  • WebSocket / SSE endpoint — subscribe to live telemetry and events
  • OpenAPI / Swagger (if provided) — use for client generation and interactive testing
  • Postman collection (optional) — ready-made requests for common workflows
  • Example client snippets — cURL, Node.js, and browser WebSocket examples inside the repo

Sample endpoints overview:

MethodPathPurpose
POST/api/channelsCreate a channel with destinations
GET/api/channelsList channels
GET/api/channels/:idGet channel details
PUT/api/channels/:idUpdate channel configuration
DELETE/api/channels/:idRemove channel
POST/api/streams/:channelId/startStart stream on channel
POST/api/streams/:channelId/stopStop stream on channel
GET/api/analytics/:channelIdFetch recent aggregated metrics
WS/SSE/ws or /eventsReal-time telemetry feed

Authentication: pass an API key in the Authorization header:

Authorization: Bearer <API_KEY>

Use Cases

  1. Centralized Stream Control for a Production Studio

    • Use the MCP server to store channel destinations (YouTube, Twitch, Facebook) and trigger start/stop commands from a single dashboard. Schedule automated start/stop during events to ensure consistent multi-platform distribution.
  2. Live Monitoring Dashboard

    • Connect a dashboard (Grafana, custom React app) to the server’s WebSocket feed to visualize viewers, bitrate, and dropped frames in real time. Configure alerts when bitrate drops or audience count falls below thresholds.
  3. Automated Failover and Recovery

    • Subscribe to telemetry events and implement a small automation worker that reroutes a destination or restarts the stream when the server reports persistent errors for a particular platform. This reduces manual intervention during live events.
  4. Analytics Pipeline for Post-Event Reporting

    • Collect aggregated session metrics via the analytics endpoints and export them to a data warehouse. Correlate viewership and quality metrics with marketing or user segments to inform future streaming strategies.
  5. Integrations with CI/CD or Scheduling Tools

    • Trigger stream configuration updates as part of a CI/CD pipeline (e.g., update destinations for a new release) or integrate with calendar-based scheduling services to automate event streams.

Examples

Create a channel (curl):

curl -X POST http://localhost:3000/api/channels \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Event Channel",
    "destinations": [
      {"platform": "youtube", "streamKey": "XXX"},
      {"platform": "twitch", "streamKey": "YYY"}
    ]
  }'

Subscribe to real-time telemetry (wscat example):

wscat -c "ws://localhost:3000/ws?api_key=$API_KEY"
# Receive JSON messages for telemetry events

Fetch analytics:

curl http://localhost:3000/api/analytics/<channelId> \
  -H "Authorization: Bearer $API_KEY"

For full reference and source code, see the project repository: https://github.com/shaktech786/restream-mcp-server.