Skip to main content
Glama

rqbit Torrent Client MCP

MIT License

Python API Wrapper & MCP Server for rqbit

This repository provides a Python API wrapper and an MCP (Model Context Protocol) server for the rqbit torrent client. It allows for easy integration into other applications or services.

Table of Contents

Features

  • API wrapper for the rqbit torrent client.
  • MCP server interface for standardized communication (stdio, sse, streamable-http)
  • Tools:
    • list_torrents: List all torrents and their details.
    • add_torrent: Add a torrent from a magnet link or a file.
    • get_torrent_details: Get detailed information about a specific torrent.
    • pause_torrent: Pause a torrent.
    • start_torrent: Start a torrent.
    • forget_torrent: Remove a torrent from the list.

Setup

Prerequisites

  • An running instance of rqbit.
  • Python 3.10+ (required for PyPI install).
  • uv (for local development)

Configuration

This application requires the URL of your rqbit instance.

Set Environment Variable: The application reads the URL from the RQBIT_URL environment variable. The recommended way to set this is by creating a .env file in your project's root directory. The application will load it automatically.

RQBIT_URL=http://localhost:3030

Installation

Choose one of the following installation methods.

This method is best for using the package as a library or running the server without modifying the code.

  1. Install the package from PyPI:
pip install rqbit-mcp
  1. Create a .env file in the directory where you'll run the application and add your rqbit URL:
RQBIT_URL=http://localhost:3030
  1. Run the MCP server (with stdio):
python -m rqbit_client
For Local Development

This method is for contributors who want to modify the source code. Using uv:

  1. Clone the repository:
git clone https://github.com/philogicae/rqbit-mcp.git cd rqbit-mcp
  1. Install dependencies using uv:
uv sync
  1. Create your configuration file by copying the example and add your rqbit URL:
cp .env.example .env
  1. Run the MCP server (stdio):
uv run -m rqbit_client
For Docker

This method uses Docker to run the server in a container. compose.yaml includes rqbit torrent client.

  1. Clone the repository (if you haven't already):
git clone https://github.com/philogicae/rqbit-mcp.git cd rqbit-mcp
  1. Create your configuration file by copying the example and add your rqbit URL:
cp .env.example .env
  1. Build and run the container using Docker Compose (default port: 8765):
docker-compose -f docker/compose.yaml up --build [-d]

Usage

As Python API Wrapper

import asyncio from rqbit_client.wrapper import RqbitClient async def main(): # Read the RQBIT_URL from the .env file or fallback to default (http://localhost:3030) async with RqbitClient() as client: # List torrents torrents = await client.list_torrents() print(torrents) # Add a torrent magnet_link = "magnet:?xt=urn:btih:..." new_torrent = await client.add_torrent(magnet_link) print(new_torrent) if __name__ == "__main__": asyncio.run(main())

As MCP Server

from rqbit_client import RqbitMCP RqbitMCP.run(transport="sse") # 'stdio', 'sse', or 'streamable-http'

Via MCP Clients

Usable with any MCP-compatible client. Available tools:

  • list_torrents: List all torrents.
  • add_torrent: Add a torrent via magnet link or file path.
  • get_torrent_details: Get details of a specific torrent.
  • pause_torrent: Pause a torrent.
  • start_torrent: Start a torrent.
  • forget_torrent: Forget a torrent.
Example with Windsurf

Configuration:

{ "mcpServers": { ... # with stdio (only requires uv) "mcp-rqbit": { "command": "uvx", "args": [ "rqbit-mcp" ], "env": { "RQBIT_URL": "http://localhost:3030" } # Default rqbit URL }, # with sse transport (requires installation) "mcp-rqbit": { "serverUrl": "http://127.0.0.1:8000/sse" }, # with streamable-http transport (requires installation) "mcp-rqbit": { "serverUrl": "http://127.0.0.1:8000/mcp" }, ... } }

Changelog

See CHANGELOG.md for a history of changes to this project.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Related MCP Servers

  • -
    security
    A
    license
    -
    quality
    Geocoding MCP server with GeoPY!
    Last updated -
    6
    Python
    MIT License
  • -
    security
    A
    license
    -
    quality
    A Python-based MCP server that integrates OpenAPI-described REST APIs into MCP workflows, enabling dynamic exposure of API endpoints as MCP tools.
    Last updated -
    2
    39
    Python
    MIT License
    • Linux
    • Apple
  • A
    security
    A
    license
    A
    quality
    A server that provides a persistent Python REPL environment through the MCP protocol, allowing execution of Python code, variable management, and package installation.
    Last updated -
    3
    3
    Python
    MIT License
  • -
    security
    F
    license
    -
    quality
    A Python-based server that helps users easily install and configure other MCP servers across different platforms.
    Last updated -
    2
    Python
    • Apple
    • Linux

View all related MCP servers

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/philogicae/rqbit-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server