npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sonarr-mcp

v1.7.0

Published

This is a [Model Context Protocol](https://modelcontextprotocol.org) (MCP) server for accessing Sonarr. It provides a set of tools for interacting with Sonarr programmatically.

Downloads

80

Readme

Sonarr MCP Server

This is a Model Context Protocol (MCP) server for accessing Sonarr. It provides a set of tools for interacting with Sonarr programmatically.

Prerequisites

  • Node.js >= 20
  • A running Sonarr instance (v3 or v4)
  • Your Sonarr API key (found in Sonarr UI under Settings > General > API Key)

Tools

The following tools are available:

| Tool | Description | Read-only | |------|-------------|-----------| | search-series | Search for a TV series by term | Yes | | find-episodes | Find episodes for a series | Yes | | get-logs | Get paginated logs from Sonarr | Yes | | list-recent-downloads | List recent download history | Yes | | list-upcoming-episodes | List upcoming episodes from the calendar | Yes | | add-series | Add a series to Sonarr | No |

Example tool calls

Search for a series:

{ "term": "Severance" }

Find episodes:

{ "seriesId": 123, "seasonNumber": 1 }

Add a series:

{
  "title": "Severance",
  "tvdbId": 371980,
  "qualityProfileId": 1,
  "rootFolderPath": "/tv"
}

Resources

The following resources are available:

  • sonarr://series/{id} - Retrieve information about a specific series by ID
  • sonarr://episode/{id} - Retrieve information about a specific episode by ID
  • sonarr://quality-profile - List quality profiles configured in Sonarr
  • sonarr://quality-definition - List quality definitions used by Sonarr

Configuration

Create a .env file or set environment variables:

SONARR_URL=http://localhost:8989
SONARR_API_KEY=your-api-key-here

Usage

With Claude Desktop / MCP Clients

Add this server to your MCP config:

{
  "mcpServers": {
    "sonarr": {
      "command": "npx",
      "args": ["-y", "sonarr-mcp"],
      "env": {
        "SONARR_URL": "http://localhost:8989",
        "SONARR_API_KEY": "<your-sonarr-api-key>"
      }
    }
  }
}

Local Development

npm install
npm run build
npm run test
npm run lint

Run locally with stdio transport:

SONARR_URL=http://localhost:8989 SONARR_API_KEY=xxx npm start

Security

  • Keep your SONARR_API_KEY private. Treat it like a password.
  • Do not commit .env files containing your API key.
  • The server communicates with Sonarr over HTTP(S). Use HTTPS when exposing Sonarr externally.

Troubleshooting

| Issue | Possible Cause | Solution | |-------|--------------|----------| | "fetch failed" or connection errors | Wrong SONARR_URL | Verify the URL and that Sonarr is running | | "Sonarr HTTP 401" | Invalid API key | Check your API key in Sonarr settings | | "Invalid environment variables" | Missing required env vars | Set both SONARR_URL and SONARR_API_KEY |