Plex MCP Server is a versatile control panel for your Plex Media Server, allowing AI assistants and other applications to interact with your Plex libraries, collections, media, and users.
- Comprehensive access to Plex libraries
- Media search and playback control
- Collection and playlist management
- Media metadata editing
- User management
- Server monitoring
- Clone this repository
- Install dependencies:
pip install -r requirements.txt- Configure your Plex connection:
- Create a
.envfile with your Plex URL and token:
PLEX_URL=http://your-plex-server:32400 PLEX_TOKEN=your-plex-token- Alternatively, set environment variables directly:
export PLEX_URL=http://your-plex-server:32400 export PLEX_TOKEN=your-plex-token
- Create a
The server can be launched in two different modes depending on your needs:
Run the server directly from the command line:
python plex_mcp_server.py
# or explicitly specify stdio transport
python plex_mcp_server.py --transport stdioRun the server as a web service to allow access from web applications:
python plex_mcp_server.py --transport sse --host 0.0.0.0 --port 8080In this mode, the server endpoints are:
- Server URL:
http://[host]:[port] - SSE endpoint:
/sse - Message endpoint:
/messages/
You can easily integrate Plex MCP Server with Claude Desktop or other MCP-compatible applications.
- Open Claude Desktop and go to Settings → Developer → Edit Config
- Add the following to your configuration file (replacing paths as needed):
{
"mcpServers": {
"plex-server": {
"command": "python",
"args": [
"C:\\path\\to\\plex_mcp_server.py",
"--transport",
"stdio"
],
"env": {
"PLEX_URL": "http://your-plex-server:32400",
"PLEX_TOKEN": "your-plex-token"
}
}
}
}- Restart Claude Desktop
- Look for the tools icon in the input box to access Plex functions
Plex MCP Server provides numerous tools for interacting with your Plex server:
- Library management: list, refresh, scan libraries
- Media operations: search, play, edit metadata
- Collection management: create, edit, delete collections
- Playlist handling: create and manage playlists
- User information: view activity, history, and details
- Server monitoring: logs, active sessions
PLEX_URL: URL of your Plex server (required)PLEX_TOKEN: Authentication token for your Plex server (required)PLEX_USERNAME: Plex username (optional, alternative to token)PLEX_PASSWORD: Plex password (optional, alternative to token)PLEX_SERVER_NAME: Name of your Plex server (required if using username/password)
If you make changes to the configuration or the server is unresponsive, restart it using the same command you used to start it initially.
- Verify your Plex server is running and accessible
- Check that your Plex token is valid
- Ensure required Python packages are installed
- Check logs for detailed error information
[License information]