A MCP server to allow LLM's to interact with your plex server
Project description
๐ฌ Plex MCP Server
A Model Context Protocol (MCP) server that enables AI assistants to interact with your Plex Media Server! ๐
TL;DR
To use this server with an MCP client (like Cursor), add this configuration to your MCP settings:
{
"mcpServers": {
"plex-mcp": {
"command": "uvx",
"args": [
"plex-mcp",
"--baseurl",
"<PLEX_BASEURL>",
"--token",
"<PLEX_TOKEN>"
]
}
}
}
Replace <PLEX_BASEURL> / <PLEX_TOKEN> with your actual Plex server URL and authentication token.
โจ Features
๐ฅ Movies
- Search movies by title, genre, year, or rating
- Browse recently added movies
- Get detailed movie info including cast, directors, and ratings
- Filter by year ranges and rating criteria
๐ต Music
- Search music tracks and artists
- Create and manage playlists
- Get random tracks by decade for discovery
- Browse music library information
๐บ TV Shows
- Search TV shows and episodes
- Browse episodes by season
- Get detailed episode information
- Find recently added shows
๐ฎ Client Control
- Control Plex clients remotely (play, pause, stop, seek)
- Navigate client interfaces (up, down, left, right, select, back)
- Set volume levels on connected clients
- Get playback state information
- Play media on specific clients
๐ Collections
- Create and manage collections of movies, shows, or music
- Add/remove items from collections
- Search collections by title or criteria
- Update collection metadata (title, summary)
- Delete collections when no longer needed
โ๏ธ Settings & Management
- View and modify server settings
- Get library section information
- Scan libraries for new media
- Empty trash to free up space
- Analyze libraries for metadata
- Get detailed server information
๐ Quick Start
Prerequisites
- Python 3.12+
- A running Plex Media Server
- Plex authentication token
Installation
# Clone the repository
git clone https://github.com/knguyen1/plex-mcp.git
cd plex-mcp
# Install dependencies
uv venv && uv sync
Configuration
Set up your Plex server credentials:
export PLEX_BASEURL="http://localhost:32400" # Your Plex server URL
export PLEX_TOKEN="your-plex-token-here" # Your Plex token
Finding your Plex token:
- Go to your Plex server web interface
- Navigate to Settings โ Network
- Look for "Plex Token" or use browser dev tools to find the
X-Plex-Tokenheader
Running the Server
uv run plex-mcp
๐ฏ Sample Use Cases
๐ฌ Movie Discovery
"Find all sci-fi movies from the 80s with ratings above 7.0"
"Show me recently added action movies"
"What are the highest rated movies in my library?"
๐ต Music Curation
"Create a playlist of random 90s rock songs"
"Find all tracks by The Beatles"
"Show me my most recently added music"
๐บ TV Show Management
"List all episodes of Breaking Bad season 1"
"Find shows I haven't watched yet"
"What's the latest episode of The Office?"
๐ฎ Remote Control
"Play Inception on my living room TV"
"Pause the current show on my phone"
"Set volume to 50% on the bedroom client"
"Navigate up and select on the Apple TV"
๐ Collection Management
"Create a collection called 'Marvel Movies'"
"Add all Iron Man movies to the Marvel collection"
"Find collections with 'action' in the title"
"Update the description of my 'Holiday Movies' collection"
โ๏ธ Server Management
"Show me all server settings"
"Scan my Movies library for new content"
"Empty trash in the Music library"
"Get detailed information about my Plex server"
๐ Smart Search
"Find movies similar to Inception"
"Show me horror movies from the last 5 years"
"Create a workout playlist with high-energy songs"
๐ ๏ธ Available Tools
Movies ๐ฅ
search_movies- Search movies by titleget_movies_library- Get library informationget_movie_info- Detailed movie informationsearch_movies_by_genre- Filter by genresearch_movies_by_year- Filter by year/rangeget_recently_added_movies- Latest additionsget_movies_by_rating- Filter by rating
Music ๐ต
search_music_tracks- Search music libraryget_music_library- Library informationcreate_music_playlist- Create playlistsget_random_tracks_by_decade- Random discoverysearch_tracks_by_artist- Artist-specific searchget_playlist_info- Playlist detailsdelete_playlist- Remove playlists
TV Shows ๐บ
search_tv_shows- Search TV libraryget_tv_shows_library- Library informationget_show_episodes- Episode listingsget_episode_info- Episode detailssearch_episodes_by_show- Show-specific episodesget_recently_added_shows- Latest additions
Client Control ๐ฎ
list_clients- List all connected Plex clientsget_client_info- Get detailed client informationplay_media- Play media on a specific clientcontrol_playback- Control playback (play, pause, stop, seek)set_volume- Set volume on a clientnavigate_client- Navigate client interfaceget_playback_state- Get current playback state
Collections ๐
list_collections- List all collections in a libraryget_collection_info- Get detailed collection informationcreate_collection- Create a new collectionadd_to_collection- Add items to a collectionremove_from_collection- Remove items from a collectionupdate_collection- Update collection metadatadelete_collection- Delete a collectionsearch_collections- Search collections by title
Settings & Management โ๏ธ
get_server_settings- Get all server settingsget_setting- Get a specific server settingset_setting- Set a server setting valueget_library_sections- Get all library sectionsscan_library- Scan a library for new mediaempty_trash- Empty trash for a libraryanalyze_library- Analyze library for metadataget_server_info- Get detailed server information
๐ง Development
Setup Development Environment
# Install development dependencies
uv venv && uv sync
# Run linting
uv run ruff check --fix && uv run ruff format
# Run tests
pytest
Project Structure
src/plex_mcp/
โโโ client/ # Plex API client
โโโ sections/ # Media type handlers
โ โโโ movies.py # Movie operations
โ โโโ music.py # Music operations
โ โโโ tv_shows.py # TV show operations
โ โโโ client_control.py # Client control operations
โ โโโ collections.py # Collection management
โ โโโ settings.py # Server settings & management
โโโ __init__.py # Main server entry point
๐ค Contributing
- 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
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Built with FastMCP framework
- Uses PlexAPI for Plex integration
- Inspired by the Model Context Protocol specification
Happy streaming! ๐ฌ๐ต๐บ
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plex_mcp-0.2.0.tar.gz.
File metadata
- Download URL: plex_mcp-0.2.0.tar.gz
- Upload date:
- Size: 328.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7eeb40c7bc24a6ae27f53e03c840840fa35b83d8c55181d40ab91105441c0cc2
|
|
| MD5 |
327bfcaa6a87d0701406c8a3fe471ef3
|
|
| BLAKE2b-256 |
495ae82579d65aacdd5b84f631bd907e48cc5dc2c61565f520da0e119caeb26c
|
Provenance
The following attestation bundles were made for plex_mcp-0.2.0.tar.gz:
Publisher:
publish.yml on knguyen1/plex-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
plex_mcp-0.2.0.tar.gz -
Subject digest:
7eeb40c7bc24a6ae27f53e03c840840fa35b83d8c55181d40ab91105441c0cc2 - Sigstore transparency entry: 571181412
- Sigstore integration time:
-
Permalink:
knguyen1/plex-mcp@d0a987ca46481a11339febe597cb59a153a75f5d -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/knguyen1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d0a987ca46481a11339febe597cb59a153a75f5d -
Trigger Event:
release
-
Statement type:
File details
Details for the file plex_mcp-0.2.0-py3-none-any.whl.
File metadata
- Download URL: plex_mcp-0.2.0-py3-none-any.whl
- Upload date:
- Size: 40.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
827d47762e4109866a0ba3b956544d0a62ed594996e7bd6762ee22ede11581a2
|
|
| MD5 |
584d7dfafd41d2c55d44851868dc2ea3
|
|
| BLAKE2b-256 |
14d19120e8da6007a0849443918dcf8d913313b6899c632aa2315fcda8396f22
|
Provenance
The following attestation bundles were made for plex_mcp-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on knguyen1/plex-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
plex_mcp-0.2.0-py3-none-any.whl -
Subject digest:
827d47762e4109866a0ba3b956544d0a62ed594996e7bd6762ee22ede11581a2 - Sigstore transparency entry: 571181432
- Sigstore integration time:
-
Permalink:
knguyen1/plex-mcp@d0a987ca46481a11339febe597cb59a153a75f5d -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/knguyen1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d0a987ca46481a11339febe597cb59a153a75f5d -
Trigger Event:
release
-
Statement type: