mcp-plex
MCP server for Plex Media Server, focused on media discovery, search, library management, and playback control.
README
mcp-plex
MCP server for Plex Media Server, focused on media discovery, search, library management, and playback control. 24 granular tools designed for use with Claude and other LLM agents.
Prerequisites
- Python 3.14+
- uv
- A running Plex Media Server
- A Plex authentication token
Setup
1. Get Your Plex Token
The easiest way to find your Plex token:
- Sign in to Plex Web App
- Browse to any media item and click Get Info (or ... > Get Info)
- Click View XML in the bottom-left
- In the URL bar, find the
X-Plex-Token=parameter -- that's your token
Alternatively, check the Plex support article for other methods.
2. Install
cd mcp-plex
uv sync
3. Configure Environment Variables
Set these before running the server:
export PLEX_SERVER_URL="http://your-plex-server:32400"
export PLEX_TOKEN="your_plex_token"
4. Test the Connection
uv run mcp-plex-server
The server connects to your Plex server on startup and verifies the token. If the connection fails, check that your server URL and token are correct.
Claude Desktop / Claude Code Configuration
Add to your MCP server config. If installed from PyPI:
{
"mcpServers": {
"plex": {
"command": "uvx",
"args": ["mcp-plex-server"],
"env": {
"PLEX_SERVER_URL": "http://your-plex-server:32400",
"PLEX_TOKEN": "your_plex_token"
}
}
}
}
Or if running from a local clone:
{
"mcpServers": {
"plex": {
"command": "uv",
"args": ["--directory", "/path/to/mcp-plex", "run", "mcp-plex-server"],
"env": {
"PLEX_SERVER_URL": "http://your-plex-server:32400",
"PLEX_TOKEN": "your_plex_token"
}
}
}
}
Tools
Discovery
| Tool | Parameters | Description |
|---|---|---|
search_media |
query, media_type="", limit=20 |
Search across all libraries. Optional type filter: "movie", "show", "episode", "artist", "album", "track". |
get_recently_added |
limit=20, library_name="" |
Recently added media, optionally filtered to a library. |
get_on_deck |
limit=10 |
Continue watching / next episode list. |
Library Browsing
| Tool | Parameters | Description |
|---|---|---|
get_libraries |
(none) | List all library sections with types and item counts. |
get_library_contents |
library_name, sort="titleSort", limit=50 |
Browse a library. Sort by title, date added, year, or rating. |
get_media_details |
rating_key |
Full details for one item: summary, genres, cast, directors, ratings. |
get_library_stats |
library_name="" |
Item counts and stats for one or all libraries. |
Shows
| Tool | Parameters | Description |
|---|---|---|
get_seasons |
rating_key |
List seasons for a TV show. |
get_episodes |
rating_key, season_number=0 |
List episodes (all or by season). |
Collections
| Tool | Parameters | Description |
|---|---|---|
get_collections |
library_name |
List collections in a library (includes smart/regular type). |
get_collection_items |
rating_key |
Get collection details and all items it contains. |
create_collection |
library_name, title, rating_keys |
Create a regular collection from specific items. |
create_smart_collection |
library_name, title, filters, libtype="", sort="", limit=0 |
Create a smart (filter-based) auto-updating collection. |
edit_collection |
rating_key, title="", summary=None, sort_order="", mode="" |
Edit collection metadata (title, summary, sort, display mode). |
add_to_collection |
rating_key, item_rating_keys |
Add items to a regular collection. |
remove_from_collection |
rating_key, item_rating_keys |
Remove items from a regular collection. |
delete_collection |
rating_key |
Delete a collection (does not affect the media items). |
Playlists
| Tool | Parameters | Description |
|---|---|---|
get_playlists |
(none) | List all playlists on the server. |
get_playlist_items |
rating_key |
Get items in a playlist. |
Watch State
| Tool | Parameters | Description |
|---|---|---|
mark_watched |
rating_key |
Mark a movie, episode, or track as fully watched. |
mark_unwatched |
rating_key |
Mark an item as unwatched, resetting progress. |
remove_from_continue_watching |
rating_key |
Remove a movie or episode from Continue Watching / On Deck. |
set_playback_progress |
rating_key, progress_ms |
Set playback position in milliseconds (must be > 0). |
Management
| Tool | Parameters | Description |
|---|---|---|
scan_library |
library_name |
Trigger a background library scan. |
Development
uv run mcp-plex-server # Run the server
uv run ruff check src/ # Lint
uv run ruff format src/ # Format
uv run pyright src/ # Type check
Pre-commit Hooks
This project uses lefthook for pre-commit checks. Install with brew install lefthook (or see other install methods), then:
lefthook install
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。