This server provides a standardized interface for interacting with Plex Media Server through a JSON-based API. It allows for automation, scripting, and integration with other tools by offering a consistent way to manage your Plex libraries, collections, playlists, and more.
Follow these steps to install and configure the Plex MCP Server:
pip install -r requirements.txt
cp .env.example .env
.env
file to add your Plex credentials:PLEX_URL=http://your-plex-server:32400
PLEX_TOKEN=your-plex-token
The STDIO transport mode is ideal for direct integration with applications like Claude Desktop or Cursor. In this mode, the server accepts commands via standard input and outputs results in JSON format.
To start the server in STDIO mode:
python3 -m plex_mcp
Or alternatively:
python3 plex_mcp_server.py --transport stdio
If you're integrating with Claude Desktop or Cursor, add this configuration to your application settings:
{
"plex": {
"command": "python",
"args": [
"C://Users//User//Documents//plex-mcp-server//plex_mcp_server.py",
"--transport=stdio"
],
"env": {
"PLEX_URL":"http://localhost:32400",
"PLEX_TOKEN":"av3khi56h634v3",
"PLEX_USERNAME:"Administrator"
}
}
}
The Server-Sent Events (SSE) transport provides a web-based interface for integration with web applications and services.
To start the server with SSE transport:
python3 plex_mcp_server.py --transport sse --host 0.0.0.0 --port 3001
Default configuration:
/sse
/messages/
When using SSE mode, configure your client with:
{
"plex": {
"url": "http://localhost:3001/sse"
}
}
Note: The Client Module functionality may be limited as some features are still in development.
All commands return standardized JSON responses with a consistent structure:
{
"success_field": true,
"relevant_data": "value",
"additional_info": {}
}
{
"error": "Error message describing what went wrong"
}
[
{
"title": "Item Title",
"id": 12345,
"type": "movie",
"year": 2023
},
{
"title": "Another Item",
"id": 67890,
"type": "show",
"year": 2022
}
]
This standardized format ensures compatibility with various tools, automation platforms, and AI systems.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "plex" '{"command":"python","args":["plex_mcp_server.py","--transport=stdio"],"env":{"PLEX_URL":"http://localhost:32400","PLEX_TOKEN":"av3khi56h634v3","PLEX_USERNAME":"Administrator"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"plex": {
"command": "python",
"args": [
"plex_mcp_server.py",
"--transport=stdio"
],
"env": {
"PLEX_URL": "http://localhost:32400",
"PLEX_TOKEN": "av3khi56h634v3",
"PLEX_USERNAME": "Administrator"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"plex": {
"command": "python",
"args": [
"plex_mcp_server.py",
"--transport=stdio"
],
"env": {
"PLEX_URL": "http://localhost:32400",
"PLEX_TOKEN": "av3khi56h634v3",
"PLEX_USERNAME": "Administrator"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect