qb-mcp
Integrates with the qBittorrent WebUI API v2 to manage any number of qBittorrent instances, including listing and inspecting torrents, diagnosing upload issues, pausing/resuming/reannouncing torrents, setting speed and share limits, adding or removing torrents, and assigning categories and tags.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@qb-mcp why isn't anything uploading on the seedbox?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
qb-mcp
An MCP server for qBittorrent — manage torrents with natural language.
This is an unofficial project. It is not affiliated with, endorsed by, or supported by the qBittorrent project.
English | 简体中文
Ask your agent "why isn't this torrent uploading?" and it can actually answer — tracker health, listening port, speed caps and peer supply, instead of guessing. Ask it to pause the seedbox and it knows qBittorrent 5.x renamed that endpoint.
qb-mcp wraps the qBittorrent WebUI API v2 and exposes it as eleven tools that
an AI agent can call. It manages any number of instances, each with its own
credentials, so a single agent can drive a home NAS and a remote seedbox at once.
Why this exists
qBittorrent has a complete HTTP API but no MCP interface. Wrapping it means an agent can answer "why isn't it uploading?" by actually checking tracker health, listening ports, speed limits and peer supply — instead of guessing.
The eleven tools are grouped by user intent, not by API endpoint: mapping all 80+ endpoints one-to-one would produce a tool list no model can choose from.
Related MCP server: Transmission MCP Server
Features
Multiple instances, each with independent credentials
qb_diagnose— turns "why is nothing uploading?" into one callField-trimmed responses — the API returns 30+ fields per torrent; this returns 12
Before/after reporting on every write operation
delete_filesis opt-in — removing a torrent never deletes data by defaultstdio and HTTP transports
Credentials never leave your machine; nothing is logged
Quick start
pip install qb-mcp
cp instances.example.json .instances.json
# edit .instances.json with your qBittorrent URL and credentials
chmod 600 .instances.json
qb-mcpConfiguration
qb-mcp reads .instances.json from the current directory, or the path in
QB_MCP_CONFIG.
{
"instances": {
"nas": {
"label": "Home NAS",
"url": "http://192.168.1.100:8080",
"username": "admin",
"password": "${QB_PASS_NAS}"
},
"seedbox": {
"url": "https://seedbox.example.com",
"username": "me",
"password": {"file": "~/.secrets/seedbox"}
}
}
}Field | Required | Default | Notes |
| ✅ | — | Must start with |
| ✅ | — | Per-instance; instances may use different accounts |
| ✅ | — | Literal, |
| — | key | Display name |
| — |
| Set |
| — |
| Per-request timeout in seconds |
Keep .instances.json out of version control. It is already listed in
.gitignore. qb-mcp prints a warning if the file is readable by group or others.
Tools
Read (safe)
Tool | Purpose |
| List configured instances and whether each is reachable |
| Global status for one or all instances |
| Torrent list with filtering, sorting and a row limit |
| One torrent in depth, including tracker status (tracker URLs are redacted unless |
| Explain why an instance is or is not uploading |
Write (state-changing)
Tool | Purpose |
|
|
| Global or per-torrent speed limits |
| Ratio / seeding-time / inactive-seeding-time limits (minutes) and the action taken on reaching them |
| Add from magnet, URL or a local |
| Remove torrents; |
| Assign categories and tags |
Client setup
stdio (Claude Desktop, Cursor, most local clients):
{
"mcpServers": {
"qbittorrent": {
"command": "qb-mcp",
"env": { "QB_MCP_CONFIG": "/absolute/path/to/.instances.json" }
}
}
}HTTP (remote or multi-client):
qb-mcp --transport http --host 127.0.0.1 --port 17890{
"servers": {
"qbittorrent": {
"url": "http://127.0.0.1:17890/mcp",
"transport": "streamable_http"
}
}
}Compatibility
qBittorrent | WebUI API | Status |
4.x | 2.8+ | Supported |
5.x | 2.11+ | Supported (tested on 5.2.4) |
Both official builds and third-party NAS packages (QNAP QPKG, Synology SPK) work, with the proxy quirks below already handled.
Troubleshooting
login rejected (Fails.)
qBittorrent returns HTTP 200 even when the password is wrong — the body is
Fails. instead of Ok.. qb-mcp inspects the body, so this message means the
credentials are genuinely wrong.
Login fails behind a reverse proxy
The official API requires Referer or Origin to match the request Host
exactly, including the port. qb-mcp sets both from your configured url,
so make sure url uses the same host and port you would type in a browser.
Works with curl but not through a proxy
Some reverse proxies (QNAP QTS is one) return 204 No Content with an empty
body on a successful login instead of 200 Ok.. qb-mcp treats any status
below 400 with an empty or Ok. body as success.
login blocked - too many failed attempts
qBittorrent temporarily bans an IP after repeated failures. Wait a few minutes, or check the WebUI's ban list.
Development
git clone https://github.com/zxw060810/qb-mcp.git
cd qb-mcp
pip install -e ".[dev]"
ruff check .
mypy src
pytestTests mock the qBittorrent API; no live instance is required.
License
Available Tools
11 toolsqb_addA
Add a torrent from a URL, magnet link, or a local .torrent path.
Args: instance: instance key from .instances.json. source: magnet link, http(s) URL, or absolute path to a .torrent file. savepath: target directory; empty uses the instance default. category: category to assign. paused: add in paused state (default true) so it can be reviewed first. wait_seconds: how long to wait for the torrent to show up. Magnet links ingest metadata asynchronously, so the add request returning 200 does not prove anything; the torrent must appear in the list.
Inputs: source (required), instance (required), paused, category, +2 more. Returns: result
qb_categoryAIdempotent
Move torrents into a category and/or add tags to them.
Use this to organise a library after the fact - a new download that landed in the wrong category, or a batch you want to find again later. It changes metadata only; nothing is downloaded, stopped or removed.
Tags merge, they do not replace: the values in tags are appended to
whatever the torrent already carries, and there is no call here for removing
a tag. The category is assigned as a whole, so an empty category leaves
the existing one untouched rather than clearing it.
Both fields are optional but at least one must be non-empty, otherwise the call returns an error. If the category is applied and the tag call then fails, the category change stays and the error names the failure - the operation is not rolled back.
Args: instance: instance key from .instances.json. hashes: torrent hashes to update. category: category name; empty leaves it unchanged. tags: tags to append; existing tags are kept.
Inputs: hashes (required), instance (required), tags, category. Returns: result
qb_controlBIdempotent
Change torrent state.
Args: instance: instance key from .instances.json. action: pause | resume | reannounce | force_start. hashes: torrent hashes; empty means every torrent.
Inputs: action (required), instance (required), hashes. Returns: result
qb_detailARead-onlyIdempotent
Show one torrent in depth, including tracker status.
Args: instance: instance key from .instances.json. hash: torrent hash (preferred). name: fuzzy name match, used when hash is empty. show_tracker_urls: reveal full announce URLs (they may contain a private tracker passkey - off by default so the secret never reaches the model).
Inputs: instance (required), hash, name, show_tracker_urls. Returns: result
qb_diagnoseARead-onlyIdempotent
Explain why a qBittorrent instance is (or is not) uploading.
Checks login, tracker health, listening port, peer counts, speed limits and torrent states, then states a conclusion.
Args: instance: instance key from .instances.json. hash: optional torrent hash to inspect trackers for a single torrent.
Inputs: instance (required), hash. Returns: result
qb_instancesARead-onlyIdempotent
List every configured qBittorrent instance and whether it is reachable.
Inputs: no named parameters. Returns: result
qb_listARead-onlyIdempotent
List torrents on one instance.
Args: instance: instance key from .instances.json. filter: all | downloading | seeding | completed | paused | active | stalled | errored. category: restrict to a category name. sort: field to sort by, e.g. uploaded, ratio, added_on, size. limit: maximum rows to return (1-50).
Inputs: instance (required), sort, limit, filter, +1 more. Returns: result
qb_overviewARead-onlyIdempotent
Summarise one instance (or all) without listing any torrent.
Use this first, when the question is "what is this instance doing right now": it returns connection state, live up/down speed, all-time transfer totals and a count of torrents per state. Reach for qb_list when you need the torrents themselves, qb_detail for one torrent's files and trackers, and qb_diagnose when the question is specifically why nothing is uploading.
Returns, per instance, the qBittorrent version, connection status, current speeds, all-time downloaded/uploaded totals, the share ratio, and a breakdown such as "uploading 2, stalledUP 91".
Args: instance: instance key from .instances.json; empty means every instance.
Inputs: instance. Returns: result
qb_removeADestructiveIdempotent
Remove torrents from an instance. Downloaded data is kept by default.
Removal is irreversible: the torrent and its resume data are gone, and re-adding it means re-downloading the metadata. If all you want is to stop transferring, pause it with qb_control instead - that keeps everything and can be undone.
Set delete_files only when you also want the payload deleted; that cannot be undone either. Removing a hash that is no longer present is harmless - qBittorrent accepts the call, and the reply counts the hashes you asked to remove rather than the ones that existed.
Args: instance: instance key from .instances.json. hashes: torrent hashes to remove. delete_files: also delete the downloaded data (default false).
Inputs: hashes (required), instance (required), delete_files. Returns: result
qb_set_limitAIdempotent
Set upload/download speed limits in bytes per second (0 = unlimited).
Args: instance: instance key from .instances.json. up: upload limit in bytes/s; 0 means unlimited. dl: download limit in bytes/s; 0 means unlimited. hashes: torrent hashes; empty means the global limit. mode: "normal" for the normal global limit, "alternative" for the alternative (scheduled) limit. qBittorrent keeps them separate and the active one depends on whether alternative mode is switched on.
Inputs: instance (required), dl, up, mode, +1 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool targets a distinct level of the domain (instance summary, torrent list, single-torrent detail, diagnosis, mutation of state, limits, share rules, add, remove, metadata), and the descriptions explicitly route between the close pairs (overview vs list vs detail vs diagnose, control vs remove, set_limit vs set_share). The overlap that does exist is called out in prose, so an agent can pick correctly.
All tools share a clean `qb_` prefix and snake_case, with verb-led names for operations (qb_add, qb_remove, qb_control, qb_set_limit, qb_set_share). A few read as nouns rather than verb_noun (qb_instances, qb_overview, qb_detail, qb_category), which is a minor deviation from an otherwise predictable pattern.
Eleven tools is well within a sensible band and each maps to a real qBittorrent capability, with no filler or near-duplicate entry. The surface is scoped enough to be readable in one pass but broad enough to cover the workflow end to end.
Core lifecycle is covered: discover instances, inspect, diagnose, add, pause/resume/reannounce, throttle, set share rules, tag/categorise, and remove. Gaps remain around metadata management — no category listing/creation or tag removal, and no recheck/verify-data — which an agent would hit when asked to build new categories or clean up tags.
Maintenance
Related MCP Connectors
YouTube transcripts, search, channels, playlists and bulk transcript jobs for AI agents. 14 tools.
17 pay-per-call web, finance, legal and onchain tools for AI agents. USDC on Base via x402/MPP.
214 tools for AI agents over one MCP endpoint: image, video, audio, 3D, data, storage, mail, GPUs.
PDF, image, video, OCR, screenshot, SQL, QR and text tools for agents. No API key, no signup.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA 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-
- AlicenseNot gradedqualityDmaintenanceProvides tools for interacting with the Transmission BitTorrent client via natural language, enabling users to manage torrents, configure download settings, and monitor download activity.4MIT
- FlicenseAqualityDmaintenanceEnables 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.73-
- AlicenseAqualityCmaintenanceMCP server exposing qBittorrent's WebUI API v2 as tools, enabling LLMs to manage torrents, categories, tags, RSS feeds, search plugins, and application settings.904MIT