Token导航 LogoToken导航TokenDH.com
rqbit Torrent Client MCP logo
运维云端stdio官方级别未说明来源级核验

rqbit Torrent Client MCP

MCP Server

为rqbit torrent客户端提供的Python API包装器和MCP服务器,便于集成到其他应用或服务中。

工具数

8

提示词数

0

GitHub Stars

3

资源数

0
PythonWindsurf云端部署Windsurf

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

philogicae

提供方

philogicae

最后核验

2026/5/17 20:19

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install rqbit-mcp

详细介绍

rqbit的Python API包装器和MCP服务器

![uv](https://docs.astral.sh/uv/getting-started/installation/) ![Python](https://www.python.org/downloads/) ![PyPI](https://badge.fury.io/py/rqbit-mcp) ![Actions status](https://github.com/philogicae/rqbit-mcp/actions) ![License: MIT](https://opensource.org/licenses/MIT) ![Ask DeepWiki](https://deepwiki.com/philogicae/rqbit-mcp)

此存储库为 rqbit torrent客户端。它允许轻松集成到其他应用程序或服务中。

目录

- 先决条件 - 配置 - 安装 - 从PyPI安装(推荐) - 促进地方发展 -

- 作为Python API包装器 - 作为MCP服务器 - 通过MCP客户端 - Windsurf示例

特性

  • 的API包装 rqbit torrent客户端。
  • 用于标准化通信的MCP服务器接口(stdio、sse、流式http)
  • 工具:

- list_torrents:列出所有种子及其详细信息。 - download_torrent:从磁铁链接或文件下载种子。 - get_torrent_details:获取特定种子的详细信息。 - get_torrent_stats:获取特定种子的统计数据/状态。 - pause_torrent:暂停洪流。 - start_torrent:启动torrent。 - forget_torrent:忘记torrent,保留文件。 - delete_torrent:删除torrent及其文件。

设置

先决条件

  • 正在运行的实例 rqbit.(包含在docker compose中)
  • Python 3.10+(安装PyPI需要)。
  • uv (用于地方发展)

配置

此应用程序需要您的URL rqbit 例子

设置环境变量:复制 .env.example.env 在项目的根目录中,使用您的设置对其进行编辑。应用程序将自动从以下位置加载变量 .env:

  • MCP服务器:

- RQBIT_URL:rqbit实例的URL(默认值: http://localhost:3030). - RQBIT_HTTP_BASIC_AUTH_USERPASS:如果在rqbit实例中设置。

  • Rqbit实例:

- RQBIT_HTTP_BASIC_AUTH_USERPASS:基本身份验证的用户名和密码,格式为 username:password. - RQBIT_HTTP_API_LISTEN_ADDR:HTTP API的监听地址(例如。, 0.0.0.0:3030). - RQBIT_UPNP_SERVER_ENABLE:启用或禁用UPnP服务器(例如。, truefalse). - RQBIT_UPNP_SERVER_FRIENDLY_NAMEUPnP服务器的友好名称(例如。, rqbit-media). - RQBIT_EXPERIMENTAL_UTP_LISTEN_ENABLE:启用或禁用uTP侦听器(默认值: false). - 检查 rqbit 其他变量和更多信息。

安装

选择以下安装方法之一。

从PyPI安装(推荐)

此方法最适合将包用作库或在不修改代码的情况下运行服务器。

  1. 从PyPI安装软件包:
pip install rqbit-mcp
  1. 创建一个 .env 运行应用程序并添加应用程序的目录中的文件 rqbit 网址:
RQBIT_URL=http://localhost:3030
  1. 运行MCP服务器(默认:stdio):
python -m rqbit_client

促进地方发展

此方法适用于希望修改源代码的贡献者。 使用 uv:

  1. 克隆存储库:
git clone https://github.com/philogicae/rqbit-mcp.git
cd rqbit-mcp
  1. 使用安装依赖项 uv:
uv sync --locked
  1. 通过复制示例创建配置文件并添加设置:
cp .env.example .env
  1. 运行MCP服务器(默认:stdio):
uv run -m rqbit_client

对于Docker

此方法使用Docker在容器中运行服务器。 compose.yaml包括 rqbit torrent客户端。

  1. 克隆存储库(如果您还没有):
git clone https://github.com/philogicae/rqbit-mcp.git
cd rqbit-mcp
  1. 通过复制示例创建配置文件并添加设置:
cp .env.example .env
  1. 使用Docker Compose构建并运行容器(默认端口:8000):
docker compose up --build -d
  1. 访问容器日志:
docker logs rqbit-mcp -f

用法

作为Python API包装器

import asyncio
from rqbit_client.wrapper import RqbitClient

async def main():
    # Read the RQBIT_URL from the .env file or fallback to default (http://localhost:3030)
    async with RqbitClient() as client:
        # Download a torrent
        magnet_link = "magnet:?xt=urn:btih:..."
        torrent = await client.download_torrent(magnet_link)
        print(torrent)

        # Check status
        status = await client.get_torrent_stats(torrent["id"])
        print(status)

        # List torrents
        torrents = await client.list_torrents()
        print(torrents)

if __name__ == "__main__":
    asyncio.run(main())

作为MCP服务器

from rqbit_client import RqbitMCP

RqbitMCP.run(transport="sse") # 'stdio', 'sse', or 'streamable-http'

通过MCP客户端

适用于任何兼容MCP的客户端。可用工具:

  • list_torrents:列出所有种子。
  • download_torrent:通过磁力链接或文件路径下载种子。
  • get_torrent_details:获取特定种子的详细信息。
  • get_torrent_stats:获取特定种子的统计数据/状态。
  • pause_torrent:暂停洪流。
  • start_torrent:启动torrent。
  • forget_torrent:忘记torrent,保留文件。
  • delete_torrent:删除torrent及其文件。

Windsurf示例

配置:

{
  "mcpServers": {
    ...
    # with stdio (only requires uv)
    "rqbit-mcp": {
      "command": "uvx",
      "args": [ "rqbit-mcp" ],
      "env": { 
        "RQBIT_URL": "http://localhost:3030", # (Optional) Default rqbit instance URL
        "RQBIT_HTTP_BASIC_AUTH_USERPASS": "username:password" # (Optional) Only if setup in rqbit instance
      }
    },
    # with docker (only requires docker)
    "rqbit-mcp": {
      "command": "docker",
      "args": [ "run", "-i", "-p", "8000:8000", "-e", "RQBIT_URL=http://localhost:3030", "-e", "RQBIT_HTTP_BASIC_AUTH_USERPASS=username:password", "philogicae/rqbit-mcp:latest", "rqbit-mcp" ]
    },
    # with sse transport (requires installation)
    "rqbit-mcp": {
      "serverUrl": "http://127.0.0.1:8000/sse"
    },
    # with streamable-http transport (requires installation)
    "rqbit-mcp": {
      "serverUrl": "http://127.0.0.1:8000/mcp" 
    },
    ...
  }
}

更新日志

更改日志.md 查看此项目的更改历史。

贡献

欢迎投稿!请打开问题或提交拉取请求。

许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。

目录标签

目录标签

PythonWindsurf云端部署torrent客户端本地部署API包装器MCP服务器文件下载

支持客户端

Windsurf

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

8

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP