rqbit logo

rqbit

Community
philogicae

Python wrapper & MCP server for rqbit

Publisherphilogicae
Repositoryrqbit-mcp
LanguagePython
Forks
1
Stars
3
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    rqbit exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    3 stars and 1 forks from the linked repository.

Python API Wrapper & MCP Server for rqbit

uv Python PyPI Actions status License: MIT Ask DeepWiki

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 format username: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 or false).
    • 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.

  1. Install the package from PyPI:
bash
pip install rqbit-mcp
  1. Create a .env file in the directory where you'll run the application and add your rqbit URL:
env
RQBIT_URL=http://localhost:3030
  1. Run the MCP server (default: stdio):
bash
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:
bash
git clone https://github.com/philogicae/rqbit-mcp.git
cd rqbit-mcp
  1. Install dependencies using uv:
bash
uv sync --locked
  1. Create your configuration file by copying the example and add your settings:
bash
cp .env.example .env
  1. Run the MCP server (default: stdio):
bash
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):
bash
git clone https://github.com/philogicae/rqbit-mcp.git
cd rqbit-mcp
  1. Create your configuration file by copying the example and add your settings:
bash
cp .env.example .env
  1. Build and run the container using Docker Compose (default port: 8000):
bash
docker compose up --build -d
  1. Access container logs:
bash
docker logs rqbit-mcp -f

Usage

As Python API Wrapper

python
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:
        # Download a torrent
        magnet_link = "magnet:?xt=urn:btih:..."
        torrent = await client.download_torrent(magnet_link)
        print(torrent)

        # Check status
        status = await client.get_torrent_stats(torrent["id"])
        print(status)

        # List torrents
        torrents = await client.list_torrents()
        print(torrents)

if __name__ == "__main__":
    asyncio.run(main())

As MCP Server

python
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.
  • 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:

json
{
  "mcpServers": {
    ...
    # with stdio (only requires uv)
    "rqbit-mcp": {
      "command": "uvx",
      "args": [ "rqbit-mcp" ],
      "env": { 
        "RQBIT_URL": "http://localhost:3030", # (Optional) Default rqbit instance URL
        "RQBIT_HTTP_BASIC_AUTH_USERPASS": "username:password" # (Optional) Only if setup in rqbit instance
      }
    },
    # with docker (only requires docker)
    "rqbit-mcp": {
      "command": "docker",
      "args": [ "run", "-i", "-p", "8000:8000", "-e", "RQBIT_URL=http://localhost:3030", "-e", "RQBIT_HTTP_BASIC_AUTH_USERPASS=username:password", "philogicae/rqbit-mcp:latest", "rqbit-mcp" ]
    },
    # with sse transport (requires installation)
    "rqbit-mcp": {
      "serverUrl": "http://127.0.0.1:8000/sse"
    },
    # with streamable-http transport (requires installation)
    "rqbit-mcp": {
      "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.

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "rqbit-mcp": {
      "command": "uvx",
      "args": [
        "rqbit-mcp"
      ],
      "env": {
        "RQBIT_URL": "http://localhost:3030",
        "RQBIT_HTTP_BASIC_AUTH_USERPASS": "username:password"
      }
    }
  }
}

Use rqbit MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once rqbit is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add rqbit as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the rqbit MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "rqbit": {
      "command": "npx",
      "args": [
        "-y",
        "rqbit-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the rqbit MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the rqbit MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use rqbit to help me with this task?
rqbit
Sure. I read it.
Here is what I found using rqbit.

Frequently asked questions

What is the rqbit MCP server used for?

rqbit is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use rqbit MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use rqbit with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use rqbit MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With rqbit connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect rqbit MCP to TypingMind?

rqbit runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does rqbit MCP provide in TypingMind?

rqbit exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use rqbit MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If rqbit requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇