qbittorrent-readonly-mcp
qBittorrent Read-only MCP
这是一个独立维护的 qBittorrent 只读 MCP 项目,把 qBittorrent Web API 查询包装为本机 stdio MCP 工具,便于 AI 客户端直接做实时诊断。
安全模型
仅支持
stdio,不监听任何网络端口。qBittorrent 地址和 API Key 只从环境或外部秘密文件读取,MCP 工具参数不能覆盖连接目标。
客户端只允许固定 GET endpoint;没有通用 request、URL 或 endpoint 工具。
不注册添加、暂停、恢复、校验、删除、移动、改 tracker、改设置等写工具。
完整 tracker URL、passkey、magnet、Cookie 和认证信息不会进入工具结果。
qBittorrent API Key 本身仍有完整 Web API 权限;只读性由本服务的两层 allowlist 和测试保证。
本 MCP 不执行文件系统递归扫描,职责限定为 qBittorrent 实时查询。
Related MCP server: truenas-mcp
工具
get_health_summary:版本、速度、任务状态和异常摘要。list_torrents:按状态、分类、最小大小、无活动天数筛选任务。get_torrent_details:按至少 8 位 Info Hash 前缀获取安全字段、文件和 tracker hostname。list_problem_torrents:列出missingFiles、error 和未完成停滞任务。analyze_largest_torrents:按逻辑大小分析 Top N 任务。
环境要求
Python 3.10+
uv项目外部秘密文件中已有:
QBIT_URLQBIT_API_KEY
默认从进程环境读取。也可只传递秘密文件路径:
export QBIT_MCP_ENV_FILE="/path/to/secrets/nas-audit.env"不要把 Key 复制到本目录或 Codex 配置中。
安装与测试
cd /path/to/qbittorrent-readonly-mcp
uv sync
uv run pytest真实只读 smoke test(仅输出工具名和脱敏检查结果):
uv run python scripts/live_smoke.py \
--env-file /path/to/secrets/nas-audit.env本地启动:
QBIT_MCP_ENV_FILE="/path/to/secrets/nas-audit.env" \
uv run qbittorrent-readonly-mcp服务启动后使用 stdin/stdout 传输 MCP 协议,不会显示普通交互提示符。
Codex 配置
Codex 支持在可信项目的 .codex/config.toml 中配置本地 STDIO MCP。以下是示例配置;这里只传秘密文件路径,不把 API Key 写进配置。实际路径应由使用该 MCP 的宿主项目维护:
[mcp_servers.qbittorrent_readonly]
command = "/path/to/qbittorrent-readonly-mcp/.venv/bin/qbittorrent-readonly-mcp"
args = []
cwd = "/path/to/qbittorrent-readonly-mcp"
enabled = true
required = false
startup_timeout_sec = 20
tool_timeout_sec = 60
default_tools_approval_mode = "auto"
enabled_tools = [
"get_health_summary",
"list_torrents",
"get_torrent_details",
"list_problem_torrents",
"analyze_largest_torrents",
]
[mcp_servers.qbittorrent_readonly.env]
QBIT_MCP_ENV_FILE = "/path/to/secrets/nas-audit.env"本仓库不保存 Codex 配置,也不保存任何凭据。调用方只需要引用本项目的启动命令,并传入项目外的秘密文件路径。
Codex MCP 配置方式参考 OpenAI 官方文档,Python 实现使用 Model Context Protocol 官方 Python SDK。
开发
核心分层:
MCP tools
-> ReadOnlyQbitService(筛选、聚合、固定输出)
-> QbitReadOnlyClient(固定 GET allowlist)
-> qBittorrent Web API任何新 endpoint 都必须先加入 READ_ONLY_ENDPOINTS,并为“非白名单拒绝”和“敏感字段不泄漏”增加测试。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseAqualityBmaintenanceRead-only MCP server for self-hosted Telegram access via Telethon. Enables reading messages, chats, and media but disallows any write operations.10
- Alicense-qualityAmaintenanceRead-only MCP server for TrueNAS SCALE 25.10+ that connects via JSON-RPC 2.0 WebSocket API, providing tools to inspect storage, shares, services, system info, jobs, and alerts.24MIT
- Alicense-qualityCmaintenanceRead-only MCP server that monitors a Bitcoin Core full node via JSON-RPC, providing tools to check node status, network info, mempool, and peer information.MIT
- Alicense-qualityBmaintenanceA locally-run, read-only MCP server that lets an LLM client diagnose a self-hosted *arr media stack by aggregating across Sonarr, Radarr, Prowlarr, qBittorrent, Tdarr, and Profilarr.Apache 2.0
Related MCP Connectors
Read-only DERO blockchain MCP: 33 tools (12 composites) incl. TELA discovery + bundled docs.
Read-only XRP Ledger MCP tools with proof-annotation envelopes and signed daily snapshots.
Read-only MCP server for Muovi, Argentina's trust-first local services marketplace (6 tools).
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/XiaotaoGuo/qbittorrent-readonly-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server