Skip to main content
Glama
qbittorrent-mcp

qbittorrent-mcp

by akioruri

qbittorrent-mcp

English | 简体中文

An MCP server that manages torrents through the qBittorrent WebUI API. Once connected, an AI assistant can add, pause, rate-limit and rename torrents directly, and search for resources.

Features

Category

Tools

Torrent management

add_torrent, delete_torrent, pause_torrent, resume_torrent, get_torrent_list

Torrent details

get_torrent_trackers, add_trackers_to_torrent, add_torrent_tags

File management

get_torrent_files, rename_torrent, rename_torrent_file, rename_torrent_folder, batch_rename

File priority

set_file_priority

Speed limits

set_global_download_limit, set_global_upload_limit, set_torrent_download_limit, set_torrent_upload_limit

Search and info

search_torrents, get_application_version

Related MCP server: qBittorrent MCP Server

Requirements

  • Python 3.14 or later

  • uv

  • qBittorrent with the WebUI enabled, reachable from the machine running this server

  • For search_torrents, a search plugin enabled in qBittorrent

Installation

git clone <repository-url>
cd qbittorrent-mcp
uv sync

Configuration

Set the following environment variables, for example in your shell profile or in the MCP client's env configuration:

export QBITTORRENT_HOST=http://127.0.0.1:8080
export QBITTORRENT_USERNAME=admin
export QBITTORRENT_PASSWORD=adminadmin

Variable

Description

Default

QBITTORRENT_HOST

WebUI address, including protocol and port

http://127.0.0.1:8080

QBITTORRENT_USERNAME

WebUI username

admin

QBITTORRENT_PASSWORD

WebUI password

adminadmin

If a variable is not set, the default shown above is used.

Running

The server uses the stdio transport and is normally launched by an MCP client, so you do not need to run it manually. For a local check:

uv run qbittorrent-mcp

Connecting an MCP client

Example using the mcpServers configuration format (such as Claude Desktop):

{
  "mcpServers": {
    "qbittorrent": {
      "command": "/absolute/path/to/qbittorrent-mcp/.venv/bin/qbittorrent-mcp"
    }
  }
}

Replace the path with the absolute path to this project's .venv/bin/qbittorrent-mcp (run uv sync first to create it). To pass credentials, add an env block to the server entry:

{
  "mcpServers": {
    "qbittorrent": {
      "command": "/absolute/path/to/qbittorrent-mcp/.venv/bin/qbittorrent-mcp",
      "env": {
        "QBITTORRENT_HOST": "http://127.0.0.1:8080",
        "QBITTORRENT_USERNAME": "admin",
        "QBITTORRENT_PASSWORD": "adminadmin"
      }
    }
  }
}

Usage examples

Describe what you need in natural language, for example:

  • "List all torrents that are downloading"

  • "Pause the torrent with hash xxx"

  • "Set the global upload limit to 1 MB/s"

  • "Show the files of a torrent and rename the first one to movie.mkv"

  • "Search for Ubuntu 24.04 and list the results with the most seeders"

Notes

  • delete_torrent with delete_files=True permanently deletes downloaded files, and hashes set to all deletes every torrent. Double-check before running.

  • The old_path of rename_torrent_file must exactly match the file's relative path inside the torrent, including directories. Use get_torrent_files to get it.

  • rename_torrent_folder renames a folder inside a torrent and requires qBittorrent v4.4.0 or later. old_path must be an existing folder path relative to the torrent root.

  • batch_rename takes a JSON array of {old_path, new_path, type} items (type is file or folder, defaults to file) and executes them sequentially in the given order. Renaming a folder changes the paths of everything inside it, so order operations accordingly. A failed item does not stop the rest.

  • search_torrents filters out results larger than max_size_gb (default 5 GB) and returns the top 10 by seeders.

  • Speed limits are in bytes per second.

  • Tool errors are returned to the client as strings and do not stop the server.

Project structure

src/qbittorrent_mcp/
├── api.py     # Async functions that call the qBittorrent WebUI API
└── mcp.py     # MCP server and tool registration; entry point is main()

License

See LICENSE.

Available Tools

20 tools
add_torrentB

Add torrent files to qBittorrent

Args: query: Query string containing torrent file path, supports the following formats: 1. JSON string: "{"file_paths": ["path/to/file1.torrent", "path/to/file2.torrent"]}" 2. JSON string: "["path/to/file1.torrent", "path/to/file2.torrent"]" 3. Single file path: "path/to/file.torrent"

Returns: Status and message of the add operation

Inputs: query (required). Returns: result

add_torrent_tagsB

Add torrent tags

Args: hash: Torrent hash value tags: Tag list, multiple tags separated by comma

Returns: Result message of adding torrent tags

Inputs: hash (required), tags (required). Returns: result

add_trackers_to_torrentC

Add trackers to torrent

Args: hash: Torrent hash value trackers: Tracker URL, multiple URLs separated by %0A

Returns: Result message of adding trackers

Inputs: hash (required), trackers (required). Returns: result

batch_renameA

Rename multiple files and folders inside a torrent in one batch

Args: hash: Torrent hash value renames: JSON array of rename operations, executed sequentially in the given order. Each item: {"old_path": "current/path", "new_path": "new/path", "type": "file" or "folder"} "type" is optional and defaults to "file". Note: renaming a folder changes the paths of everything inside it, so order the operations accordingly.

Returns: Summary with per-item results; a failed item does not stop the rest

Inputs: hash (required), renames (required). Returns: result

delete_torrentB

Delete torrents from qBittorrent

Args: hashes: Torrent hash values to delete, multiple hashes separated by |, or use 'all' to delete all torrents delete_files: If True, also delete downloaded files

Returns: Result message of delete operation

Inputs: hashes (required), delete_files. Returns: result

get_application_versionA

Get qBittorrent version

Returns: qBittorrent version

Inputs: no named parameters. Returns: result

get_torrent_filesA

List files inside a torrent

Args: hash: Torrent hash value

Returns: Formatted list of files with index (used as id for set_file_priority), name (used as old_path for rename_torrent_file), size, progress and priority

Inputs: hash (required). Returns: result

get_torrent_listC

Get torrent list

Inputs: no named parameters. Returns: result

get_torrent_trackersC

Get torrent trackers

Args: hash: Torrent hash value

Returns: String containing tracker information

Inputs: hash (required). Returns: result

pause_torrentB

Pause torrents

Args: hashes: Torrent hash values to pause, multiple hashes separated by |, or use 'all' to pause all torrents

Returns: Result message of pause operation

Inputs: hashes (required). Returns: result

rename_torrentA

Rename a torrent (the name shown in qBittorrent)

Args: hash: Torrent hash value name: New torrent name

Returns: Result message of renaming the torrent

Inputs: hash (required), name (required). Returns: result

rename_torrent_fileB

Rename a file inside a torrent

Args: hash: Torrent hash value old_path: Current file path inside the torrent (relative to the torrent root, get it from the file list) new_path: New file path inside the torrent (relative to the torrent root, keep the same directory structure)

Returns: Result message of renaming the file

Inputs: hash (required), new_path (required), old_path (required). Returns: result

rename_torrent_folderA

Rename a folder inside a torrent (requires qBittorrent v4.4.0 or later)

Args: hash: Torrent hash value old_path: Current folder path inside the torrent (relative to the torrent root) new_path: New folder path inside the torrent (relative to the torrent root, keep the same parent directory)

Returns: Result message of renaming the folder

Inputs: hash (required), new_path (required), old_path (required). Returns: result

resume_torrentB

Resume torrents

Args: hashes: Torrent hash values to resume, multiple hashes separated by |, or use 'all' to resume all torrents

Returns: Result message of resume operation

Inputs: hashes (required). Returns: result

search_torrentsA

搜索种子

Args: pattern: 搜索关键词 category: 搜索类别 (all, movies, anime, books, tv, software等),默认为all plugins: 搜索插件 (all或特定插件),默认为all max_size_gb: 最大文件大小限制(GB),默认为5GB。结果会过滤掉大于此大小的文件

Returns: 搜索结果的JSON字符串,包含过滤和排序后的top 10结果,按种子数(nbSeeders)降序排列

Inputs: pattern (required), plugins, category, max_size_gb. Returns: result

set_file_priorityB

Set file priority

Args: hash: Torrent hash value id: correspond to file position inside the array returned by torrent contents API, e.g. id=0 for first file, id=1 for second file, etc. priority: Value Description 0 Do not download 1 Normal priority 6 High priority 7 Maximal priority

Returns: Result message of setting file priority HTTP Status Code Scenario 400 Priority is invalid 400 At least one file id is not a valid integer 404 Torrent hash was not found 409 Torrent metadata hasn't downloaded yet 409 At least one file id was not found 200 All other scenarios

Inputs: id (required), hash (required), priority (required). Returns: result

set_global_download_limitC

Set global download speed limit

Args: limit: Speed limit value, in bytes/second

Returns: Result message of setting speed limit

Inputs: limit (required). Returns: result

set_global_upload_limitC

Set global upload speed limit

Args: limit: Speed limit value, in bytes/second

Returns: Result message of setting speed limit

Inputs: limit (required). Returns: result

set_torrent_download_limitC

Set torrent download speed limit

Args: hash: Torrent hash value limit: Speed limit value, in bytes/second

Returns: Result message of setting torrent download speed limit

Inputs: hash (required), limit (required). Returns: result

set_torrent_upload_limitC

Set torrent upload speed limit

Args: hash: Torrent hash value limit: Speed limit value, in bytes/second

Returns: Result message of setting torrent upload speed limit

Inputs: hash (required), limit (required). Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 20 tools

    Disambiguation4/5

    Most tools have clearly distinct resource+action targets, and descriptions clarify the rename tiers (torrent vs file vs folder vs batch) and the four speed-limit tools. The main soft spot is get_torrent_list vs search_torrents, which sound like they both search torrents but actually hit local vs external indexers, and that distinction is buried in a Chinese-only description.

    Naming Consistency4/5

    Strong, predictable verb_noun snake_case pattern (add_torrent, delete_torrent, pause_torrent, get_torrent_files, set_torrent_download_limit). Minor deviations like add_trackers_to_torrent and the object-order get_torrent_list keep it from a perfect score but remain readable and unambiguous.

    Tool Count3/5

    20 tools sits in the borderline-heavy band for a single-client integration. There is visible granularity inflation: four speed-limit setters (global/torrent × up/down) and four rename variants where batch_rename already subsumes the file/folder cases.

    Completeness3/5

    Core lifecycle is covered (add, delete, pause, resume, list, files, trackers, tags, priority, limits, renames), so agents can do the main workflows. But there are notable gaps: no read-back for global/torrent limits, no torrent properties/info endpoint, no category management, and no removal of trackers or tags, which will dead-end common management tasks.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      A service that provides programmatic access to qBittorrent's WebUI API, enabling management of torrents, trackers, tags, speed controls, and system information through natural language.
      29
      -
    • 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
      A
      quality
      C
      maintenance
      Enables control of a qBittorrent instance via its WebUI API, supporting torrent management, category management, and transfer information with cookie-session authentication.
      14
      1
      MIT
    • A
      license
      A
      quality
      A
      maintenance
      Manage qBittorrent from your agent: eleven intent-shaped tools across multiple instances, plus a qb_diagnose that explains why nothing is uploading.
      11
      1
      Apache 2.0