Skip to main content
Glama
Lqueed

rutracker_mcp

by Lqueed

rutracker_mcp

MCP server for RuTracker — search for torrents and download .torrent files directly from Claude (Desktop / Code / API) and any MCP-compatible clients.

⚠️ This is a fork. Based on CarrySauce/rutracker-mcp-server (which is itself a fork of notnooblord/rutracker-mcp-server), built on FastMCP + py-rutracker-client. The original MCP server (server.py) and toolset are preserved unchanged. The fork adds blocking bypass for access from Russia.

Why this fork

The original logs in with a plain POST to login.php. Under Russian conditions this doesn't work:

  1. Cloudflare Managed Challenge. RuTracker is protected by Cloudflare's anti-bot check; a plain HTTP client (aiohttp) can't pass it and gets a 403.

  2. RKN blocking + cf_clearance tied to IP. The site is blocked by Russian ISPs, and the Cloudflare token is tied to the IP and User-Agent.

What's been added

File

Purpose

cookie_auth.py

CookieRuTrackerClient: login via cookie (bypasses Cloudflare) + socket bind to VPN adapter (forces traffic through VPN instead of the Russian ISP)

get_cookies_pr.py

Cookie harvesting (bb_session + cf_clearance) via real Chrome under patchright — a stealth browser that passes Cloudflare on a clean VPN IP

test_cookie.py

Tests "cookie login + search"

More details in docs/USER_GUIDE_RU.md (for humans) and AGENTS.md (for AI agents).

Related MCP server: RuTracker MCP Server

How it works

get_cookies_pr.py  --(patchright + настоящий Chrome через VPN)-->  проходит Cloudflare, логинится
                   --> cookies.json (bb_session, cf_clearance, User-Agent)

server.py (MCP) --> CookieRuTrackerClient:
                    • вливает cookies.json в aiohttp-сессию (без login.php)
                    • биндит сокет к IP TAP-адаптера VPN (тот же IP, что у Chrome)
                    • тот же User-Agent -> cf_clearance валиден

Requirements

  • Python 3.13+

  • RuTracker account

  • VPN with a TAP adapter (tested on ZoogVPN). Mandatory from Russia.

  • Google Chrome (for cookie harvesting via patchright)

Quick start

git clone https://github.com/Lqueed/rutracker_mcp.git
cd rutracker_mcp
python -m venv .venv
.venv/Scripts/python -m pip install -r requirements.txt
.venv/Scripts/python -m pip install patchright psutil
.venv/Scripts/python -m patchright install chromium

cp .env.example .env          # вписать RUTRACKER_LOGIN и RUTRACKER_PASSWORD
# включить VPN, затем добыть cookie:
.venv/Scripts/python get_cookies_pr.py
# проверить:
.venv/Scripts/python test_cookie.py     # -> "УСПЕХ: получено результатов: N"

Connecting to Claude Code

claude mcp add rutracker --scope user \
  --env HTTP_PROXY= --env HTTPS_PROXY= \
  -- /abs/path/.venv/Scripts/python.exe /abs/path/server.py --transport stdio

Empty HTTP_PROXY/HTTPS_PROXY — so that python doesn't go through a possible system proxy.

MCP tools

Tool

Description

search_torrents

Keyword search on a page (50 results), with magnet links

search_all_pages

Parallel search across multiple pages

get_torrent_info

Full torrent description (quality, codec, post text, magnet)

download_torrent

Download .torrent by topic_id (MCP attachment)

get_topic_url

Topic URL and direct download URL by topic_id

The server only serves .torrent files and magnet links, not the content itself — use a BitTorrent client (qBittorrent, Transmission) for downloading.

VPN bind configuration

The client automatically looks for an adapter whose name contains zoog. Override with:

  • RUTRACKER_VPN_ADAPTER — adapter name substring (default zoog);

  • RUTRACKER_BIND_IP — explicit IP for socket binding.

If neither is set and no adapter is found — binding is disabled (python will use the normal route).

Security

.env, cookies.json, .chrome-profile/ contain credentials/session and are excluded from git (.gitignore). Don't commit them.

Credits / license

Original MCP server and library — CarrySauce, notnooblord. License is inherited from the original project.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    B
    maintenance
    Allows users to search and browse torrents on rutracker.org, retrieving detailed metadata including magnet links and file lists. It automatically handles authentication by extracting session cookies from the Brave browser on macOS.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables searching and downloading torrents from YggTorrent via MCP tools such as search_torrents, get_torrent_details, get_magnet_link, and download_torrent_file.
    MIT
  • A
    license
    B
    quality
    B
    maintenance
    MCP server for rTorrent BitTorrent automation, enabling torrent management (add/list/pause/delete), multi-source searching (Nyaa, Pirate Bay, etc.), and post-processing workflows via natural language.
    7
    1
    MIT