MCPcopy Index your code
hub / github.com/JeremiahM37/librarr

github.com/JeremiahM37/librarr @v1.1.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.1.3 ↗ · + Follow
1,302 symbols 5,161 edges 149 files 591 documented · 45%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Librarr

Build & Test Release Go Report Card License: MIT

The missing *arr for books. Self-hosted book, audiobook, and manga search and download manager -- like Sonarr/Radarr but for your reading library.

Librarr searches all configured indexers in parallel, scores results by confidence, and auto-imports into your Calibre, Audiobookshelf, Kavita, or Komga library. Single ~17MB Go binary, no runtime dependencies — ~14MB RSS idle in a real homelab[^1], typically 10-20× lower than the .NET-based *arr apps.

[^1]: Measured on v1.1.0 in an LXC on Debian 12 (Mar 2026). Reference: Sonarr 4.x ≈ 240MB, Radarr 5.x ≈ 220MB on the same host.

Screenshots

Search Library
Parallel indexer search with confidence scoring Unified library view across ebooks, audiobooks, and manga
Wishlist Settings
Wishlist with auto-search scheduler Settings with 2FA, user management, and connection tests

Why Librarr?

  • Import your Goodreads or StoryGraph library via CSV and bulk-download everything
  • Request workflow -- users request books, admins approve, downloads happen automatically (like Jellyseerr for books)
  • Quality profiles -- rank formats (EPUB > PDF > MOBI), auto-upgrade when a better version appears
  • Author monitoring -- follow authors and get notified when new releases are found
  • Series auto-complete -- detects gaps in series and searches for missing volumes
  • Torznab API -- add Librarr as an indexer in Prowlarr or Readarr (it works both ways)
  • OPDS 1.2 feed -- browse your library from any e-reader app
  • Tiny footprint -- ~14MB idle RSS, runs comfortably on a Pi or any thermally-constrained mini-PC

Features

Search and Scoring

  • Pluggable indexer registry -- driver kinds listed below; default endpoints are fetched at startup from the librarr-sources companion repo and overrideable at runtime via LIBRARR_SOURCES_URL / LIBRARR_SOURCES_PATH
  • Confidence scoring -- 0-100 score with breakdown (title match, author match, format, seeders, file size)
  • Quality profiles -- define format ranking and preferred attributes, auto-upgrade existing downloads
  • Release profiles -- preferred and excluded words for fine-grained filtering
  • Blocklist -- failed downloads are auto-blocked to prevent retries; manual entries supported

Download Management

  • Multiple download clients -- qBittorrent or Transmission for torrents, plus SABnzbd for Usenet
  • Request/approval workflow -- pending, approved, searching, downloading, completed states with per-request notifications
  • Scheduled wishlist searches -- background scheduler auto-searches and downloads wishlist items on a configurable interval
  • Torrent completion watcher -- polls download client, auto-imports completed downloads
  • Dead letter retry -- failed jobs can be retried individually or in bulk

Library Management

  • Auto-import pipeline -- organize files by author/title, rename on import (configurable pattern), scan into Calibre/Audiobookshelf/Kavita/Komga
  • Series auto-complete -- detect gaps in series, search for and download missing books
  • Author monitoring -- follow authors, periodically check for new releases, auto-notify
  • Reading history -- track what you've read with stats (books per month, pages, completion rate)
  • Tags -- organize library items with custom tags for filtering and grouping
  • Series grouping -- groups related books/volumes in the library view
  • EPUB verification -- checks title word overlap to detect wrong-book downloads

Notifications and Webhooks

  • In-app notifications -- persistent alerts for downloads, requests, failures, and author releases
  • Discord webhooks -- rich embeds for download events, request updates, and errors
  • Generic webhooks -- JSON payloads for any webhook-compatible service
  • Configurable events -- choose which events trigger notifications

Import and Export

  • Goodreads CSV import -- import your shelves, auto-download "to-read" books
  • StoryGraph CSV import -- import your reading list
  • Library export -- JSON and CSV export for library, wishlist, and requests
  • Backup and restore -- full database backup with one-click restore

APIs and Integrations

  • Torznab/Newznab API at /torznab/api -- add as indexer in Prowlarr, Readarr, or any compatible app
  • OPDS 1.2 feed at /opds -- browse and download from e-readers (KOReader, Moon+ Reader, Librera)
  • Prometheus metrics at /metrics -- request counts, download stats, source health, library size
  • REST API -- full JSON API for all operations (see API section below)

Security and Multi-User

  • Multi-user auth -- session login with bcrypt passwords and admin/user roles
  • TOTP 2FA -- RFC 6238 time-based one-time passwords with QR code setup
  • OIDC / SSO -- OpenID Connect for Authelia, Keycloak, Authentik, and others
  • API key auth -- X-Api-Key header or ?apikey= parameter for programmatic access
  • Rate limiting -- per-endpoint rate limits with configurable thresholds
  • Security headers -- X-Content-Type-Options, X-Frame-Options, CORS, request size limits

UI and Admin

  • Modern dark UI -- Tailwind CSS, mobile-responsive, single-page app
  • Admin dashboard -- library stats, source health, activity log, system info
  • Bulk operations -- retry or cancel multiple downloads at once
  • File uploads -- drag and drop ebooks/audiobooks, auto-organize and library scan
  • Connection tests -- verify Prowlarr, qBittorrent, SABnzbd, Audiobookshelf, Kavita connectivity

Deployment

  • Single static binary -- ~17MB, zero CGO, pure-Go SQLite (modernc.org/sqlite)
  • Docker-ready -- minimal Alpine image, runs as non-root user
  • Cross-platform -- Linux, macOS, Windows; amd64, arm64, armv7

Search Sources

Librarr ships with driver implementations -- the protocols it can speak. The list of active indexers, their endpoints, mirrors, and enabled flags lives in a JSON registry, hosted in the librarr-sources companion repo and fetched at startup (similar to how Prowlarr syncs its indexer definitions). The binary itself ships no embedded registry. After the first successful fetch the registry is cached on disk so subsequent restarts work offline. To use a different registry, set LIBRARR_SOURCES_URL (another HTTP source) or LIBRARR_SOURCES_PATH (a local file).

Driver Used for
Torznab / Newznab Prowlarr-managed indexers (any Torznab-compatible source)
OPDS 1.2 catalogs Library, archive, and OPDS-acquisition feeds
Public JSON / RSS APIs Open metadata APIs, public RSS feeds
Direct-download with MD5/key lookup Archive sites that key downloads by content hash
Authenticated forum / tracker Private trackers (user supplies credentials)
Library-card-style API Account-gated catalogs (user supplies endpoint + credentials)
Web-novel crawler (lncrawl) Web-novel sites with chapter pagination
HTML scrape with regex extractor Sites without a structured API

To add or remove a specific indexer endpoint, edit the registry -- no code changes required.

Quick Start

Docker (recommended)

services:
  librarr:
    image: ghcr.io/jeremiahm37/librarr:latest
    ports:
      - "5050:5050"
    volumes:
      - ./data:/data
      - /path/to/ebooks:/books/ebooks
      - /path/to/audiobooks:/books/audiobooks
      - /path/to/manga:/books/manga
    environment:
      - AUTH_USERNAME=admin
      - AUTH_PASSWORD=changeme
      - API_KEY=your-api-key-here
      - QB_URL=http://qbittorrent:8080
      - QB_USER=admin
      - QB_PASS=changeme
      - PROWLARR_URL=http://prowlarr:9696
      - PROWLARR_API_KEY=your-prowlarr-api-key
    restart: unless-stopped
docker compose up -d

Binary

# Download from releases
curl -LO https://github.com/JeremiahM37/librarr/releases/latest/download/librarr_linux_amd64.tar.gz
tar xzf librarr_linux_amd64.tar.gz

# Configure
export AUTH_USERNAME=admin
export AUTH_PASSWORD=changeme
export QB_URL=http://localhost:8080
# ... set other env vars as needed

# Run
./librarr

Open http://localhost:5050 in your browser.

Configuration

All configuration is via environment variables. Every variable has a sensible default.

Server

Variable Default Description
LIBRARR_PORT 5050 HTTP listen port
LIBRARR_DB_PATH /data/librarr.db SQLite database path
SETTINGS_FILE /data/settings.json Persistent settings file

Authentication

Variable Default Description
AUTH_USERNAME Login username (enables session auth)
AUTH_PASSWORD Login password
API_KEY API key for programmatic access (X-Api-Key header or ?apikey= param)

OIDC / SSO

Variable Default Description
OIDC_ENABLED false Enable OpenID Connect login
OIDC_PROVIDER_NAME SSO Button label on login page
OIDC_ISSUER OIDC issuer URL
OIDC_CLIENT_ID OAuth2 client ID
OIDC_CLIENT_SECRET OAuth2 client secret
OIDC_REDIRECT_URI Callback URL (https://librarr.example.com/auth/oidc/callback)
OIDC_AUTO_CREATE_USERS true Auto-create users on first OIDC login
OIDC_DEFAULT_ROLE user Default role for OIDC-created users
OIDC_PROXY_HEADERS_ENABLED false Trust Authentik identity headers from a reverse proxy

When OIDC_PROXY_HEADERS_ENABLED=true and Librarr sits behind a trusted reverse proxy that injects Authentik headers like X-Authentik-Username, it will treat those requests as an authenticated SSO session, auto-provision the local user if needed, and skip the manual "Login with SSO" click. Enable this only for proxy-gated deployments. Local logout only clears Librarr's session cookie; if the proxy keeps sending the identity header, the next request will sign the browser back in.

Download Clients

Librarr sends torrents to either qBittorrent or Transmission. Configure one, or configure both and choose with TORRENT_CLIENT. The category/save-path settings below apply to both (Transmission uses the category as a torrent label, which requires Transmission 3.0+).

Variable Default Description
TORRENT_CLIENT Active torrent backend when both are configured: empty (auto, qBittorrent preferred), qbittorrent, or transmission
QB_URL qBittorrent Web UI URL
QB_USER admin qBittorrent username
QB_PASS qBittorrent password
QB_SAVE_PATH /downloads Ebook download path (inside qBit container)
QB_CATEGORY librarr Torrent category for ebooks
QB_AUDIOBOOK_SAVE_PATH /audiobooks-incoming Audiobook download path
QB_AUDIOBOOK_CATEGORY audiobooks Torrent category for audiobooks
QB_MANGA_SAVE_PATH /manga-incoming Manga download path
QB_MANGA_CATEGORY manga Torrent category for manga
QB_PRIORITY 1 Download client priority (lower = preferred)
REMOVE_TORRENT_AFTER_IMPORT true Remove torrent from the torrent client after a successful import. Set to false to keep seeding (required for private trackers with seed-time minimums).
TRANSMISSION_URL Transmission RPC URL (e.g. http://transmission:9091)
TRANSMISSION_USER Transmission RPC username (optional — only if RPC auth is enabled)
TRANSMISSION_PASS Transmission RPC password (optional)
SABNZBD_URL SABnzbd URL
SABNZBD_API_KEY SABnzbd API key
SABNZBD_CATEGORY librarr NZB download category
SAB_PRIORITY 2 Download client priority

Prowlarr

Variable Default Description
PROWLARR_URL Prowlarr URL
PROWLARR_API_KEY Prowlarr API key

Library Imports

Variable Default Description
CALIBRE_LIBRARY_PATH Path to Calibre library (auto-import via calibredb)
CALIBRE_URL Calibre-Web URL
KAVITA_URL Kavita server URL
KAVITA_USER Kavita username
KAVITA_PASS Kavita password
KAVITA_LIBRARY_PATH Kavita ebook library path
KAVITA_MANGA_LIBRARY_PATH Kavita manga library path
KAVITA_PUBLIC_URL Kavita URL for external links
ABS_URL Audiobookshelf server URL
ABS_TOKEN Audiobookshelf API token
ABS_LIBRARY_ID Audiobookshelf audiobook library ID
ABS_EBOOK_LIBRARY_ID Audiobookshelf ebook library ID
ABS_PUBLIC_URL Audiobookshelf URL for external links
KOMGA_URL Komga server URL
KOMGA_USER Komga username
KOMGA_PASS Komga password
KOMGA_LIBRARY_ID Komga library ID
KOMGA_LIBRARY_PATH Komga library path

File Organization

Variable Default Description
FILE_ORG_ENABLED true Auto-organize downloaded files
EBOOK_DIR /books/ebooks Organized ebook destination
AUDIOBOOK_DIR /books/audiobooks Org

Extension points exported contracts — how you extend this code

Searcher (Interface)
Searcher is the interface that all search sources implement. [15 implementers]
internal/search/searcher.go
TorrentClient (Interface)
TorrentClient is the common interface implemented by every torrent download backend (qBittorrent, Transmission). The res [2 …
internal/download/torrentclient.go
SourceFactory (FuncType)
SourceFactory is a function that creates a Searcher from config and HTTP client.
internal/search/registry.go

Core symbols most depended-on inside this repo

writeJSON
called by 421
internal/api/health.go
Error
called by 338
internal/download/direct.go
Run
called by 241
internal/scheduler/scheduler.go
Close
called by 223
internal/db/db.go
Get
called by 104
internal/api/auth.go
WriteHeader
called by 72
internal/api/router.go
getEnv
called by 69
internal/config/config.go
requireAdmin
called by 52
internal/api/auth.go

Shape

Function 564
Method 561
Struct 171
FuncType 2
Interface 2
TypeAlias 2

Languages

Go100%

Modules by API surface

internal/db/db.go116 symbols
internal/download/direct.go32 symbols
internal/config/config.go28 symbols
internal/api/auth.go28 symbols
internal/search/webnovel.go24 symbols
internal/search/searcher.go21 symbols
internal/download/manager.go20 symbols
internal/organize/targets.go19 symbols
internal/download/qbittorrent_test.go18 symbols
internal/download/qbittorrent.go18 symbols
internal/db/db_test.go18 symbols
internal/api/download.go18 symbols

For agents

$ claude mcp add librarr \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page