servarr-analytics-mcp

servarr-analytics-mcp

Provides a structured data interface for Servarr apps (Sonarr, Radarr, Prowlarr) enabling health checks, analytics, simulations, backups, and guarded write operations.

Category
访问服务器

README

Servarr Analytics MCP

Servarr Analytics MCP is a Model Context Protocol server for Sonarr, Radarr, and Prowlarr. It gives AI clients a structured data interface for health checks, configuration reads, library analytics, simulations, backups, diffs, reports, and guarded write/bulk operations.

The MCP retrieves and aggregates data. The AI client analyzes the returned structured data and explains recommendations.

Quick Start With npx

SONARR_URL=http://localhost:8989 \
SONARR_API_KEY=your-sonarr-api-key \
RADARR_URL=http://localhost:7878 \
RADARR_API_KEY=your-radarr-api-key \
PROWLARR_URL=http://localhost:9696 \
PROWLARR_API_KEY=your-prowlarr-api-key \
npx -y servarr-analytics-mcp

All diagnostics are written to stderr. stdout is reserved for MCP stdio protocol traffic.

Docker

docker run --rm -i \
  -e SONARR_URL=http://host.docker.internal:8989 \
  -e SONARR_API_KEY=your-sonarr-api-key \
  -e RADARR_URL=http://host.docker.internal:7878 \
  -e RADARR_API_KEY=your-radarr-api-key \
  -e PROWLARR_URL=http://host.docker.internal:9696 \
  -e PROWLARR_API_KEY=your-prowlarr-api-key \
  ghcr.io/OWNER/servarr-analytics-mcp:latest

Replace OWNER with the GitHub owner that publishes the image.

Docker Compose

services:
  servarr-analytics-mcp:
    image: ghcr.io/OWNER/servarr-analytics-mcp:latest
    stdin_open: true
    environment:
      SONARR_URL: http://sonarr:8989
      SONARR_API_KEY: your-sonarr-api-key
      RADARR_URL: http://radarr:7878
      RADARR_API_KEY: your-radarr-api-key
      PROWLARR_URL: http://prowlarr:9696
      PROWLARR_API_KEY: your-prowlarr-api-key
    volumes:
      - servarr-analytics-backups:/app/.servarr-analytics-backups

volumes:
  servarr-analytics-backups:

MCP JSON Config

{
  "mcpServers": {
    "servarr-analytics": {
      "command": "npx",
      "args": ["-y", "servarr-analytics-mcp"],
      "env": {
        "SONARR_URL": "http://localhost:8989",
        "SONARR_API_KEY": "your-sonarr-api-key",
        "RADARR_URL": "http://localhost:7878",
        "RADARR_API_KEY": "your-radarr-api-key",
        "PROWLARR_URL": "http://localhost:9696",
        "PROWLARR_API_KEY": "your-prowlarr-api-key"
      }
    }
  }
}

Codex TOML Config

[mcp_servers.servarr-analytics]
command = "npx"
args = ["-y", "servarr-analytics-mcp"]

[mcp_servers.servarr-analytics.env]
SONARR_URL = "http://localhost:8989"
SONARR_API_KEY = "your-sonarr-api-key"
RADARR_URL = "http://localhost:7878"
RADARR_API_KEY = "your-radarr-api-key"
PROWLARR_URL = "http://localhost:9696"
PROWLARR_API_KEY = "your-prowlarr-api-key"

Configuration

Configure only the apps you want to expose. Each configured app requires both URL and API key.

Variable Required Description
SONARR_URL optional Sonarr base URL.
SONARR_API_KEY optional Sonarr API key.
RADARR_URL optional Radarr base URL.
RADARR_API_KEY optional Radarr API key.
PROWLARR_URL optional Prowlarr base URL.
PROWLARR_API_KEY optional Prowlarr API key.
SONARR_API_BASE_PATH optional API base path. Defaults to /api/v3.
RADARR_API_BASE_PATH optional API base path. Defaults to /api/v3.
PROWLARR_API_BASE_PATH optional API base path. Defaults to /api/v1.
SERVARR_TIMEOUT_MS optional HTTP timeout. Defaults to 30000.
SERVARR_BACKUP_DIR optional Backup directory. Defaults to .servarr-analytics-backups.

Do not commit API keys or real local URLs to a public repository.

Tool Coverage

The server registers all tools from the initial architecture plan:

  • Health: health_check_all, get_system_status, get_app_config, test_connection, get_api_version
  • Configuration: quality profiles, definitions, custom formats, language/delay profiles, tags, root folders, download clients, indexers, notifications, metadata profiles, naming, media management, disk, health
  • Library: Radarr movies/files/missing/cutoff unmet; Sonarr series/episodes/files/missing/cutoff unmet
  • History and queue: history, grab/import/failed/deleted history, queue, queue details, blocklist
  • Prowlarr: indexers, indexer status/stats/history/tests, download clients, applications
  • Analytics: library, quality, codec, resolution, HDR, audio, profile, custom format, storage, tracker/indexer analytics
  • Simulation: quality profile, custom format, cutoff, score, storage, upgrade, and codec strategy simulations
  • Backup and diff: create/list/restore backup, generate diff, validate patch, dry-run patch, apply patch
  • Write and bulk operations: quality profiles, custom formats, scores, quality definitions, delay profile, naming, media management, restrictions
  • Reports: quality, storage, tracker, failed downloads, monthly statistics, recommendations

Some analytics and simulations are best-effort aggregations over the Servarr API data available to the configured app.

Large Result Controls

Most read and analytics tools accept:

  • detail: summary, normal, verbose, or raw
  • page, pageSize, limit
  • from, to
  • sampleRecords
  • fields
  • groupBy
  • cursor

Defaults protect the client context window:

  • default pageSize: 100
  • max pageSize: 500
  • raw responses are capped
  • aggregation is performed inside the MCP where possible

Write Safety

Mutating tools require confirm: true. Restore, patch application, and bulk score updates also require dryRun: false.

Restore and patch operations are constrained by a safe endpoint allowlist. Collection updates such as quality profiles, custom formats, download clients, indexers, notifications, tags, and root folders must target a specific item id, for example qualityprofile/3. Singleton config endpoints such as config/naming and config/mediamanagement may be updated directly. A real backup restore also requires a specific app target.

bulk_update_scores targets one explicit quality profile through body.qualityProfileId and one or more explicit custom format ids in body.updates. Without dryRun: false, it returns the planned score changes and does not call Servarr.

Examples:

{
  "app": "radarr",
  "id": 3,
  "body": {
    "name": "HD-1080p"
  },
  "confirm": true
}

Patch application:

{
  "dryRun": false,
  "confirm": true,
  "operations": [
    {
      "app": "sonarr",
      "method": "PUT",
      "path": "qualityprofile/3",
      "body": {
        "id": 3,
        "name": "HD-1080p"
      }
    }
  ]
}

Always create a backup before write, restore, or bulk operations.

Development

npm ci
npm run lint
npm test
npm run build

Build output is written to dist/. The executable is dist/index.js.

Release

Publishing is handled by GitHub Actions when a GitHub Release is published.

  • npm publishes servarr-analytics-mcp through npm trusted publishing/OIDC.
  • GHCR publishes ghcr.io/<owner>/servarr-analytics-mcp.
  • The release tag must match package.json, for example v0.1.2.
  • The workflow runs lint, tests, and build before publishing.

Before the first release:

  1. Create the public GitHub repository.
  2. Replace OWNER placeholders in docs/examples if desired.
  3. Verify the npm package name is available.
  4. Configure npm trusted publishing for .github/workflows/release.yml.
  5. Publish a GitHub Release tagged v0.1.2.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选