plexmcp AGENTS.md

A project-instructions file that gives coding agents background about PlexMCP, a server for managing Plex media libraries and an optional web interface.

In plain words
What is it for?
Use it when working on PlexMCP code, running its Python or web checks, starting the server, or launching its web interface.
Why use it?
It keeps an agent aware of the project's structure, tools, versions, commands, and checks before making changes.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/sandraschi/plexmcp/agents-md
Clone the repo
git clone --depth 1 https://github.com/sandraschi/plexmcp

Made for: Codex, OpenCode.

Per session 2,046 This file is loaded in full into every session.
When invoked 2,046 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.02046 $0.02046
Opus 5 $0.01023 $0.01023
Sonnet 5 $0.00409 $0.00409
Haiku 4.5 $0.00205 $0.00205

Measured 2d ago against content hash 8e31d72dddeb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

plexmcp AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 181 lines

How it starts

The opening of the file, as written. The whole thing — 181 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PlexMCP — Agent Context

Project Overview

PlexMCP is an industrialized FastMCP 3.2 server for Plex Media Server. It provides 22 MCP tools (portmanteau) for library/media/search/playlist management, plus an optional FastAPI + Next.js webapp for browsing.

  • Python 3.12+, FastMCP 3.2.0, uv package manager
  • PlexAPI 4.17+, httpx 0.28.1+
  • Webapp: Next.js 15.2, Tailwind CSS, FastAPI backend
  • Ports: backend 10740, frontend 10741

Key Commands

# Lint
ruff check src/plex_mcp/ webapp/backend/     # Python
cd webapp/frontend && biome check .            # JS/TS

# Test
uv run pytest tests/test_portmanteau_*.py --tb=short -q

# Start webapp
cd webapp && powershell -ExecutionPolicy Bypass -File .\start.ps1

# Start MCP server only (stdio)
uv run plex-mcp-advanced

# Justfile
just lint       # ruff + biome
just test       # pytest
just fix        # ruff --fix + biome
just webapp     # start web interface

Architecture

src/plex_mcp/
  app.py              # FastMCP instance creation (heavy, lazy-loaded by webapp)
  prefabs.py          # Prefab card builders (9 cards using prefab_ui)
  tools/portmanteau/  # 20 @mcp.tool() portmanteau tools
  tools/agentic.py    # 2 agentic tools (dynamic registration)
  services/           # PlexService, PlexMediaService, RAG, enrichment
  models/             # Pydantic v2 models (MediaItem, LibrarySection, etc.)

webapp/
  backend/app/
    main.py           # FastAPI app, lazy FastMCP mount
    api/
      images.py       # Image proxy (follow_redirects=True critical!)
      llm.py          # Ollama/OpenAI-compatible chat + model listing
      movies.py       # Movie listing endpoint
      library.py      # Library listing endpoint
      mcp/client.py   # Direct import tool caller (not HTTP subprocess)
  frontend/
    app/
      layout.tsx      # Root layout (suppressHydrationWarning on <html>)
      page.tsx        # Server component (force-dynamic)
      movies/         # Movies page (useSearchParams needs Suspense)
      settings/       # Settings page (LLM model elicitation)
    utils/
      plex-media-ui.ts  # plexImageUrl() -> /image/{path}
      api.ts          # All API fetch wrappers
    next.config.js    # Rewrites for /api/* and /image/* -> backend

Read the full file on GitHub · 181 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 181 lines · 2,046 tokens per session scan A 8e31d72dddeb

Subscribe to this mod's changes

plexmcp AGENTS.md is an instructions file published in the GitHub repository sandraschi/plexmcp (2 stars, last pushed 15d ago), licensed MIT. It adds 2,046 tokens to every session, about $0.0102 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.