Skip to content
Skills Library
Other · Tool integration

plex

/plex

Interact with a Plex Media Server to list libraries, search media, get item details, manage playlists and collections, export metadata, and trigger library rescans. Use when working with Plex servers.

Licence
MIT
Last repository change
25.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
12
Scripts
11
HTML comments
0
URLs in SKILL.md
2
Deprecation

No signals detected. Repository changed on 25.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 11 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/client.py, scripts/config.py, scripts/dump_library_to_json.py, scripts/get_item_details.py, scripts/get_library_items.py, scripts/get_recently_added.py, scripts/get_server_info.py, scripts/get_token.py, scripts/list_libraries.py, scripts/refresh_library.py, scripts/search_media.py

What it does and when to use it

Interact with a Plex Media Server to list libraries, search media, get item details, manage playlists and collections, export metadata, and trigger library rescans. Use when working with Plex servers.

Original author description

Interact with a Plex Media Server to list libraries, search media, get item details, manage playlists and collections, export metadata, and trigger library rescans. Use when working with Plex servers.

How it works

  1. Configuration
  2. Reference
  3. Available Scripts
  4. Key Patterns
  5. Usage Examples
  6. Notes
Original SKILL.md headings · 99 lines, 330 words
SKILL.md preview
---
name: plex
description: "Interact with a Plex Media Server to list libraries, search media, get item details, manage playlists and collections, export metadata, and trigger library rescans. Use when working with Plex servers."
license: MIT
compatibility: Requires Python 3.13+, uv, and python-plexapi
---

# Plex Media Server API

## Configuration

All settings are loaded from the `.env` file in the workspace root.

```env
PLEX_URL=http://localhost:32400
PLEX_TOKEN=your_token
PLEX_USERNAME=your_username
PLEX_PASSWORD=your_password
```

Authentication methods (tried in order):
1. **Direct token** (recommended): `PLEX_URL` + `PLEX_TOKEN`
2. **MyPlex account** (fallback): `PLEX_USERNAME` + `PLEX_PASSWORD`

### Quick Token Setup

```bash
cd skills/plex/scripts
uv run python get_token.py
```

Supports MyPlex login, browser-based PIN auth, or manual token entry.

## Reference

- python-plexapi docs: https://python-plexapi.readthedocs.io/
- Code Snippets: `scripts/`

## Available Scripts

| Script | Purpose |
|--------|---------|
| `config.py` | Loads credentials from `.env` |
| `client.py` | Creates authenticated `PlexServer` instance |
| `get_token.py` | Interactive token helper |
| `list_libraries.py` | List all libraries |
| `get_library_items.py` | Get items from a library |
| `search_media.py` | Search by query, type, library |
| `get_item_details.py` | Full metadata for an item |
| `get_recently_added.py` | Recently added items |
| `refresh_library.py` | Trigger library refresh/scan |
| `dump_library_to_json.py` | Export library to JSON |
| `get_server_info.py` | Server info, active sessions |

## Key Patterns

### API Access

```python
from plexapi.server import PlexServer

plex = PlexServer(baseurl, token)
libraries = plex.library.sections()
section = plex.library.section('Movies')
results = plex.search('query')
item = plex.fetchItem(rating_key)
```

### Common Operations

- **Libraries**: `plex.library.sections()`, `plex.library.section('name')`
- **Search**: `plex.search('query')`, `section.search(query=..., libtype=...)`
- **Items**: `section.all()`, `plex.fetchItem(key)`, `section.recentlyAdded()`
- **Refresh**: `section.refresh()`, `section.update()`
- **TV Shows**: `show.seasons()`, `show.episodes()`, `show.episode(season=N, episode=M)`
- **Playlists**: `plex.playlists()`, `plex.createPlaylist(title, items=items)`
- **Collections**: `section.collections()`, `collection.items()`

### Item Metadata

- `title`, `year`, `summary`, `rating`, `contentRating`
- `[g.tag for g in item.genres]`, `[d.tag for d in item.directors]`
- `[g.id for g in item.guids]` (IMDB, TMDB, TVDB)
- `item.media[0].parts[0].file` (file path)

### Library/Item Types

`movie`, `show`, `season`, `episode`, `artist`, `album`, `track`, `photo`

## Usage Examples

```bash
cd skills/plex/scripts
uv run python list_libraries.py
uv run python search_media.py "Midway"
uv run python get_recently_added.py "Movies" 10
uv run python dump_library_to_json.py "Movies"
uv run python refresh_library.py "Movies"
```

## Notes

- Use `client.py` and `get_plex_client()` as the starting point.
- Temporary files go in `$WORKSPACE_PATH/temp/`.
Files in this package (12)
  • SKILL.md 3 KB
  • scripts/client.py 4 KB
  • scripts/config.py 1 KB
  • scripts/dump_library_to_json.py 4 KB
  • scripts/get_item_details.py 5 KB
  • scripts/get_library_items.py 3 KB
  • scripts/get_recently_added.py 3 KB
  • scripts/get_server_info.py 4 KB
  • scripts/get_token.py 7 KB
  • scripts/list_libraries.py 1 KB
  • scripts/refresh_library.py 2 KB
  • scripts/search_media.py 3 KB

Versions

RepositoryScoreLicence
This page · hevangel/media-agent-skills100MIT
dinglebear-ai/yarr100AGPL-3.0

Database snapshot: 13.11.2026 · package version 606d435ef899 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100jellyfin
    Interact with the Jellyfin media server API to list libraries, search media, get item details, export metadata, and trigger library rescans. Use when working with Jellyfin servers.
  • 100tautulli
    This skill should be used when the user asks about Plex watch statistics, historical playback data, most-watched content, user activity trends, library stats, stream analytics, or anything related to Tautulli monitoring and analytics — favor this over the `plex` skill for…
  • 100jellyfin
    Query your Jellyfin media server from the terminal — recently added media, search, item details, series navigation, next-up episodes, library browsing, server info, and user login. Use when the user asks about Jellyfin, media servers, movies, TV shows, next episodes, or their…
  • 100tracearr
    This skill should be used when working with Tracearr media-server monitoring for Plex, Jellyfin, or Emby, including active streams, stream analytics, account-sharing detection, trust scores, alerts, Tautulli/Jellystat imports, Docker deployment, plugin configuration, or Tracearr's public API.
  • 100music-to-plex
    Acquire music and make it playable in Plex/Plexamp: single albums (via mtp-bot), DJ tracklists/crates, and YouTube playlists. Use ONLY when the user explicitly wants to ADD or DOWNLOAD music to Plex (e.g. 'add to Plex', 'get me this album', 'download this playlist', a…
  • 100music-to-plex
    Acquire music and make it playable in Plex/Plexamp: single albums (via mtp-bot), DJ tracklists/crates, and YouTube playlists. Use ONLY when the user explicitly wants to ADD or DOWNLOAD music to Plex (e.g. 'add to Plex', 'get me this album', 'download this playlist', a…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.