Plex Assistant MCP
Enables management of Plex libraries, including searching for content, viewing library statistics and active sessions, managing playlists and collections, and marking items as watched or unwatched.
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 Assistant MCPWho is currently watching something right now?"
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 Assistant MCP
š¬ MCP (Model Context Protocol) server for managing your Plex library through AI assistants like Claude.
Plex Assistant MCP enables you to control Plex directly from Claude Desktop or any MCP-compatible client. Search for content, manage playlists, mark items as watched, and get library statistics using natural language!
Features
š Search - Find movies, shows, music, and photos across all libraries
š Statistics - View library overview and content breakdown
š„ Live Sessions - See who's watching what right now
š Playlists - Create, view, and manage playlists
ā Watchlist - Mark content as watched/unwatched
š·ļø Collections - Organize content into custom collections
š” Server Info - Get Plex server details and status
šÆ Advanced Search - Filter by library, media type, and more
Related MCP server: Plex MCP Server
Prerequisites
Python ā„ 3.12
uv - Fast Python package manager (Install here)
Plex Server - Running instance with admin access
Claude Desktop - Latest version (or any MCP-compatible client)
Quick Start
1. Clone or Create Project
# Create project directory
mkdir plex-assistant-mcp
cd plex-assistant-mcp
# Or clone if you have a repo
git clone https://github.com/yourusername/plex-assistant-mcp.git
cd plex-assistant-mcp2. Initialize with uv
# Initialize Python project
uv init
# Install dependencies
uv sync3. Configure Plex Connection
Create a .env file at the project root:
PLEX_URL=http://your-ip:32400
PLEX_TOKEN=your-plex-auth-tokenHow to Find Your Plex Token
Method 1: Using PlexAPI (Automatic)
python3 -c "from plexapi.myplex import MyPlexAccount; account = MyPlexAccount(username='your-email', password='your-password'); print(account.authenticationToken)"Method 2: Browser DevTools
Open DevTools (F12) ā Network tab
Look for any request to
plex.tvFind header
X-Plex-Token- copy that value
Method 3: Plex Settings
Open Plex Web App
Settings ā Your Account ā Scroll to "Authorized Applications"
Generate a token in your Plex account settings
4. Configure Claude Desktop
Edit your Claude Desktop configuration file:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.jsonAdd the following MCP server configuration:
{
"mcpServers": {
"plex-assistant": {
"command": "uv",
"args": [
"--directory",
"C:/Users/YourUsername/Documents/plex-assistant-mcp",
"run",
"src/plex_assistant_mcp/main.py"
],
"env": {
"PLEX_URL": "http://localhost:32400",
"PLEX_TOKEN": "your-actual-token-here"
}
}
}
}Important:
Update the
--directorypath to match your installationReplace
PLEX_URLwith your actual Plex server addressReplace
PLEX_TOKENwith your actual authentication token
5. Restart Claude Desktop
Close and reopen Claude Desktop. The Plex tools will now be available!
Usage Examples
Search for Content
"Search for The Matrix in my library"
"Find all movies from 2024"
"Show me TV shows with drama in the title"Library Management
"How many items do I have in my Plex library?"
"Show me my movie library statistics"
"What libraries do I have?"Active Sessions
"Who's watching something right now?"
"Show me current Plex sessions"Watchlist & Marking
"Mark The Dark Knight as watched"
"Add Oppenheimer to my watchlist"
"Mark this show as unwatched"Playlists
"Create a playlist called Favorites"
"Show me all my playlists"
"Get my available playlists"Collections
"Add this to my Sci-Fi collection"
"Mark Inception as part of my Best Movies collection"Available Tools
Tool | Description |
| Test connection to Plex server |
| Get Plex server details |
| List all media libraries |
| Get library statistics and breakdown |
| Search across all libraries |
| Search within a specific library |
| See active sessions and what's being watched |
| List all playlists |
| Create a new playlist |
| Add item to watchlist |
| Mark content as watched/unwatched |
| Add item to a collection |
Local Development & Testing
Run the MCP Server Directly
export PLEX_URL="http://your-ip:32400"
export PLEX_TOKEN="your-token"
uv run src/plex_assistant_mcp/main.pyThe server will start and wait for MCP commands via stdio.
Test Connection
python3 << 'EOF'
from src.plex_assistant_mcp.plex_client import PlexClient
import os
client = PlexClient(
os.getenv("PLEX_URL", "http://localhost:32400"),
os.getenv("PLEX_TOKEN", "")
)
print("Connection test:", client.test_connection())
print("Server info:", client.get_server_info())
EOFProject Structure
plex-assistant-mcp/
āāā src/
ā āāā plex_assistant_mcp/
ā āāā __init__.py # Package initialization
ā āāā main.py # MCP server entry point
ā āāā plex_client.py # Plex API wrapper
ā āāā tools.py # MCP tool definitions & handlers
āāā pyproject.toml # Project configuration
āāā requirements.txt # Python dependencies
āāā .env.example # Example environment variables
āāā README.md # This fileTroubleshooting
Error: PLEX_TOKEN environment variable not set
Solution: Make sure your .env file exists and contains:
PLEX_URL=http://your-ip:32400
PLEX_TOKEN=your-tokenError: Connection refused or Unable to connect
Solutions:
Verify Plex is running on your server
Check that the
PLEX_URLis correct (including IP and port)Test the URL in your browser:
http://your-ip:32400Check firewall rules on your server
Ensure Claude Desktop can reach your Plex server
Error: HTTP 401: Unauthorized
Solutions:
Verify your
PLEX_TOKENis correctGenerate a new token if the old one expired
Ensure you're using the correct authentication token format
Error: No results found for search
Solutions:
Try different spelling or keywords
Use exact titles if possible
Check that content exists in your Plex library
Verify library is properly indexed
Claude Desktop Shows No Plex Tools
Solutions:
Verify the configuration file is properly formatted JSON
Restart Claude Desktop completely (not just refresh)
Check the MCP server logs in Claude Desktop settings
Verify the
--directorypath is correctTest connection manually to ensure Plex is reachable
API Reference
PlexClient Methods
# Connection
test_connection() -> bool
# Server & Libraries
get_server_info() -> Dict[str, Any]
get_libraries() -> List[Dict[str, Any]]
get_library_statistics() -> Dict[str, Any]
# Search & Discovery
search(query: str, limit: int = 20) -> List[Dict[str, Any]]
search_in_library(query: str, library_key: str, media_type: str = "") -> List[Dict[str, Any]]
find_item(title: str) -> Optional[Dict[str, Any]]
# Sessions
get_currently_playing() -> List[Dict[str, Any]]
# Playlists
get_playlists() -> List[Dict[str, Any]]
create_playlist(title: str, items: Optional[List] = None, description: str = "") -> Dict[str, Any]
# Content Management
set_watched(item_key: str) -> bool
set_unwatched(item_key: str) -> bool
add_to_collection(item_key: str, collection_name: str) -> bool
remove_from_collection(item_key: str, collection_name: str) -> boolResources
Contributing
Contributions are welcome! Feel free to:
Report bugs and issues
Suggest new features
Submit pull requests
Improve documentation
License
This project is open source and available under the MIT License.
Disclaimer
This project is not officially affiliated with Plex or Anthropic. Use at your own risk and ensure you have proper authorization to access your Plex server.
Made with ā¤ļø for Plex enthusiasts who want AI-powered library management
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityBmaintenanceA 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.Last updated458241JavaScriptMIT
- AlicenseBqualityCmaintenanceEnables search, browsing, and management of Plex media libraries including movies, TV shows, and music, with support for playlists, watch history, natural language music discovery, and detailed media information retrieval.Last updated22645ISC
- AlicenseAqualityDmaintenanceMCP server for managing a media server stack (Plex, Radarr, Overseerr, Bazarr, Prowlarr, Trakt.tv) using natural language to browse, request, and discover content.Last updated12MIT
- Alicense-qualityBmaintenanceLets AI assistants browse your libraries, search media, get viewing recommendations, check what's on deck, and more ā all read-only against your local Plex instance.Last updated821MIT
Related MCP Connectors
Manage SRG+ hubs, channels, content, assets, users, and workspaces from any MCP-aware AI agent.
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
Your memory, everywhere AI goes. Build knowledge once, access it via MCP anywhere.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/axelterrier/plex-assistant-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server