媒体服务器 MCP 标志

媒体服务器 MCP

社区
wyattjoh

A Model Context Protocol (MCP) server that provides AI assistants with tools to manage Radarr (movies), Sonarr (TV series) media servers, and access IMDB data through natural language interactions.

发布者wyattjoh
代码仓库media-server-mcp
语言TypeScript
复刻数
4
星标数
14
可用工具
0
传输类型stdio
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    媒体服务器 MCP 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 14 个星标和 4 个复刻。

Media Server MCP

A Model Context Protocol (MCP) server that provides AI assistants with tools to manage Radarr (movies), Sonarr (TV series), Plex media servers, and access TMDB data through natural language interactions.

Packages

This is a monorepo containing the following packages:

Features

  • Radarr Integration: Search, add, manage, and monitor movies
  • Sonarr Integration: Search, add, manage, and monitor TV series
  • Plex Integration: Browse libraries, search content, and manage Plex media server
  • TMDB Integration: Advanced movie/TV discovery, external ID lookup, and comprehensive metadata
  • Tool Configuration System: Reduce tool clutter with native profiles (18-70 tools), branch-based filtering, or the 3-tool Code Mode discovery facade
  • MCP Resources: Expose service configs and dynamic data (movies, series, collections, genres) as readable resources
  • MCP Prompts: Built-in prompts for common workflows (add-movie, add-series, library-report, recommendations)
  • Flexible Service Configuration: Each service is optional - configure any combination
  • Type-Safe: Built with TypeScript for reliable operations
  • Easy Setup: Install directly from JSR with a single deno run command

Installation

JSR (Recommended)

Add to your MCP servers configuration using the JSR package:

json
{
  "mcpServers": {
    "media-server": {
      "command": "deno",
      "args": ["run", "--allow-all", "jsr:@wyattjoh/media-server-mcp"],
      "env": {
        "RADARR_URL": "http://localhost:7878",
        "RADARR_API_KEY": "your-radarr-api-key",
        "SONARR_URL": "http://localhost:8989",
        "SONARR_API_KEY": "your-sonarr-api-key",
        "TMDB_API_KEY": "your-tmdb-api-key",
        "PLEX_URL": "http://localhost:32400",
        "PLEX_API_KEY": "your-plex-api-key",
        "TOOL_PROFILE": "default"
      }
    }
  }
}

Direct from GitHub

json
{
  "mcpServers": {
    "media-server": {
      "command": "deno",
      "args": [
        "run",
        "--allow-all",
        "https://raw.githubusercontent.com/wyattjoh/media-server-mcp/main/packages/media-server-mcp/src/index.ts"
      ],
      "env": {
        "RADARR_URL": "http://localhost:7878",
        "RADARR_API_KEY": "your-radarr-api-key"
      }
    }
  }
}

HTTP Security

Streamable HTTP accepts MCP clients without an Origin header. Browser requests are limited to local origins (localhost, 127.0.0.1, and [::1]) by default. Set MCP_ALLOWED_ORIGINS to a comma-separated list of permitted origin hostnames when serving a browser-based client behind a proxy.

Quick Start

  1. Configure at least one service in your MCP client's configuration:

Minimal Radarr-only Setup

json
{
  "mcpServers": {
    "media-server": {
      "command": "deno",
      "args": ["run", "--allow-all", "jsr:@wyattjoh/media-server-mcp"],
      "env": {
        "RADARR_URL": "http://localhost:7878",
        "RADARR_API_KEY": "your-radarr-api-key"
      }
    }
  }
}

Minimal Sonarr-only Setup

json
{
  "mcpServers": {
    "media-server": {
      "command": "deno",
      "args": ["run", "--allow-all", "jsr:@wyattjoh/media-server-mcp"],
      "env": {
        "SONARR_URL": "http://localhost:8989",
        "SONARR_API_KEY": "your-sonarr-api-key"
      }
    }
  }
}

Minimal TMDB-only Setup

json
{
  "mcpServers": {
    "media-server": {
      "command": "deno",
      "args": ["run", "--allow-all", "jsr:@wyattjoh/media-server-mcp"],
      "env": {
        "TMDB_API_KEY": "your-tmdb-api-key"
      }
    }
  }
}
  1. Find your API keys:

    • Radarr: Settings → General → Security → API Key
    • Sonarr: Settings → General → Security → API Key
    • TMDB: Sign up at TMDB, go to Settings → API → Create API Key

    Important:

    • For TMDB, you'll need a free TMDB account and API key from their developer section.
  2. Start using - Ask your AI assistant to manage your media library!

Configuration

Environment Variables

VariableDescriptionRequired
RADARR_URLBase URL of your Radarr instanceOptional*
RADARR_API_KEYAPI key for Radarr authenticationOptional*
SONARR_URLBase URL of your Sonarr instanceOptional*
SONARR_API_KEYAPI key for Sonarr authenticationOptional*
TMDB_API_KEYTMDB API key for movie/TV metadataOptional*
PLEX_URLBase URL of your Plex instanceOptional*
PLEX_API_KEYX-Plex-Token for Plex authenticationOptional*
MCP_AUTH_TOKENAuthentication token for HTTP transport modesOptional
MCP_ALLOWED_ORIGINSComma-separated browser Origin hostnames allowed in HTTP modeOptional

*At least one service (Radarr, Sonarr, TMDB, or Plex) must be configured.

Example URLs

  • Local Radarr: http://localhost:7878
  • Local Sonarr: http://localhost:8989
  • Remote with custom port: https://radarr.yourdomain.com:443

SSE Mode (HTTP Transport)

Deprecated: SSE transport is deprecated. Use Streamable HTTP (--http) instead.

By default, the MCP server runs in stdio mode for direct integration with MCP clients. However, you can also run it in SSE (Server-Sent Events) mode over HTTP for web-based integrations or debugging.

Running in SSE Mode

bash
# Start server in SSE mode on port 3000 (default)
deno run --allow-all jsr:@wyattjoh/media-server-mcp --sse

# Or specify a custom port
deno run --allow-all jsr:@wyattjoh/media-server-mcp --sse --port 8080

Authentication Token

Important: SSE mode requires the MCP_AUTH_TOKEN environment variable for security. This token is used to authenticate HTTP requests via Bearer token authentication.

bash
# Required for SSE mode
export MCP_AUTH_TOKEN="your-secure-random-token"

# Generate a secure token (example using openssl)
export MCP_AUTH_TOKEN=$(openssl rand -base64 32)

SSE Endpoints

When running in SSE mode, the server provides these endpoints:

  • GET /sse - SSE event stream endpoint; the server assigns a session ID and sends the message endpoint URL via an SSE endpoint event (requires Bearer auth)
  • POST /messages?sessionId=<id> - HTTP POST endpoint for client messages (requires Bearer auth)
  • GET /health - Health check endpoint (no authentication required)

Example SSE Usage

bash
# Set authentication token
export MCP_AUTH_TOKEN="your-secure-token"

# Start server in SSE mode
deno run --allow-all jsr:@wyattjoh/media-server-mcp --sse --port 3000

# Test health endpoint
curl http://localhost:3000/health

# Connect to SSE stream (requires Bearer token)
# The server assigns a session ID and sends it via an SSE event
curl -H "Authorization: Bearer your-secure-token" \
     http://localhost:3000/sse

Security Notes:

  • Never expose SSE mode to the internet without proper authentication
  • Use a strong, randomly generated MCP_AUTH_TOKEN
  • The health endpoint (/health) is the only unauthenticated endpoint
  • All other endpoints require valid Bearer token authentication

Streamable HTTP Mode (Recommended for Remote)

Streamable HTTP is the recommended transport for remote MCP server deployments. It supports the stateless MCP 2026-07-28 specification and the SDK's 2025-era stateless compatibility path. The deprecated --sse mode remains available for legacy SSE clients during the transition.

Running in Streamable HTTP Mode

bash
# Start server in Streamable HTTP mode on port 3000 (default)
deno run --allow-all jsr:@wyattjoh/media-server-mcp --http

# Specify a custom port and host
deno run --allow-all jsr:@wyattjoh/media-server-mcp --http --port 8080 --host 127.0.0.1

Endpoints

  • POST /mcp - Send JSON-RPC requests. MCP 2026-07-28 clients use server/discover and include matching MCP-Protocol-Version and Mcp-Method headers on every request. tools/call, resources/read, and prompts/get also require Mcp-Name.
  • GET /mcp and DELETE /mcp - Not supported by the stateless 2026-07-28 transport. Use subscriptions/listen for opted-in notifications.
  • GET /health - Health check endpoint (no authentication required)

Authentication

Authentication via MCP_AUTH_TOKEN is optional but strongly recommended for any deployment accessible over a network. When set, all requests (except /health) must include a Authorization: Bearer <token> header.

bash
# Set authentication token (recommended)
export MCP_AUTH_TOKEN=$(openssl rand -base64 32)

# Start server
deno run --allow-all jsr:@wyattjoh/media-server-mcp --http

Connecting from Claude Code

bash
# Without authentication
claude mcp add --transport http media-server http://your-server:3000/mcp

# With authentication (set the token as a header)
claude mcp add --transport http media-server http://your-server:3000/mcp \
  --header "Authorization: Bearer your-secure-token"

Connecting from Claude.com

  1. Go to Settings > Custom Connectors
  2. Add a new MCP server with Transport type "Streamable HTTP"
  3. Enter the URL: https://your-server:3000/mcp
  4. If using authentication, configure the Bearer token

Security Best Practices

  • Always use HTTPS in production — terminate TLS with a reverse proxy (nginx, Caddy, etc.) in front of the MCP server
  • Set MCP_AUTH_TOKEN with a strong, randomly generated value for any network-accessible deployment
  • Bind to specific interfaces using --host to limit which network interfaces accept connections (e.g., --host 127.0.0.1 for localhost only)
  • Use a reverse proxy for rate limiting, request size limits, and TLS termination
  • Restrict network access using firewall rules or VPN to limit who can reach the server
  • Browser origins: Streamable HTTP rejects browser requests unless the Origin hostname is local (localhost, 127.0.0.1, or [::1]) or listed in MCP_ALLOWED_ORIGINS. Requests without Origin remain available to non-browser MCP clients. SSE retains its legacy permissive CORS behavior and requires bearer authentication.
  • Modern HTTP headers: Ensure reverse proxies preserve MCP-Protocol-Version, Mcp-Method, and Mcp-Name, because the 2026-07-28 handler validates them against each JSON-RPC request.

Tool Configuration System

The Media Server MCP includes a powerful tool filtering system that allows you to control which tools are exposed to your AI assistant. This helps reduce tool clutter and focus on the functionality you need.

Tool Organization

Tools are organized into 6 logical branches:

BranchDescriptionTool CountPurpose
discovery-addCore discovery and adding functionality18 toolsFinding and adding new content
library-managementManaging existing content11 toolsOrganizing your library
system-maintenanceHealth checks and maintenance10 toolsSystem administration
download-managementQueue and download operations7 toolsDownload monitoring
metadata-enrichmentAdvanced TMDB research features16 toolsDeep content research
advanced-searchExternal ID lookups and specialized searches7 toolsPower user features

Predefined Profiles

Choose from 7 predefined profiles that combine tool branches or expose progressive discovery:

ProfileBranches IncludedTotal ToolsBest For
codemodeProgressive discovery facade3 toolsModels that discover configured tools on demand
default (default)discovery-add18 toolsMost users - essential discovery and adding
minimaldiscovery-add18 toolsSame as default
curatordiscovery-add + library-management29 toolsManaging existing content
maintainercurator + system-maintenance39 toolsSystem administrators
power-userAll except advanced-search63 toolsAdvanced users
fullAll branches70 toolsComplete functionality

Configuration Methods

1. Environment Variables (Recommended)

Add these variables to your MCP server configuration:

json
{
  "mcpServers": {
    "media-server": {
      "command": "deno",
      "args": ["run", "--allow-all", "jsr:@wyattjoh/media-server-mcp"],
      "env": {
        "RADARR_URL": "http://localhost:7878",
        "RADARR_API_KEY": "your-radarr-api-key",
        "TOOL_PROFILE": "curator",
        "TOOL_BRANCHES": "download-management"
      }
    }
  }
}

Available Environment Variables:

VariableDescriptionExample Values
TOOL_PROFILESelect a predefined profilecodemode, default, curator, power-user, full
TOOL_BRANCHESAdd specific branches (comma-separated)library-management,system-maintenance
TOOL_EXCLUDEExclude specific tools (comma-separated)radarr_delete_movie,sonarr_delete_series
TOOL_INCLUDEInclude specific tools (overrides other settings)radarr_get_health,sonarr_get_health
TOOL_CONFIG_PATHPath to JSON configuration file./tools.config.json

2. JSON Configuration File

For advanced configuration, create a JSON file and reference it with TOOL_CONFIG_PATH:

json
{
  "toolProfile": "curator",
  "enabledBranches": ["download-management", "system-maintenance"],
  "customOverrides": {
    "exclude": [
      "radarr_delete_movie",
      "sonarr_delete_series"
    ],
    "include": [
      "radarr_get_health",
      "sonarr_get_health"
    ]
  }
}

Configuration Precedence

Settings are applied in this order (later settings override earlier ones):

  1. Default Profile: discovery-add tools only (18 tools)
  2. JSON Configuration File: Applied if TOOL_CONFIG_PATH is set
  3. Environment Variables: Override JSON settings
  4. Custom Overrides: TOOL_EXCLUDE and TOOL_INCLUDE applied last for native profiles

The codemode profile always advertises only codemode_search, codemode_describe, and codemode_execute. Its catalog covers every native tool for configured services and ignores TOOL_BRANCHES, TOOL_INCLUDE, and TOOL_EXCLUDE. Resources and prompts remain available. Mutating tools are discoverable but marked unavailable for Code Mode execution. See the Code Mode operator and model guide for the search, describe, execute workflow, JavaScript contract, fixed limits, benchmark, and v1 scope. Source development and Docker use Deno 2.9.5; install the version pinned in .tool-versions. Standalone compiled binaries do not support Code Mode until runner-sidecar packaging is designed. See Code Mode security for the enforced boundary, Docker behavior, optional Linux containment, and process-only limitations.

Common Configuration Examples

Code Mode

bash
TOOL_PROFILE=codemode
# Result: 3 progressive-discovery tools; configured resources and prompts remain

Use codemode_search to find exact native names, following hasMore with offset + returned to traverse every stable filtered page; use codemode_describe to inspect selected contracts and facade paths, then codemode_execute with explicitly selected read-only names and a JavaScript async-function body that returns the desired JSON result. Concise multi-word search is ranked deterministically. Defaulted inputs are optional, unknown input properties are rejected, and described outputs expose stable fields for small projections. Plex category filters are applied to returned hubs so explicit TV searches exclude movies and retain consistent counts. Before validating a deployment, read runtime://media-server-mcp/identity to confirm the running package version, Code Mode contract revision, configured services, execution policy, and fixed limits match the release under evaluation. The Code Mode guide includes a copy-paste fresh Pi release-validation prompt.

For routine Radarr or Sonarr decisions, read config://radarr/summary or config://sonarr/summary to retrieve only quality-profile identities and root-folder status. Use the existing complete config://radarr or config://sonarr resource when troubleshooting requires full quality definitions or unmapped-folder inventories.

Minimal Setup (Default)

bash
# No tool configuration needed - uses default profile
# Result: 18 essential discovery and add tools

Content Curator

bash
TOOL_PROFILE=curator
# Result: 29 tools (discovery + library management)

System Administrator

bash
TOOL_PROFILE=maintainer
TOOL_INCLUDE=radarr_disk_scan,sonarr_disk_scan
# Result: 41 tools (maintainer profile + disk scanning)

Power User with Restrictions

bash
TOOL_PROFILE=power-user
TOOL_EXCLUDE=radarr_delete_movie,sonarr_delete_series,sonarr_disk_scan
# Result: 60 tools (power-user minus dangerous operations)

Discovery Only (TMDB + Search)

bash
TOOL_PROFILE=default
TOOL_EXCLUDE=radarr_add_movie,sonarr_add_series
# Result: 16 tools (discovery without adding capabilities)

Full Access

bash
TOOL_PROFILE=full
# Result: 70 tools (all available functionality)

Tool Configuration Debugging

The server logs the active configuration on startup:

[INFO] Tool Configuration:
  Profile: curator
  Additional Branches: download-management
  Excluded Tools: radarr_delete_movie, sonarr_delete_series
  Total Enabled Tools: 36

This helps verify your configuration is working as expected.

Available Tools

Radarr Tools (when configured)

Movie Management

  • radarr_search_movie - Search for movies in The Movie Database
  • radarr_add_movie - Add a movie to your library
  • radarr_get_movies - List all movies in your library (supports filtering by title, genres, year range, monitored status, file availability, quality profile, tags, minimum availability, and TMDB ID)
  • radarr_get_movie - Get details of a specific movie
  • radarr_delete_movie - Remove a movie from your library

Queue and Downloads

  • radarr_get_queue - View current download queue
  • radarr_search_movie_releases - Search for releases of a specific movie

System Management

  • radarr_get_configuration - Get configuration including quality profiles, root folders, and tags
  • radarr_get_system_status - Get system information
  • radarr_get_health - Check system health
  • radarr_refresh_movie - Refresh movie metadata
  • radarr_update_movie - Update a movie's settings (quality profile, monitoring, etc.)
  • radarr_refresh_all_movies - Refresh metadata for all movies in the library
  • radarr_disk_scan - Rescan all movie folders for new/missing files

Wanted/Missing and Quality Management

  • radarr_get_wanted_missing - Get movies that are monitored but not yet downloaded
  • radarr_get_wanted_cutoff - Get movies downloaded but below quality cutoff
  • radarr_get_calendar - Get upcoming movie releases within a date range

History and Troubleshooting

  • radarr_get_history - Get paginated download history with event type filtering
  • radarr_get_movie_history - Get download history for a specific movie
  • radarr_mark_failed - Mark a download as failed to trigger re-grab

Interactive Release Management

  • radarr_get_releases - Browse available releases from indexers for a movie
  • radarr_grab_release - Download a specific release
  • radarr_search_all_missing - Trigger search for all missing movies at once
  • radarr_delete_queue_item - Remove a stuck/failed item from the queue
  • radarr_grab_queue_item - Force download a queue item

Sonarr Tools (when configured)

Series Management

  • sonarr_search_series - Search for TV series
  • sonarr_add_series - Add a TV series to your library
  • sonarr_get_series - List all series in your library (supports filtering by title, genres, year range, monitored status, network, series type, quality profile, tags, status, and TMDB ID)
  • sonarr_get_series_by_id - Get details of a specific series
  • sonarr_delete_series - Remove a series from your library

Episode Management

  • sonarr_get_episodes - Get episodes for a series
  • sonarr_get_episode - Get details of a specific episode by ID
  • sonarr_update_episode_monitoring - Change episode monitoring status
  • sonarr_get_calendar - View upcoming episodes
  • sonarr_search_series_episodes - Search for all episodes of a series
  • sonarr_search_season - Search for episodes of a specific season
  • sonarr_search_episodes - Search for specific episodes by IDs

Queue and Downloads

  • sonarr_get_queue - View current download queue

System Management

  • sonarr_get_configuration - Get configuration including quality profiles and root folders
  • sonarr_get_system_status - Get system information
  • sonarr_get_health - Check system health
  • sonarr_refresh_series - Refresh series metadata
  • sonarr_update_series - Update a series' settings (quality profile, monitoring, etc.)
  • sonarr_refresh_all_series - Refresh metadata for all series in the library
  • sonarr_disk_scan - Rescan all series folders for new/missing files

Wanted/Missing and Quality Management

  • sonarr_get_wanted_missing - Get episodes that are monitored but not yet downloaded
  • sonarr_get_wanted_cutoff - Get episodes downloaded but below quality cutoff

History and Troubleshooting

  • sonarr_get_history - Get paginated download history with event type filtering
  • sonarr_get_series_history - Get download history for a specific series
  • sonarr_mark_failed - Mark a download as failed to trigger re-grab

Interactive Release Management

  • sonarr_get_releases - Browse available releases from indexers for an episode
  • sonarr_grab_release - Download a specific release
  • sonarr_search_all_missing - Trigger search for all missing episodes at once
  • sonarr_delete_queue_item - Remove a stuck/failed item from the queue
  • sonarr_grab_queue_item - Force download a queue item

TMDB Tools (when configured)

Search and Discovery

  • tmdb_search_movies - Search for movies on TMDB by title
  • tmdb_search_tv - Search for TV shows on TMDB by title
  • tmdb_search_multi - Search for movies, TV shows, and people in a single request
  • tmdb_get_popular_movies - Get popular movies
  • tmdb_discover_movies - Discover movies based on various criteria (genre, year, rating, etc.)
  • tmdb_discover_tv - Discover TV shows based on various criteria

Trending Content

  • tmdb_get_trending - Get trending movies, TV shows, or people by time window (day/week)

Movie Lists

  • tmdb_get_now_playing_movies - Get movies currently playing in theaters
  • tmdb_get_top_rated_movies - Get top rated movies
  • tmdb_get_upcoming_movies - Get upcoming movie releases

TV Show Lists

  • tmdb_get_popular_tv - Get popular TV shows
  • tmdb_get_top_rated_tv - Get top rated TV shows
  • tmdb_get_on_the_air_tv - Get TV shows currently on the air
  • tmdb_get_airing_today_tv - Get TV shows airing today

Content Details

  • tmdb_get_movie_details - Get detailed information about a specific movie
  • tmdb_get_tv_details - Get detailed information about a specific TV show

Recommendations and Similar Content

  • tmdb_get_movie_recommendations - Get movie recommendations based on a specific movie
  • tmdb_get_tv_recommendations - Get TV show recommendations based on a specific show
  • tmdb_get_similar_movies - Get movies similar to a specific movie
  • tmdb_get_similar_tv - Get TV shows similar to a specific show

People Discovery

  • tmdb_search_people - Search for people (actors, directors, etc.)
  • tmdb_get_popular_people - Get popular people in the entertainment industry
  • tmdb_get_person_details - Get detailed information about a specific person
  • tmdb_get_person_movie_credits - Get a person's movie credits
  • tmdb_get_person_tv_credits - Get a person's TV show credits

Collections and Keywords

  • tmdb_search_collections - Search for movie collections
  • tmdb_get_collection_details - Get details about a specific movie collection
  • tmdb_search_keywords - Search for keywords
  • tmdb_get_movies_by_keyword - Get movies associated with a specific keyword

Certifications and Watch Providers

  • tmdb_get_certifications - Get movie or TV certifications by country
  • tmdb_get_watch_providers - Get watch provider information for a movie or TV show

External ID Integration

  • tmdb_find_by_external_id - Find TMDB content by external ID (TVDB ID, etc.)

Configuration and Metadata

  • tmdb_get_genres - Get list of available genres for movies or TV shows
  • tmdb_get_configuration - Get TMDB API configuration including image base URLs
  • tmdb_get_countries - Get list of countries used in TMDB
  • tmdb_get_languages - Get list of languages used in TMDB

Cast and Crew Information

  • tmdb_get_movie_credits - Get cast and crew for a movie
  • tmdb_get_tv_credits - Get cast and crew for a TV show

Plex Tools (when configured)

System Information

  • plex_get_capabilities - Get Plex server capabilities, version, and system information

Library Management

  • plex_get_libraries - List all media libraries available on the Plex server
  • plex_get_accounts - List Plex system accounts and their IDs and names for resolving playback history users
  • plex_refresh_library - Trigger a refresh of a specific library to scan for new content
  • plex_get_library_items - Browse and filter items in a library section (supports filtering by studio, genre, year, and sorting)

Search and Discovery

  • plex_search - Search across all Plex libraries for movies, TV shows, and other content with optional type filters
  • plex_get_metadata - Get detailed metadata for a specific movie, TV show, or other media item
  • plex_get_playback_history - Get playback history for a specific playable media item, such as a movie or episode, by rating key (up to 1,000 entries per request)
  • plex_get_watch_history - Get recent playback history across all playable media, with account and timestamp filters (up to 1,000 entries per request)

Collection Management

  • plex_get_collections - List all collections in a library section
  • plex_get_collection_items - Get all items in a specific collection
  • plex_create_collection - Create a new collection with initial items
  • plex_add_to_collection - Add items to an existing collection
  • plex_remove_from_collection - Remove a single item from a collection
  • plex_delete_collection - Delete an entire collection

Usage Examples

Natural Language Requests

With this MCP server configured, you can ask your AI assistant:

  • "Add the movie Inception to my Radarr library"
  • "Show me what TV series are in my Sonarr queue"
  • "What episodes of Breaking Bad are airing this week?"
  • "Add The Office to my TV library and monitor all seasons"
  • "Find movies on TMDB similar to The Dark Knight from 2020-2024"
  • "Discover highly-rated sci-fi TV shows on TMDB"
  • "Get the Radarr system status and health"

API Examples

Adding a Movie

json
{
  "tool": "radarr_add_movie",
  "arguments": {
    "tmdbId": 550,
    "title": "Fight Club",
    "year": 1999,
    "qualityProfileId": 1,
    "rootFolderPath": "/movies",
    "minimumAvailability": "released",
    "monitored": true,
    "searchForMovie": true
  }
}

Adding a TV Series

json
{
  "tool": "sonarr_add_series",
  "arguments": {
    "tvdbId": 78804,
    "title": "Breaking Bad",
    "qualityProfileId": 1,
    "rootFolderPath": "/tv",
    "monitored": true,
    "seasonFolder": true,
    "seriesType": "standard"
  }
}

Discovering Movies on TMDB

json
{
  "tool": "tmdb_discover_movies",
  "arguments": {
    "with_genres": "28,878",
    "vote_average_gte": 7.0,
    "primary_release_year": 2023,
    "sort_by": "popularity.desc"
  }
}

Troubleshooting

Common Issues

No Tools Available

  • Ensure at least one service is configured with valid environment variables
  • Check that URLs are accessible and API keys are correct
  • Verify the MCP server is starting without errors

Connection Refused

  • Verify Radarr/Sonarr URLs are correct and accessible
  • Check that the services are running
  • Ensure no firewall is blocking the connections

Unauthorized/403 Errors

  • Verify API keys are correct and haven't expired
  • Check that API access is enabled in service settings

Tool Configuration Issues

  • Too many/few tools: Check your TOOL_PROFILE setting or use TOOL_BRANCHES to add specific functionality
  • Missing expected tools: Verify the tool is included in your profile/branches using the startup logs
  • Invalid profile error: Use one of the valid profiles: codemode, default, minimal, curator, maintainer, power-user, full
  • JSON config not loading: Check that TOOL_CONFIG_PATH points to a valid file and has correct JSON syntax

Debug Mode

Check MCP server logs for connection status and tool configuration on startup. The server will:

  • Test each configured service and report connection results
  • Log the active tool configuration showing profile, branches, and total tool count
  • Report any configuration parsing errors

Development

Local Development Setup

  1. Clone this repository:
bash
git clone https://github.com/wyattjoh/media-server-mcp.git
cd media-server-mcp
  1. Create environment configuration:
bash
cp .env.example .env
# Edit .env with your service URLs and API keys
  1. Run the server:
bash
deno task dev

Available Scripts

bash
# Development with hot reload
deno task dev

# Production run  
deno task start

# Type checking
deno check

# Code formatting
deno fmt

# Linting
deno lint

# Run tests
deno task test

Project Structure

src/
├── index.ts              # Main MCP server
├── clients/
│   ├── radarr.ts         # Radarr API client
│   ├── sonarr.ts         # Sonarr API client
│   └── tmdb.ts           # TMDB API client
├── tools/
│   ├── radarr-tools.ts   # Radarr MCP tools
│   ├── sonarr-tools.ts   # Sonarr MCP tools  
│   └── tmdb-tools.ts     # TMDB MCP tools
├── utils/
│   └── filters.ts        # Filtering and sorting utilities
└── types/
    ├── radarr.ts         # Radarr type definitions
    ├── sonarr.ts         # Sonarr type definitions
    ├── tmdb.ts           # TMDB type definitions
    ├── mcp.ts            # MCP-specific types
    ├── filters.ts        # Filter and sort type definitions
    └── validation.ts     # Validation utilities

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT License - see LICENSE.md file for details.

Acknowledgments

安装

TypingMind
前提条件:

Node.js 18+

{
  "mcpServers": {
    "wyattjoh-media-server-mcp": {
      "command": "",
      "args": []
    }
  }
}

将 媒体服务器 MCP MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 媒体服务器 MCP 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请勿关闭终端窗口或停止其中的连接器进程。
3

将 媒体服务器 MCP 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 媒体服务器 MCP MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "wyattjoh-media-server-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "media-server-mcp"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 媒体服务器 MCP MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 媒体服务器 MCP MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 媒体服务器 MCP 帮我完成这项任务吗?
媒体服务器 MCP
当然,我看过了。
以下是我使用 媒体服务器 MCP 得到的结果。

常见问题

媒体服务器 MCP MCP 服务器有什么用途?

媒体服务器 MCP 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 媒体服务器 MCP MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您无需为每个模型单独配置 MCP 服务器,就能在 Claude、ChatGPT、Gemini 或您在 TypingMind 中配置的其他 AI 模型中使用 媒体服务器 MCP。

为什么在 TypingMind 中使用 媒体服务器 MCP MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是最出色的大语言模型聊天前端之一。连接 媒体服务器 MCP 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 媒体服务器 MCP MCP 连接到 TypingMind?

媒体服务器 MCP 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

媒体服务器 MCP MCP 在 TypingMind 中提供哪些工具?

媒体服务器 MCP 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 媒体服务器 MCP MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行选择模型提供商,并自行管理 API 密钥、提示词和 MCP 配置。如果 媒体服务器 MCP 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇