Plex MCP server
Configuration
View docs{
"mcpServers": {
"djbriane-plex-mcp": {
"command": "uv",
"args": [
"--directory",
"FULL_PATH_TO_PROJECT",
"run",
"src/plex_mcp/plex_mcp.py"
],
"env": {
"PLEX_TOKEN": "YOUR_PLEX_TOKEN",
"PLEX_SERVER_URL": "YOUR_PLEX_SERVER_URL"
}
}
}
}You can run a Python-based MCP server that talks to your Plex Media Server via the Plex API to search for movies, identify missing titles, and create playlists. This enables you to discover gaps in your collection and organize movies directly in Plex from your MCP client.
You interact with the Plex MCP Server through your MCP client by sending commands to search your Plex library, fetch movie details and genres, manage playlists, and retrieve recently added items. Practical workflows include finding movies by a director, identifying missing titles, and creating new playlists from search results.
Common tasks you can perform include searching for movies by title, director, or genre, getting detailed information about a specific movie, listing and inspecting playlists, and adding movies to playlists. The server exposes endpoints to retrieve recent additions and to remove playlists when needed.
Prerequisites you need before installation are Python 3.8 or higher, the uvx package manager, and a Plex Media Server with API access.
Install the Plex MCP Server locally by following these steps. 1) Clone the project repository. 2) Set up and activate a Python virtual environment using uvx. 3) Install any required dependencies and synchronize the project files.
git clone <repository-url>
cd plex-mcp
uv venv
source .venv/bin/activate
uv syncConfigure Claude to run the Plex MCP Server by providing the runtime command and the Plex connection details in your Claude app configuration.
{
"mcpServers": {
"plex": {
"command": "uv",
"args": [
"--directory",
"FULL_PATH_TO_PROJECT",
"run",
"src/plex_mcp/plex_mcp.py"
],
"env": {
"PLEX_TOKEN": "YOUR_PLEX_TOKEN",
"PLEX_SERVER_URL": "YOUR_PLEX_SERVER_URL"
}
}
}
}To obtain your Plex token, sign in to Plex Web App, open Developer Tools, switch to the Console tab, and run the following to retrieve the token from local storage.
window.localStorage.getItem('myPlexAccessToken')Search for movies in your Plex library by filters such as title, director, or genre, with support for limiting results.
Retrieve detailed information about a specific movie by its ratingKey.
Fetch the genres associated with a specific movie.
List all playlists available on the Plex server.
Get the items contained in a specific playlist.
Create a new playlist populated with specified movies.
Delete a specified playlist from the Plex server.
Add a movie to an existing playlist.
Retrieve recently added movies from the Plex library.