Skip to main content
Glama

mcp-rtorrent

Publishing to the MCP Registry

This server is registered as io.github.je-bin/mcp-rtorrent in the MCP Registry. server.json holds the registry metadata, and the mcp-name marker above is what the registry checks to prove ownership of the published package.

To publish a new version:

  1. Create the package on PyPI and configure Trusted Publishing for this repository and the publish-mcp.yml workflow.

  2. Bump the version in pyproject.toml (or server.json) and tag the release (git tag vX.Y.Z).

  3. Push the tag: the workflow publishes to PyPI and then to the MCP Registry.

An MCP (Model Context Protocol) server that exposes an rtbit client — the Rust BitTorrent client used in my homelab — to AI assistants over stdio.

The server speaks to the rtbit HTTP API (v7) and turns its REST routes into 10 MCP tools: list torrents, read their progress and peers, pause, resume, and add a magnet link. Deleting a torrent is deliberately not exposed.

Related MCP server: qBittorrent MCP Server

Features

Tool

What it does

rtbit_global_stats

Global client statistics: download/upload speed, live peers, counters, uptime

rtbit_list_torrents

List torrents, optionally filtered by name, category or state

rtbit_get_torrent

Full detail of one torrent (metadata, tags, trackers, output folder)

rtbit_torrent_stats

Progress of one torrent: bytes downloaded, percentage, state

rtbit_peer_stats

Peers connected to a torrent: address, client, progress, speed

rtbit_torrent_files

Files contained in a torrent, with their size

rtbit_limits

Download limits configured in the client (speed, slots, peers)

rtbit_pause

Pause a torrent

rtbit_start

Resume a torrent

rtbit_add_magnet

Add a torrent from a magnet link or a .torrent URL

Torrents can be addressed either by their numeric id or by their info hash.

Requirements

  • Python 3.10+

  • mcp 2.3.0 or later (provides mcp.server.mcpserver.MCPServer)

  • A reachable rtbit instance with its HTTP API enabled, and an API key (rtb_...)

Installation

git clone https://github.com/Je-Bin/mcp-rtorrent.git
cd mcp-rtorrent
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt

Configuration

Everything is configured through environment variables:

Variable

Required

Default

Description

RTBIT_URL

recommended

http://192.0.2.10:3030

Base URL of the rtbit HTTP API. The default is a documentation address — point it at your own instance.

RTBIT_API_KEY

yes

(empty)

The rtbit API key (rtb_...). If it is missing, every tool returns an explicit configuration error instead of sending an unauthenticated request.

The key is only ever read from the environment: it is never written to disk, never logged and never passed on the command line.

Example MCP client configuration

{
  "mcpServers": {
    "rtorrent": {
      "command": "/path/to/mcp-rtorrent/.venv/bin/python",
      "args": ["/path/to/mcp-rtorrent/server.py"],
      "env": {
        "RTBIT_URL": "http://192.0.2.10:3030",
        "RTBIT_API_KEY": "rtb_..."
      }
    }
  }
}

Running it manually

RTBIT_URL=http://192.0.2.10:3030 RTBIT_API_KEY=rtb_... python server.py

The server speaks MCP over stdio, so it stays silent until a client talks to it.

Tools in action

A typical conversation looks like this:

You: which torrents are still downloading?
Assistant: (calls rtbit_list_torrents with state="downloading")
{
  "tool": "rtbit_list_torrents",
  "arguments": { "state": "downloading", "limit": 20 }
}
{
  "total_torrents": 128,
  "matches": 3,
  "returned": 3,
  "torrents": [
    {
      "id": 412,
      "name": "example-linux-iso",
      "category": "isos",
      "tags": ["linux"],
      "state": "downloading",
      "progress_pct": 63.4,
      "total_size": "2.1 GiB",
      "finished": false
    }
  ]
}

Other examples:

{ "tool": "rtbit_global_stats", "arguments": {} }
{ "tool": "rtbit_get_torrent", "arguments": { "torrent_id": "412" } }
{ "tool": "rtbit_peer_stats", "arguments": { "torrent_id": "412", "state": "downloading" } }
{ "tool": "rtbit_pause", "arguments": { "torrent_id": "412" } }
{ "tool": "rtbit_start", "arguments": { "torrent_id": "412" } }
{
  "tool": "rtbit_add_magnet",
  "arguments": {
    "magnet_uri": "magnet:?xt=urn:btih:0123456789abcdef0123456789abcdef01234567",
    "output_folder": "/downloads/isos",
    "paused": true
  }
}

Helper script

scripts/rtbit_bulk_start.py resumes every paused torrent in one go (finished torrents are skipped). It is a plain CLI, not an MCP tool:

RTBIT_URL=http://192.0.2.10:3030 RTBIT_API_KEY=rtb_... \
    python scripts/rtbit_bulk_start.py --all --dry-run

Security

  • No deletion tool. The rtbit API can delete torrents and their data; this server does not expose that route. An assistant can add, pause and resume, but never erase.

  • Least privilege. Point RTBIT_API_KEY at a key scoped to the operations you allow, and keep the rtbit API bound to the local network or behind a reverse proxy.

  • Secrets stay in the environment. The API key is read from RTBIT_API_KEY only. It is never written to disk, echoed in tool output, or included in a command line. If the variable is unset or empty, the tools return a clear configuration error instead of calling the API.

  • Local transport. The server communicates over stdio with the MCP client, so no listening socket is opened on your network.

  • No arbitrary code execution. The server only talks to the rtbit HTTP API; it never runs shell commands and never touches the file system.

License

MIT — see LICENSE.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides tools for interacting with the Transmission BitTorrent client via natural language, enabling users to manage torrents, configure download settings, and monitor download activity.
      4
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      Enables interaction with qBittorrent through its Web API to search for torrents using search plugins and manage downloads. Supports torrent searching, downloading via URLs/magnet links, and torrent management operations like pause, resume, and delete.
      7
      3
      -
    • 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
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables an agent to submit magnet links to a Transmission daemon and monitor their download progress, including pausing, resuming, and listing torrents with verdicts like downloading, stalled, or complete.
      MIT