Skip to main content
Glama
XiaotaoGuo

qbittorrent-readonly-mcp

by XiaotaoGuo

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: pve-mcp-server

도구

  • get_health_summary: 버전, 속도, 작업 상태 및 이상 요약.

  • list_torrents: 상태, 카테고리, 최소 크기, 비활성 일수로 작업을 필터링합니다.

  • get_torrent_details: 최소 8자리 Info Hash 접두어로 안전한 필드, 파일 및 tracker hostname을 가져옵니다.

  • list_problem_torrents: missingFiles, error 및 완료되지 않은 정체 작업을 나열합니다.

  • analyze_largest_torrents: 논리적 크기로 상위 N개 작업을 분석합니다.

환경 요구 사항

  • Python 3.10+

  • uv

  • 프로젝트 외부 비밀 파일에는 다음이 이미 포함되어 있어야 합니다:

    • QBIT_URL

    • QBIT_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

Available Tools

5 tools
analyze_largest_torrentsB
Read-onlyIdempotent

Return the largest torrents, optionally limited to a minimum inactivity age.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
inactive_daysNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already communicate read-only, idempotent, and non-destructive behavior. The description adds useful selection semantics (size-based ordering and the inactivity-age filter) but does not disclose details such as how results are capped or ordered beyond the word 'largest'.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The entire description is one front-loaded sentence with no filler. Every phrase contributes either the core behavior or the optional filter.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simple two-parameter schema, the presence of an output schema, and annotations that cover safety/idempotency, the description covers the essential behavior. It is only missing explicit sibling differentiation and a more concrete statement of the limit parameter's effect.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must compensate, and it does clarify inactive_days as a 'minimum inactivity age'. However, the limit parameter is not explained; its meaning is only implied by the word 'largest' and the schema's default of 20.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb and resource: 'Return the largest torrents', with an optional inactivity-age filter. It uniquely identifies the tool's role among siblings through the 'largest' qualifier, though it does not explicitly contrast it with list_torrents.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No when-to-use or when-not-to-use guidance is provided, and no alternatives are named. An agent is left to infer that this should be chosen over list_torrents or list_problem_torrents based solely on the phrase 'largest torrents'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_health_summaryA
Read-onlyIdempotent

Return versions, transfer speeds, task state counts, and read-only problem summary.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already establish readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the description does not need to repeat safety properties. It adds a little context with the list of returned aggregates, but no extra behavioral disclosures such as auth or failure modes.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One compact sentence with a strong verb and a clear list of result categories. No redundant qualifiers or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a parameterless read-only health summary with an output schema and full annotations, the description covers everything needed to invoke it. It does not need to elaborate on return layout since the schema exists.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are zero parameters, so no parameter documentation is required; the schema coverage is effectively complete. The description's mention of returned fields avoids any need to compensate for parameter gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'Return' and names versions, transfer speeds, task state counts, and a problem summary, making the resource and scope clear. The system-level content clearly separates it from torrent-scoped siblings like list_torrents and analyze_largest_torrents.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No when-to-use or alternative-selection guidance is given. The description only states what is returned; it does not say when to prefer get_health_summary over get_torrent_details or list_problem_torrents.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_torrent_detailsA
Read-onlyIdempotent

Get safe details for one torrent using an 8+ character hexadecimal Info Hash prefix.

ParametersJSON Schema
NameRequiredDescriptionDefault
identifierYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds little behavioral detail beyond the hash-prefix input requirement; 'safe' is redundant with the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One sentence with no filler. The primary action and scope are front-loaded, and the input format requirement is stated compactly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple: one parameter, clear annotations, and an output schema that can cover return values. The main missing piece is guidance on when to use this tool instead of siblings, but that is not critical for a single-parameter lookup.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must explain the opaque 'identifier' parameter. It does so clearly by specifying that it is an 8+ character hexadecimal Info Hash prefix, giving the agent a precise format to validate against.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states a specific verb ('get'), a specific resource ('details for one torrent'), and the required input form ('8+ character hexadecimal Info Hash prefix'). It distinguishes itself from sibling list/analysis tools by emphasizing single-torrent scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'for one torrent' implies the tool is appropriate when a single torrent's details are needed, but there is no explicit guidance about when not to use it or which sibling to prefer. Usage context is implied rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_problem_torrentsA
Read-onlyIdempotent

List missing, errored, unknown, or incomplete stalled/stopped torrents.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already disclose readOnly, idempotent, and non-destructive behavior, so the description does not repeat that. It adds filtering scope, but provides no extra behavioral context such as pagination, ordering, or result size details beyond the schema's default limit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no filler. It conveys the action and the precise inclusion criteria efficiently, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a low-complexity, read-only tool with no required parameters, an output schema, and clear annotations, the description is nearly complete. The main omission is guidance on the limit parameter, but the schema default and output schema mitigate the impact.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description says nothing about the 'limit' parameter. The parameter name and default value suggest the basic meaning, but the description does not clarify how limiting behaves, such as whether results are truncated or how a custom limit affects the response.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb, 'List', and identifies a distinct resource: problem torrents, explicitly naming the statuses included (missing, errored, unknown, or incomplete stalled/stopped). This clearly differentiates it from the generic sibling list_torrents.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The wording implies this tool is for finding torrents in problematic states, especially stalled or stopped ones, rather than for general listing. However, it does not explicitly mention sibling alternatives or state conditions for when this tool should not be used.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_torrentsC
Read-onlyIdempotent

List torrents using local filters; no filter value is sent as an arbitrary API endpoint.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
stateNo
categoryNo
min_size_gibNo
inactive_daysNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover the safety profile (readOnlyHint=true, idempotentHint=true, destructiveHint=false). The description adds that filters are applied locally, but the phrase 'no filter value is sent as an arbitrary API endpoint' is vague and potentially confusing. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief and the main verb/resource is front-loaded, which is good. However, the second clause is cryptic and does not earn its place, and the overall terseness borders on under-specification rather than deliberate conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With five optional parameters, zero schema descriptions, and sibling tools that perform related listing/filtering tasks, the description is too sparse. It does not explain what the returned output contains, how filters interact, or when this tool is preferable to list_problem_torrents or analyze_largest_torrents.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for the five undocumented parameters, but it only says 'using local filters' without explaining limit, state, category, min_size_gib, or inactive_days. The parameter names are somewhat self-explanatory, but the description adds essentially no parameter-level meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the verb ('List') and resource ('torrents') clearly, and the phrase 'using local filters' signals that filtering is done client-side. However, the second clause about arbitrary API endpoints is confusing and does little to distinguish this tool from siblings like get_torrent_details or list_problem_torrents.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance is given for when to use this tool versus alternatives such as get_torrent_details, list_problem_torrents, or analyze_largest_torrents. The 'local filters' hint implies a listing use case, but there are no exclusions, prerequisites, or decision rules.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 5 tool updatesv0.1.0
    • First observedanalyze_largest_torrents
    • First observedget_health_summary
    • First observedget_torrent_details
    • First observedlist_problem_torrents
    • First observedlist_torrents

TDQS

A3.7/5.0

Scored across 5 tools

Disambiguation5/5

Each tool targets a distinct monitoring concern: aggregate health, general torrent listing, per-torrent details, problem triage, and size/inactivity analysis. The two list-like tools are clearly differentiated by filtering to problem torrents versus all torrents.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern (get_*, list_*, analyze_*). There are no mixed conventions or vague one-word identifiers.

Tool Count5/5

Five tools is a well-scoped set for a read-only qBittorrent monitoring server. Each tool provides a distinct capability without redundancy.

Completeness4/5

The surface covers the main read-only workflow: health summary, listing, details, problem identification, and size analysis. Minor gaps exist around lower-level details like trackers or peer lists, but agents can accomplish core monitoring without dead ends.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Read-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
  • F
    license
    B
    quality
    C
    maintenance
    Read-only Proxmox VE MCP server providing 25 tools for VM, LXC, node, storage, and cluster inspection via stdio transport.
    25
    -
  • A
    license
    B
    quality
    A
    maintenance
    MCP server that exposes qui's JSON REST API as tools for monitoring and managing qBittorrent instances, torrents, automations, cross-seeding, RSS, backups, and related services.
    12
    MIT