JUHE API Marketplace
niavasha avatar
MCP Server

Plex MCP Server

A Model Context Protocol server that enables AI assistants to query and manage Plex Media Server content through natural language, providing library access, viewing statistics, and media management capabilities.

8
GitHub Stars
3/9/2026
Last Updated
MCP Server Configuration
1{
2 "name": "plex",
3 "command": "node",
4 "args": [
5 "/path/to/plex-mcp-server/build/index.js"
6 ],
7 "env": {
8 "PLEX_URL": "http://localhost: 32400",
9 "PLEX_TOKEN": "your_plex_token_here"
10 }
11}
JSON11 lines
  1. Home
  2. MCP Servers
  3. plex-mcp-server

README Documentation

Plex MCP Server

A Model Context Protocol (MCP) server that provides AI assistants with comprehensive access to your Plex Media Server. Query your libraries, get viewing statistics, and manage your media through natural language interactions.

Plex Server MCP server

šŸŽ¬ What is this?

This MCP server transforms your Plex Media Server into an AI-queryable database. Ask your AI assistant questions like:

  • "What movies have I watched recently?"
  • "Show me my viewing statistics for the past month"
  • "What's the most popular content on my server?"
  • "Find action movies in my library"
  • "What's on my continue watching list?"

✨ Features

šŸ“š Library Management (Plex)

  • Browse all Plex libraries
  • List library items with pagination and sorting controls
  • Export full libraries to JSON without truncation
  • Search across movies, TV shows, music, and more
  • Restrict search to a specific library section
  • Get detailed metadata for any media item

šŸ“„ Read-Only Metadata & Lists (Plex)

  • Inspect editable fields and current tags for any media item
  • List all playlists and items in a playlist
  • Get Plex watchlist with fallback endpoint support

šŸ“Š Tautulli-Style Analytics (Plex)

  • Comprehensive viewing statistics
  • User activity tracking
  • Popular content analysis
  • Watch history with progress tracking
  • Library usage metrics

šŸŽÆ Smart Querying (Plex)

  • Recently watched content
  • Fully watched movies/shows
  • Continue watching (On Deck)
  • Recently added media

šŸ“” Sonarr/Radarr Integration (Plex+Arr Server)

  • Browse and search your Sonarr series and Radarr movie libraries
  • Add new series/movies by TVDB/TMDB ID with auto-detected quality profiles
  • View download queues, missing episodes/movies, and calendar
  • Trigger searches for missing content
  • Check service status for both Sonarr and Radarr

šŸ”„ Trakt.tv Sync (Plex+Trakt Server)

  • OAuth authentication with Trakt.tv
  • Sync Plex watch history to Trakt
  • Enhanced viewing statistics from Trakt
  • Search the Trakt database
  • Real-time scrobbling support

šŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • Plex Media Server (any recent version)
  • Plex Token (How to get your token)
  • MCP-compatible client (Claude Desktop, etc.)

Installation

# Clone the repository
git clone https://github.com/niavasha/plex-mcp-server.git
cd plex-mcp-server

# Install dependencies
npm install

# Build the project
npm run build

Configuration

  1. Get your Plex token (see instructions below)

  2. Create environment file:

# Copy the example environment file
cp .env.example .env

# Edit with your details
PLEX_URL=http://localhost:32400
PLEX_TOKEN=your_plex_token_here
  1. Configure your MCP client:

Add to your MCP client configuration (e.g., Claude Desktop).

Plex only (18 tools):

{
  "mcpServers": {
    "plex": {
      "command": "node",
      "args": ["/path/to/plex-mcp-server/build/index.js"],
      "env": {
        "PLEX_URL": "http://localhost:32400",
        "PLEX_TOKEN": "your_plex_token_here"
      }
    }
  }
}

Plex + Sonarr/Radarr (30 tools):

{
  "mcpServers": {
    "plex-arr": {
      "command": "node",
      "args": ["/path/to/plex-mcp-server/build/plex-arr-server.js"],
      "env": {
        "PLEX_URL": "http://localhost:32400",
        "PLEX_TOKEN": "your_plex_token_here",
        "SONARR_URL": "http://localhost:8989",
        "SONARR_API_KEY": "your_sonarr_api_key",
        "RADARR_URL": "http://localhost:7878",
        "RADARR_API_KEY": "your_radarr_api_key"
      }
    }
  }
}

Plex + Trakt.tv (22 tools):

{
  "mcpServers": {
    "plex-trakt": {
      "command": "node",
      "args": ["/path/to/plex-mcp-server/build/plex-trakt-server.js"],
      "env": {
        "PLEX_URL": "http://localhost:32400",
        "PLEX_TOKEN": "your_plex_token_here",
        "TRAKT_CLIENT_ID": "your_trakt_client_id",
        "TRAKT_CLIENT_SECRET": "your_trakt_client_secret"
      }
    }
  }
}

Note: Sonarr/Radarr API keys are optional at startup — tools that need them will return a helpful error message if the key is missing. Find your API keys at Settings > General > API Key in each app's web UI.

Usage

Once configured, you can ask your AI assistant:

šŸŽ¬ "What movies did I watch last week?"
šŸ“ŗ "Show me my most popular TV shows this month"
šŸ“Š "Give me viewing statistics for the past 30 days"
šŸ” "Search for Christopher Nolan movies in my library"
ā–¶ļø "What's on my continue watching list?"
šŸ“š "List all my Plex libraries"

šŸ› ļø Available Functions

Plex Tools (all servers)

FunctionDescription
get_librariesList all Plex libraries
get_library_itemsList items in a library with pagination
export_libraryExport a full library to JSON (under ./exports)
search_mediaSearch media globally or within one library
get_recently_addedRecently added content
get_on_deckContinue watching list
get_media_detailsDetailed media info
get_editable_fieldsShow editable fields and available tags for an item
get_playlistsList all Plex playlists
get_playlist_itemsList items in a playlist
get_watchlistGet current Plex watchlist
get_recently_watchedRecently watched content
get_watch_historyDetailed watch sessions

The standalone Plex server also includes: get_fully_watched, get_watch_stats, get_user_stats, get_library_stats, get_popular_content.

Sonarr Tools (plex-arr-server)

FunctionDescription
sonarr_get_seriesList series with optional title filter
sonarr_searchSearch TheTVDB for new series
sonarr_add_seriesAdd series by TVDB ID
sonarr_get_missingMissing/wanted episodes
sonarr_get_queueDownload queue
sonarr_get_calendarUpcoming episodes
sonarr_get_profilesQuality profiles and root folders
sonarr_trigger_searchTrigger missing episode search

Radarr Tools (plex-arr-server)

FunctionDescription
radarr_get_moviesList movies with optional title filter
radarr_searchSearch TMDB for new movies
radarr_add_movieAdd movie by TMDB ID
radarr_get_missingMissing/wanted movies
radarr_get_queueDownload queue
radarr_get_calendarUpcoming movies
radarr_get_profilesQuality profiles and root folders
radarr_trigger_searchTrigger missing movie search

Cross-Service Tools (plex-arr-server)

FunctionDescription
arr_get_statusCheck Sonarr/Radarr connection status

Trakt Tools (plex-trakt-server)

FunctionDescription
trakt_authenticateStart Trakt.tv OAuth flow
trakt_complete_authComplete authentication
trakt_get_auth_statusCheck auth status
trakt_sync_to_traktSync Plex history to Trakt
trakt_sync_from_traktGet Trakt data for comparison
trakt_get_user_statsEnhanced stats from Trakt
trakt_searchSearch Trakt database
trakt_start_scrobblingReal-time scrobbling
trakt_get_sync_statusCheck sync operation status

šŸ”‘ Getting Your Plex Token

  1. Open Plex Web App in your browser
  2. Navigate to Settings → Account → Privacy
  3. Click "Show Advanced" at the bottom
  4. Copy your Plex Token

Alternative method:

  • Visit: http://YOUR_PLEX_IP:32400/web/index.html#!/settings/account
  • Look for the "Plex Token" field

šŸ“ Project Structure

plex-mcp-server/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ index.ts               # Standalone Plex server (18 tools)
│   ā”œā”€ā”€ plex-arr-server.ts     # Plex + Sonarr/Radarr server (30 tools)
│   ā”œā”€ā”€ plex-trakt-server.ts   # Plex + Trakt server (22 tools)
│   ā”œā”€ā”€ plex/                  # Shared Plex module
│   │   ā”œā”€ā”€ client.ts          #   Plex API client
│   │   ā”œā”€ā”€ tools.ts           #   Plex tool implementations
│   │   ā”œā”€ā”€ tool-registry.ts   #   Map-based tool dispatch
│   │   ā”œā”€ā”€ tool-schemas.ts    #   MCP tool schema definitions
│   │   ā”œā”€ā”€ constants.ts       #   Configuration defaults
│   │   └── types.ts           #   TypeScript type definitions
│   ā”œā”€ā”€ arr/                   # Sonarr/Radarr module
│   │   ā”œā”€ā”€ client.ts          #   Base ArrClient + Sonarr/Radarr subclasses
│   │   ā”œā”€ā”€ mcp-functions.ts   #   Tool implementations (17 tools)
│   │   ā”œā”€ā”€ tool-registry.ts   #   Map-based tool dispatch
│   │   ā”œā”€ā”€ tool-schemas.ts    #   MCP tool schema definitions
│   │   ā”œā”€ā”€ constants.ts       #   Configuration defaults
│   │   └── types.ts           #   TypeScript type definitions
│   ā”œā”€ā”€ trakt/                 # Trakt.tv module
│   │   ā”œā”€ā”€ client.ts          #   Trakt API client + OAuth
│   │   ā”œā”€ā”€ sync.ts            #   Plex-to-Trakt sync engine
│   │   ā”œā”€ā”€ mapper.ts          #   Plex-to-Trakt data mapping
│   │   ā”œā”€ā”€ mcp-functions.ts   #   Tool implementations (9 tools)
│   │   ā”œā”€ā”€ tool-registry.ts   #   Map-based tool dispatch
│   │   └── tool-schemas.ts    #   MCP tool schema definitions
│   └── shared/                # Shared utilities
│       └── utils.ts           #   truncate, sleep, chunkArray
ā”œā”€ā”€ build/                     # Compiled JavaScript output
ā”œā”€ā”€ package.json
ā”œā”€ā”€ tsconfig.json
ā”œā”€ā”€ .env.example               # Environment variables template
└── README.md

šŸ”§ Development

Scripts

# Development mode with auto-reload
npm run dev            # Plex only
npm run dev:arr        # Plex + Sonarr/Radarr
npm run dev:trakt      # Plex + Trakt

# Build for production
npm run build

# Start production server
npm start              # Plex only
npm start:arr          # Plex + Sonarr/Radarr
npm start:trakt        # Plex + Trakt

Building from Source

# Clone and setup
git clone https://github.com/niavasha/plex-mcp-server.git
cd plex-mcp-server
npm install

# Development
npm run dev

šŸ¤ Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Development Guidelines

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

šŸ› Troubleshooting

Common Issues

Connection refused:

  • Verify your Plex server is running
  • Check the PLEX_URL in your .env file
  • Ensure the port (usually 32400) is correct

Authentication errors:

  • Verify your Plex token is correct
  • Check token permissions in Plex settings
  • Ensure token hasn't expired

Empty responses:

  • Some features require Plex Pass
  • Check if your libraries are accessible
  • Verify media has been scanned and is available

Sonarr/Radarr connection issues:

  • Verify Sonarr/Radarr is running and accessible from the MCP server host
  • Check that the API key is correct (Settings > General > API Key)
  • Sonarr uses API v3 at /api/v3/ — ensure your URL doesn't include a trailing path
  • For large Radarr libraries (20k+ movies), the initial radarr_get_movies call may take up to 30 seconds

MCP client issues:

  • Ensure the path to the correct server JS file is set (build/index.js, build/plex-arr-server.js, or build/plex-trakt-server.js)
  • Check that Node.js is in your system PATH
  • Verify environment variables are set in client config

Getting Help

  • šŸ“ Open an issue
  • šŸ’¬ Check existing discussions
  • šŸ“– Review the MCP documentation

šŸ“‹ Requirements

  • Node.js 18.0.0 or higher
  • Plex Media Server (any recent version)
  • Network access between MCP server and Plex server
  • Valid Plex token with appropriate permissions

šŸ”’ Security Notes

  • Keep your Plex token secure - never commit it to version control
  • Use environment variables for sensitive configuration
  • Run on trusted networks - the server communicates directly with Plex
  • Regular token rotation - consider refreshing tokens periodically

šŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

šŸ™ Acknowledgments

  • Anthropic for the Model Context Protocol
  • Plex for the amazing media server
  • Tautulli for analytics inspiration
  • The open-source community for various libraries and tools

šŸ”— Related Projects

  • Model Context Protocol - The standard this server implements
  • Claude Desktop - Popular MCP client
  • Tautulli - Plex monitoring and analytics
  • PlexAPI - Python Plex API library

Built with ā¤ļø for the Plex and AI community

Quick Install

Quick Actions

View on GitHubView All Servers

Key Features

Model Context Protocol
Secure Communication
Real-time Updates
Open Source

Boost your projects with Wisdom Gate LLM API

Supporting GPT-5, Claude-4, DeepSeek v3, Gemini and more.

Enjoy a free trial and save 20%+ compared to official pricing.

Learn More
JUHE API Marketplace

Accelerate development, innovate faster, and transform your business with our comprehensive API ecosystem.

JUHE API VS

  • vs. RapidAPI
  • vs. API Layer
  • API Platforms 2025
  • API Marketplaces 2025
  • Best Alternatives to RapidAPI

For Developers

  • Console
  • Collections
  • Documentation
  • MCP Servers
  • Free APIs
  • Temp Mail Demo

Product

  • Browse APIs
  • Suggest an API
  • Wisdom Gate LLM
  • Global SMS Messaging
  • Temp Mail API

Company

  • What's New
  • Welcome
  • About Us
  • Contact Support
  • Terms of Service
  • Privacy Policy
Featured on Startup FameFeatured on Twelve ToolsFazier badgeJuheAPI Marketplace - Connect smarter, beyond APIs | Product Huntai tools code.marketDang.aiFeatured on ShowMeBestAI
Copyright Ā© 2026 JUHEDATA HK LIMITED - All rights reserved