Skip to main content

AI agent for qBittorrent management, RSS automation, and search.

Project description

Qbittorrent Agent

CLI or API | MCP | Agent

PyPI - Version MCP Server PyPI - Downloads GitHub Repo stars GitHub forks GitHub contributors PyPI - License GitHub GitHub last commit (by committer) GitHub pull requests GitHub closed pull requests GitHub issues GitHub top language GitHub language count GitHub repo size GitHub repo file count (file type) PyPI - Wheel PyPI - Implementation

Version: 0.14.0


Overview

Qbittorrent Agent is a production-grade Agent and Model Context Protocol (MCP) server designed to interface directly with AI agent for qBittorrent management, RSS automation, and search..


Key Features

  • Consolidated Action-Routed MCP Tools: Minimizes token overhead and eliminates tool bloat in LLM contexts by grouping methods into optimized, togglable tool modules.
  • Enterprise-Grade Security: Comprehensive support for Eunomia policies, OIDC token delegation, and granular execution context tracking.
  • Integrated Graph Agent: Built-in Pydantic AI agent supporting the Agent Control Protocol (ACP) and standard Web interfaces (AG-UI).
  • Native Telemetry & Tracing: Out-of-the-box OpenTelemetry exports and native Langfuse tracing.

CLI or API

This agent wraps the AI agent for qBittorrent management, RSS automation, and search. API. You can interact with it programmatically or via its integrated execution entrypoints.

Detailed instructions on how to use the underlying API wrappers, extended schema bindings, and developer SDK references are maintained in docs/index.md.


MCP

This server utilizes dynamic Action-Routed tools to optimize token overhead and maximize IDE compatibility.

Available MCP Tools

Tool Module Toggle Env Var Enabled by Default Description & Nested Methods
App APPTOOL True Manage qbittorrent app operations. Action-routed methods: get_application_version, get_api_version, get_build_info, shutdown_application, get_preferences, set_preferences, get_default_save_path.
Log LOGTOOL True Manage qbittorrent log operations. Action-routed methods: get_main_log, get_peer_log.
Sync SYNCTOOL True Manage qbittorrent sync operations. Action-routed methods: get_main_data, get_torrent_peers_data.
Transfer TRANSFERTOOL True Manage qbittorrent transfer operations. Action-routed methods: get_global_transfer_info, get_speed_limits_mode, toggle_speed_limits_mode, get_global_download_limit, set_global_download_limit, get_global_upload_limit, set_global_upload_limit, ban_peers.
Torrents TORRENTSTOOL True Manage qbittorrent torrents operations. Action-routed methods: get_torrent_list, get_torrent_properties, get_torrent_trackers, get_torrent_webseeds, get_torrent_contents, get_torrent_piece_states, get_torrent_piece_hashes, pause_torrents, resume_torrents, delete_torrents, recheck_torrents, reannounce_torrents, edit_tracker, remove_trackers, add_peers, add_new_torrent, add_trackers_to_torrent, increase_torrent_priority, decrease_torrent_priority, top_torrent_priority, bottom_torrent_priority, set_file_priority, get_torrent_download_limit, set_torrent_download_limit, set_torrent_share_limit, get_torrent_upload_limit, set_torrent_upload_limit, set_torrent_location, set_torrent_name, set_torrent_category, get_all_categories, add_new_category, edit_category, remove_categories, add_torrent_tags, remove_torrent_tags, get_all_tags, create_tags, delete_tags, set_auto_management, toggle_sequential_download, toggle_first_last_piece_priority, set_force_start, set_super_seeding, rename_file, rename_folder.
Rss RSSTOOL True Manage qbittorrent rss operations. Action-routed methods: add_rss_folder, add_rss_feed, remove_rss_item, move_rss_item, get_all_rss_items, mark_rss_as_read, refresh_rss_item, set_rss_auto_downloading_rule, rename_rss_auto_downloading_rule, remove_rss_auto_downloading_rule, get_all_rss_auto_downloading_rules, get_all_rss_articles_matching_rule.
Search SEARCHTOOL True Manage qbittorrent search operations. Action-routed methods: start_search, stop_search, get_search_status, get_search_results, delete_search, get_search_plugins, install_search_plugin, uninstall_search_plugin, enable_search_plugin, update_search_plugins.

Detailed tool schemas, parameter shapes, and validation constraints are preserved in docs/mcp.md.

MCP Configuration Examples

stdio Transport (Recommended for local IDEs e.g., Cursor, Claude Desktop)

Configure your IDE's mcp.json to launch the MCP server via uvx:

{
  "mcpServers": {
    "qbittorrent-agent": {
      "command": "uvx",
      "args": [
        "--from",
        "qbittorrent-agent",
        "qbittorrent-mcp"
      ],
      "env": {
        "QBITTORRENT_HOST": "your_qbittorrent_host_here",
        "QBITTORRENT_PORT": "your_qbittorrent_port_here",
        "QBITTORRENT_USERNAME": "your_qbittorrent_username_here",
        "QBITTORRENT_PASSWORD": "your_qbittorrent_password_here",
        "QBITTORRENT_API_KEY": "your_qbittorrent_api_key_here"
      }
    }
  }
}

Streamable-HTTP Transport (Recommended for production deployments)

Configure your client's mcp.json to launch the Streamable-HTTP server via uvx with explicit host and port definition:

{
  "mcpServers": {
    "qbittorrent-agent": {
      "command": "uvx",
      "args": [
        "--from",
        "qbittorrent-agent",
        "qbittorrent-mcp"
      ],
      "env": {
        "TRANSPORT": "streamable-http",
        "HOST": "0.0.0.0",
        "PORT": "8000",
        "QBITTORRENT_HOST": "your_qbittorrent_host_here",
        "QBITTORRENT_PORT": "your_qbittorrent_port_here",
        "QBITTORRENT_USERNAME": "your_qbittorrent_username_here",
        "QBITTORRENT_PASSWORD": "your_qbittorrent_password_here",
        "QBITTORRENT_API_KEY": "your_qbittorrent_api_key_here"
      }
    }
  }
}

Alternatively, connect to a pre-deployed remote or local Streamable-HTTP instance:

{
  "mcpServers": {
    "qbittorrent-agent": {
      "url": "http://localhost:8000/qbittorrent-agent/mcp"
    }
  }
}

Deploying the Streamable-HTTP server via Docker:

docker run -d \
  --name qbittorrent-agent-mcp \
  -p 8000:8000 \
  -e TRANSPORT=streamable-http \
  -e PORT=8000 \
  -e QBITTORRENT_HOST="your_value" \
  -e QBITTORRENT_PORT="your_value" \
  -e QBITTORRENT_USERNAME="your_value" \
  -e QBITTORRENT_PASSWORD="your_value" \
  -e QBITTORRENT_API_KEY="your_value" \
  knucklessg1/qbittorrent-agent:latest

Agent

This repository features a fully integrated Pydantic AI Graph Agent. It communicates over the Agent Control Protocol (ACP) and interacts seamlessly with the Agent Web UI (AG-UI) and Terminal interface.

Running the Agent CLI

To start the interactive command-line agent:

# Set credentials
export QBITTORRENT_HOST="your_value"
export QBITTORRENT_PORT="your_value"
export QBITTORRENT_USERNAME="your_value"
export QBITTORRENT_PASSWORD="your_value"
export QBITTORRENT_API_KEY="your_value"

# Run the agent server
qbittorrent-agent --provider openai --model-id gpt-4o

Docker Compose Orchestration

The following docker/agent.compose.yml configures the Agent, Web UI, and Terminal Interface together:

version: '3.8'

services:
  qbittorrent-agent-mcp:
    image: knucklessg1/qbittorrent-agent:latest
    container_name: qbittorrent-agent-mcp
    hostname: qbittorrent-agent-mcp
    restart: always
    env_file:
      - ../.env
    environment:
      - PYTHONUNBUFFERED=1
      - HOST=0.0.0.0
      - PORT=8000
      - TRANSPORT=streamable-http
    ports:
      - "8000:8000"
    healthcheck:
      test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"

  qbittorrent-agent-agent:
    image: knucklessg1/qbittorrent-agent:latest
    container_name: qbittorrent-agent-agent
    hostname: qbittorrent-agent-agent
    restart: always
    depends_on:
      - qbittorrent-agent-mcp
    env_file:
      - ../.env
    command: [ "qbittorrent-agent" ]
    environment:
      - PYTHONUNBUFFERED=1
      - HOST=0.0.0.0
      - PORT=9004
      - MCP_URL=http://qbittorrent-agent-mcp:8000/mcp
      - PROVIDER=${PROVIDER:-openai}
      - MODEL_ID=${MODEL_ID:-gpt-4o}
      - ENABLE_WEB_UI=True
      - ENABLE_OTEL=True
    ports:
      - "9004:9004"
    healthcheck:
      test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:9004/health')"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"

Detailed graph node architecture explanations, custom skill configurations, and agentic trace guides are available in docs/agent.md.


Security & Governance

Built directly upon the enterprise-ready agent-utilities core, standard security parameters are fully supported:

Access Control & Policy Enforcement

  • Eunomia Policies: Fine-grained, policy-driven tool authorization. Supports none, local embedded (mcp_policies.json), or centralized remote modes.
  • OIDC Token Delegation: Compliant with RFC 8693 token exchange for flowing authenticating user credentials from Web UI / ACP → Agent → MCP.
  • Scoped Credentials: Execution context runs restricted to the specific caller identity.

Runtime Security Grid

Feature Functionality Enablement
Tool Guard Sensitivity inspection with human-in-the-loop validation Enabled by default
Prompt Injection Defense Input scanning, repetition monitoring, and recursive loop blocks Enabled by default
Context Safety Guard Stuck-loop detectors and contextual overflow preemptive alerts Enabled by default

Installation

Install the Python package locally:

# Using uv (highly recommended)
uv pip install qbittorrent-agent[all]

# Using standard pip
python -m pip install qbittorrent-agent[all]

Repository Owners

GitHub followers GitHub User's stars


Contribute

Contributions are welcome! Please ensure code quality by executing local checks before submitting pull requests:

  • Format code using ruff format .
  • Lint code using ruff check .
  • Validate type-safety with mypy .
  • Execute test suites using pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qbittorrent_agent-0.14.0.tar.gz (29.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qbittorrent_agent-0.14.0-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

Details for the file qbittorrent_agent-0.14.0.tar.gz.

File metadata

  • Download URL: qbittorrent_agent-0.14.0.tar.gz
  • Upload date:
  • Size: 29.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for qbittorrent_agent-0.14.0.tar.gz
Algorithm Hash digest
SHA256 ccbc77af03071d48d8198e95ba6d9234885ee1ea455e254c4639da00206bdafa
MD5 f72264b4c32392bf5f905a64986de192
BLAKE2b-256 4bfc026a7f670c46329dfa352aa17a16820d07dbb8105da9c2532207d4320264

See more details on using hashes here.

File details

Details for the file qbittorrent_agent-0.14.0-py3-none-any.whl.

File metadata

File hashes

Hashes for qbittorrent_agent-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 422f142b04887e371c6a76b4c3379c636b60e49712045b7f53b25c8da0fd3a2f
MD5 39ec5981da0dc07d4a2497ee4c645f7d
BLAKE2b-256 764dd17039fa91965abeff7d6c9b1acb39f8c0a3561ba946ae3b1a9abcea052c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page