The rqbit Torrent Client MCP server provides a Python API wrapper for managing torrents using the rqbit client. With this server, you can:
- List all torrents and their details
- Add a torrent using a magnet link
- Get detailed information about a specific torrent by ID or infohash
- Delete a torrent and its associated files
- Start (resume) a paused torrent
- Pause an active torrent
- Forget/remove a torrent from the list while keeping the downloaded files
Provides containerization for the MCP server with Docker Compose support, including integration with the rqbit torrent client in the same container setup.
Reads configuration from .env files, allowing users to set the RQBIT_URL for connecting to the rqbit torrent client instance.
Hosts the project repository with CI workflows for package testing and validation.
Distributes the rqbit-mcp package through PyPI, enabling easy installation via pip.
Provides a Python API wrapper for the rqbit torrent client, allowing direct integration in Python applications.
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.download_torrent
: Download a torrent from a magnet link or a file.get_torrent_details
: Get detailed information about a specific torrent.get_torrent_stats
: Get stats/status of a specific torrent.pause_torrent
: Pause a torrent.start_torrent
: Start a torrent.forget_torrent
: Forget a torrent, keeping the files.delete_torrent
: Delete a torrent and its files.
Setup
Prerequisites
- An running instance of rqbit. (Included in docker compose)
- Python 3.10+ (required for PyPI install).
uv
(for local development)
Configuration
This application requires the URL of your rqbit
instance.
Set Environment Variable: Copy .env.example
to .env
in your project's root directory and edit it with your settings. The application will automatically load variables from .env
:
- MCP Server:
RQBIT_URL
: The URL of the rqbit instance (Default:http://localhost:3030
).RQBIT_HTTP_BASIC_AUTH_USERPASS
: If setup in rqbit instance.
- Rqbit Instance:
RQBIT_HTTP_BASIC_AUTH_USERPASS
: The username and password for basic authentication, in the formatusername:password
.RQBIT_HTTP_API_LISTEN_ADDR
: The listen address for the HTTP API (e.g.,0.0.0.0:3030
).RQBIT_UPNP_SERVER_ENABLE
: Enables or disables the UPnP server (e.g.,true
orfalse
).RQBIT_UPNP_SERVER_FRIENDLY_NAME
: The friendly name for the UPnP server (e.g.,rqbit-media
).RQBIT_EXPERIMENTAL_UTP_LISTEN_ENABLE
: Enables or disables the uTP listener (Default:false
).- Check rqbit for other variables and more information.
Installation
Choose one of the following installation methods.
Install from PyPI (Recommended)
This method is best for using the package as a library or running the server without modifying the code.
- Install the package from PyPI:
- Create a
.env
file in the directory where you'll run the application and add yourrqbit
URL:
- Run the MCP server (default: stdio):
For Local Development
This method is for contributors who want to modify the source code.
Using uv
:
- Clone the repository:
- Install dependencies using
uv
:
- Create your configuration file by copying the example and add your settings:
- Run the MCP server (default: stdio):
For Docker
This method uses Docker to run the server in a container. compose.yaml includes rqbit torrent client.
- Clone the repository (if you haven't already):
- Create your configuration file by copying the example and add your settings:
- Build and run the container using Docker Compose (default port: 8000):
- Access container logs:
Usage
As Python API Wrapper
As MCP Server
Via MCP Clients
Usable with any MCP-compatible client. Available tools:
list_torrents
: List all torrents.download_torrent
: Download a torrent via magnet link or file path.get_torrent_details
: Get details of a specific torrent.get_torrent_stats
: Get stats/status of a specific torrent.pause_torrent
: Pause a torrent.start_torrent
: Start a torrent.forget_torrent
: Forget a torrent, keeping the files.delete_torrent
: Delete a torrent and its files.
Example with Windsurf
Configuration:
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.
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
Python wrapper & MCP server for the rqbit API
Related Resources
Related MCP Servers
- PythonMIT License
- -securityAlicense-qualityA Python-based MCP server that integrates OpenAPI-described REST APIs into MCP workflows, enabling dynamic exposure of API endpoints as MCP tools.Last updated -239PythonMIT License
- AsecurityAlicenseAqualityA server that provides a persistent Python REPL environment through the MCP protocol, allowing execution of Python code, variable management, and package installation.Last updated -33PythonMIT License
- -securityFlicense-qualityA Python-based server that helps users easily install and configure other MCP servers across different platforms.Last updated -2Python