The Plex MCP Server provides AI assistants with comprehensive access to your Plex Media Server through 12 tools, enabling natural language queries for library management, viewing statistics, and media analysis.
Core Capabilities:
Library Management - Browse all Plex libraries, search across movies, TV shows, episodes, music (artists, albums, tracks), and retrieve detailed metadata for any media item
Content Discovery - View recently added media, access "On Deck" (continue watching) queue, find recently watched and fully watched content with flexible filtering
Watch History & Analytics - Track comprehensive watch history with session details, viewing patterns, and customizable time ranges (default 30 days)
Tautulli-Style Statistics - Access detailed analytics including watch statistics (plays, duration), user activity insights, library usage metrics, popular content rankings, and platform breakdowns
Advanced Filtering - Filter by media type, library sections, specific users, and configurable result limits
Optional Integrations:
Sonarr/Radarr (via plex-arr-server) - Search, add, and manage series/movies using TVDB/TMDB IDs, view download queues and missing items, trigger searches, and monitor service status
Trakt.tv Sync (via plex-trakt-server) - Authenticate and sync Plex watch history, access enhanced statistics, search the Trakt database, and enable real-time scrobbling
Natural Language Interface - Query your media ecosystem with commands like "What movies did I watch last week?", "Show me my most popular TV shows", or "Find action movies in my library" through AI assistants.
Provides comprehensive access to a Plex Media Server, allowing querying of libraries, viewing statistics, user activity tracking, media searching, and content management through natural language interactions.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Plex MCP Serverwhat movies did I watch last week?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
🎬 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?"
Related MCP server: YARR Media Stack MCP Server
✨ Features
📚 Library Management (Plex)
Browse all Plex libraries
Search across movies, TV shows, music, and more
Get detailed metadata for any media item
📊 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
Configuration
Get your Plex token (see instructions below)
Create environment file:
Configure your MCP client:
Add to your MCP client configuration (e.g., Claude Desktop).
Plex only (12 tools):
Plex + Sonarr/Radarr (24 tools):
Plex + Trakt.tv (16 tools):
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:
🛠️ Available Functions
Plex Tools (all servers)
Function | Description |
| List all Plex libraries |
| Search across all media |
| Recently added content |
| Continue watching list |
| Detailed media info |
| Recently watched content |
| Detailed 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)
Function | Description |
| List series with optional title filter |
| Search TheTVDB for new series |
| Add series by TVDB ID |
| Missing/wanted episodes |
| Download queue |
| Upcoming episodes |
| Quality profiles and root folders |
| Trigger missing episode search |
Radarr Tools (plex-arr-server)
Function | Description |
| List movies with optional title filter |
| Search TMDB for new movies |
| Add movie by TMDB ID |
| Missing/wanted movies |
| Download queue |
| Upcoming movies |
| Quality profiles and root folders |
| Trigger missing movie search |
Cross-Service Tools (plex-arr-server)
Function | Description |
| Check Sonarr/Radarr connection status |
Trakt Tools (plex-trakt-server)
Function | Description |
| Start Trakt.tv OAuth flow |
| Complete authentication |
| Check auth status |
| Sync Plex history to Trakt |
| Get Trakt data for comparison |
| Enhanced stats from Trakt |
| Search Trakt database |
| Real-time scrobbling |
| Check sync operation status |
🔑 Getting Your Plex Token
Open Plex Web App in your browser
Navigate to Settings → Account → Privacy
Click "Show Advanced" at the bottom
Copy your Plex Token
Alternative method:
Visit:
http://YOUR_PLEX_IP:32400/web/index.html#!/settings/accountLook for the "Plex Token" field
📁 Project Structure
🔧 Development
Scripts
Building from Source
🤝 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
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
🐛 Troubleshooting
Common Issues
Connection refused:
Verify your Plex server is running
Check the
PLEX_URLin your.envfileEnsure 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 pathFor large Radarr libraries (20k+ movies), the initial
radarr_get_moviescall 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, orbuild/plex-trakt-server.js)Check that Node.js is in your system PATH
Verify environment variables are set in client config
Getting Help
💬 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