Skip to main content

Jellyfin MCP Server for Agentic AI!

Project description

Jellyfin - A2A | AG-UI | MCP

PyPI - Version MCP Server PyPI - Downloads GitHub Repo stars GitHub forks GitHub contributors PyPI - License GitHub

GitHub last commit (by committer) GitHub pull requests GitHub closed pull requests GitHub issues

GitHub top language GitHub language count GitHub repo size GitHub repo file count (file type) PyPI - Wheel PyPI - Implementation

Version: 0.2.26

Overview

Jellyfin MCP Server + A2A Agent

This repository implements a Model Context Protocol (MCP) server and an intelligent Agent-to-Agent (A2A) system for interacting with a Jellyfin Media Server.

It allows AI agents to manage your media library, control playback, query system status, and interact with connected devices using natural language.

This repository is actively maintained - Contributions are welcome!

Capabilities:

  • Media Management: Search and retrieve Movies, TV Shows, Music, and more.
  • System Control: Check server status, configuration, and logs.
  • User & Session Management: Manage users, view active sessions, and control playback.
  • Live TV: Access channels, tuners, and guide information.
  • Device Control: Interact with devices connected to the Jellyfin server.

MCP

MCP Tools

The system exposes a comprehensive set of tools, organized by domain. These can be used directly by an MCP client or orchestrated by the A2A Agent.

Domain Description Key Tags
Media Managing content (Movies, TV, Music), libraries, and metadata. Library, Items, Movies, TvShows, Music
System Server configuration, logs, plugins, tasks, and system info. System, Configuration, ActivityLog, ScheduledTasks
User User supervision, session management, and playstate control. User, Session, Playstate, DisplayPreferences
LiveTV Managing Live TV channels, tuners, and recordings. LiveTv, Channels
Device Managing connected client devices and remote control. Devices, QuickConnect

Using as an MCP Server

The MCP Server can be run in two modes: stdio (for local testing) or http (for networked access).

Environment Variables

The following environment variables are required to connect to your Jellyfin instance:

  • JELLYFIN_BASE_URL: The URL of your Jellyfin server (e.g., http://192.168.1.10:8096).
  • JELLYFIN_TOKEN: Your Jellyfin API Token.
  • OR
  • JELLYFIN_USERNAME: Your Jellyfin Username.
  • JELLYFIN_PASSWORD: Your Jellyfin Password.

Run in stdio mode (default):

export JELLYFIN_BASE_URL="http://localhost:8096"
export JELLYFIN_TOKEN="your_api_token"
jellyfin-mcp --transport "stdio"

Run in HTTP mode:

export JELLYFIN_BASE_URL="http://localhost:8096"
export JELLYFIN_TOKEN="your_api_token"
jellyfin-mcp --transport "http" --host "0.0.0.0" --port "8000"

A2A Agent

This package includes a sophisticated Supervisor Agent that delegates tasks to specialized sub-agents based on the user's intent.

Agent Architecture

  • Supervisor Agent: The entry point. Analyzes the request and routes it to the correct specialist.
  • Media Agent: Handles content queries ("Play Inception", "Find movies from 1999").
  • System Agent: Handles server ops ("Restart the server", "Check logs").
  • User Agent: Handles user data ("Create a new user", "What is Bob watching?").
  • LiveTV Agent: Handles TV ("What's on channel 5?").
  • Device Agent: Handles hardware ("Cast to Living Room TV").
---
config:
  layout: dagre
---
flowchart TB
 subgraph subGraph0["Agent Capabilities"]
        C["Supervisor Agent"]
        B["A2A Server - Uvicorn/FastAPI"]
        D["Sub-Agents"]
        F["MCP Tools"]
  end
    C --> D
    D --> F
    A["User Query"] --> B
    B --> C
    F --> E["Jellyfin API"]

     C:::agent
     D:::agent
     B:::server
     A:::server
     classDef server fill:#f9f,stroke:#333
     classDef agent fill:#bbf,stroke:#333,stroke-width:2px
     style B stroke:#000000,fill:#FFD600
     style F stroke:#000000,fill:#BBDEFB
     style A fill:#C8E6C9
     style subGraph0 fill:#FFF9C4

Component Interaction Diagram

sequenceDiagram
    participant User
    participant Server as A2A Server
    participant Supervisor as Supervisor Agent
    participant MediaAgent as Media Agent
    participant MCP as MCP Tools

    User->>Server: "Play the movie Inception"
    Server->>Supervisor: Invoke Agent
    Supervisor->>Supervisor: Analyze Intent (Media)
    Supervisor->>MediaAgent: Delegate Task
    MediaAgent->>MCP: get_items(search_term="Inception")
    MCP-->>MediaAgent: Item Details
    MediaAgent-->>Supervisor: Found "Inception", triggering playback...
    Supervisor-->>Server: Final Response
    Server-->>User: Output

Usage

MCP CLI

Short Flag Long Flag Description
-h --help Display help information
-t --transport Transport method: 'stdio', 'http', or 'sse' [legacy] (default: stdio)
-s --host Host address for HTTP transport (default: 0.0.0.0)
-p --port Port number for HTTP transport (default: 8000)
--auth-type Authentication type: 'none', 'static', 'jwt', 'oauth-proxy', 'oidc-proxy', 'remote-oauth' (default: none)
--token-jwks-uri JWKS URI for JWT verification
--token-issuer Issuer for JWT verification
--token-audience Audience for JWT verification
--oauth-upstream-auth-endpoint Upstream authorization endpoint for OAuth Proxy
--oauth-upstream-token-endpoint Upstream token endpoint for OAuth Proxy
--oauth-upstream-client-id Upstream client ID for OAuth Proxy
--oauth-upstream-client-secret Upstream client secret for OAuth Proxy
--oauth-base-url Base URL for OAuth Proxy
--oidc-config-url OIDC configuration URL
--oidc-client-id OIDC client ID
--oidc-client-secret OIDC client secret
--oidc-base-url Base URL for OIDC Proxy
--remote-auth-servers Comma-separated list of authorization servers for Remote OAuth
--remote-base-url Base URL for Remote OAuth
--allowed-client-redirect-uris Comma-separated list of allowed client redirect URIs
--eunomia-type Eunomia authorization type: 'none', 'embedded', 'remote' (default: none)
--eunomia-policy-file Policy file for embedded Eunomia (default: mcp_policies.json)
--eunomia-remote-url URL for remote Eunomia server

A2A CLI

Endpoints

  • Web UI: http://localhost:8000/ (if enabled)
  • A2A: http://localhost:8000/a2a (Discovery: /a2a/.well-known/agent.json)
  • AG-UI: http://localhost:8000/ag-ui (POST)
Short Flag Long Flag Description
-h --help Display help information
--host Host to bind the server to (default: 0.0.0.0)
--port Port to bind the server to (default: 9001)
--provider LLM Provider: 'openai', 'anthropic', 'google', 'huggingface'
--model-id LLM Model ID
--mcp-config Path to MCP config file

Examples

Run A2A Server

export JELLYFIN_BASE_URL="http://localhost:8096"
export JELLYFIN_TOKEN="your_token"
jellyfin-agent --provider openai --model-id gpt-4o --api-key sk-...

Docker

Build

docker build -t jellyfin-mcp .

Run MCP Server

docker run -d \
  --name jellyfin-mcp \
  -p 8000:8000 \
  -e TRANSPORT=http \
  -e JELLYFIN_BASE_URL="http://192.168.1.10:8096" \
  -e JELLYFIN_TOKEN="your_token" \
  knucklessg1/jellyfin-mcp:latest

Deploy with Docker Compose

Create a docker-compose.yml file:

services:
  jellyfin-mcp:
    image: knucklessg1/jellyfin-mcp:latest
    environment:
      - HOST=0.0.0.0
      - PORT=8000
      - TRANSPORT=http
      - JELLYFIN_BASE_URL=http://your-jellyfin-ip:8096
      - JELLYFIN_TOKEN=your_api_token
    ports:
      - 8000:8000

Configure mcp.json for AI Integration (e.g. Claude Desktop)

{
  "mcpServers": {
    "jellyfin": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "jellyfin-mcp",
        "jellyfin-mcp"
      ],
      "env": {
        "JELLYFIN_BASE_URL": "http://your-jellyfin-ip:8096",
        "JELLYFIN_TOKEN": "your_api_token"
      }
    }
  }
}

Install Python Package

python -m pip install jellyfin-mcp
uv pip install jellyfin-mcp

Repository Owners

GitHub followers GitHub User's stars

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jellyfin_mcp-0.2.26.tar.gz (442.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jellyfin_mcp-0.2.26-py3-none-any.whl (526.3 kB view details)

Uploaded Python 3

File details

Details for the file jellyfin_mcp-0.2.26.tar.gz.

File metadata

  • Download URL: jellyfin_mcp-0.2.26.tar.gz
  • Upload date:
  • Size: 442.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for jellyfin_mcp-0.2.26.tar.gz
Algorithm Hash digest
SHA256 0ddf0b9c78be6da95ebdfb5f861a5e8ef48b6c7d962281b34b63eb18510e0345
MD5 6b147c59427b7b086dc5f0ed511e9bf1
BLAKE2b-256 0e48f792a710cc289c11cb41a436f3a1dc32773981b343af0d43944b6194fa73

See more details on using hashes here.

File details

Details for the file jellyfin_mcp-0.2.26-py3-none-any.whl.

File metadata

  • Download URL: jellyfin_mcp-0.2.26-py3-none-any.whl
  • Upload date:
  • Size: 526.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for jellyfin_mcp-0.2.26-py3-none-any.whl
Algorithm Hash digest
SHA256 5168ba53e0a4b9b04a9efe080228af08a29c2b25a64bd12d47a6c8199f9b0872
MD5 838926c784b338d3e696827d374aa5a2
BLAKE2b-256 748a7379afc98cf62a84f02c4f7e371acc5eefa5d6376e87be452647ef2f61c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page