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! 🚀
✨ 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
🚀 Quick Start
Prerequisites
- Python 3.12+
- A running Plex Media Server
- Plex authentication token
Installation
# Clone the repository
git clone https://github.com/your-username/plex-mcp.git
cd plex-mcp
# Install dependencies
pip install -e .
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
plex-mcp
MCP Server Configuration
To use this server with an MCP client (like Cursor), add this configuration to your MCP settings:
{
"mcpServers": {
"plex-mcp": {
"command": "uv",
"args": [
"run",
"plex-mcp",
"--baseurl",
"<PLEX_BASEURL>",
"--token",
"<PLEX_TOKEN>"
]
}
}
}
Replace <PLEX_BASEURL> / <PLEX_TOKEN> with your actual Plex server URL and authentication token.
🎯 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?"
🔍 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
🔧 Development
Setup Development Environment
# Install development dependencies
pip install -e ".[dev]"
# 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
└── __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.1.0.tar.gz.
File metadata
- Download URL: plex_mcp-0.1.0.tar.gz
- Upload date:
- Size: 304.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4066b5830575c772bfb188eb27f5b688661ea7d0f08e6ec0a1918ac4cc3dc86d
|
|
| MD5 |
ee460965b0cc227fa2929f3878c7bd73
|
|
| BLAKE2b-256 |
a8efcdc50e9f34a1bd4f7453f02fd637c3fef1c74dd95ca4f91dceb46c823b88
|
Provenance
The following attestation bundles were made for plex_mcp-0.1.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.1.0.tar.gz -
Subject digest:
4066b5830575c772bfb188eb27f5b688661ea7d0f08e6ec0a1918ac4cc3dc86d - Sigstore transparency entry: 570256333
- Sigstore integration time:
-
Permalink:
knguyen1/plex-mcp@5d64ecfb8f89b743f986e7d79b886ec494b1ad3b -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/knguyen1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5d64ecfb8f89b743f986e7d79b886ec494b1ad3b -
Trigger Event:
release
-
Statement type:
File details
Details for the file plex_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: plex_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.4 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 |
6ffcd68c1c2effa84db5742e9069d2370eca4277a5d3f9355ac94a8ec0f03a7b
|
|
| MD5 |
977c75cdb4f151a66497d43495dd842b
|
|
| BLAKE2b-256 |
8489aa3a8f3c0d5aa9bf55b468f162abaed7e7688b9a0519d51256c04746b059
|
Provenance
The following attestation bundles were made for plex_mcp-0.1.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.1.0-py3-none-any.whl -
Subject digest:
6ffcd68c1c2effa84db5742e9069d2370eca4277a5d3f9355ac94a8ec0f03a7b - Sigstore transparency entry: 570256337
- Sigstore integration time:
-
Permalink:
knguyen1/plex-mcp@5d64ecfb8f89b743f986e7d79b886ec494b1ad3b -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/knguyen1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5d64ecfb8f89b743f986e7d79b886ec494b1ad3b -
Trigger Event:
release
-
Statement type: