Skip to main content
Glama
aserper

NZBGet MCP Server

by aserper

NZBGet MCP 服务器

一个用于 NZBGet 的 MCP(模型上下文协议)服务器,将 NZBGet API 功能公开为 LLM 客户端可用的 MCP 工具。

通过 Claude 和其他支持 MCP 的客户端,使用自然语言控制您的 Usenet 下载。

功能特性

  • 15 个 MCP 工具,实现完整的 NZBGet 控制

  • 队列管理:列出、添加、暂停、恢复、删除下载

  • 历史记录跟踪:查看已完成和失败的下载

  • 速度控制:设置下载速率限制

  • 状态监控:实时服务器状态、磁盘空间、队列信息

  • 日志记录:访问并写入 NZBGet 日志

  • 使用 JSON-RPC 客户端的 TypeScript 实现

  • 与 Claude Desktop 兼容的 Stdio 传输

要求

  • Node.js 18+

  • 一个已启用 RPC 的 NZBGet 实例

设置

  1. 克隆仓库并安装依赖:

git clone https://github.com/aserper/nzbget-mcp.git
cd nzbget-mcp
npm install
  1. 构建项目:

npm run build
  1. .env.example 复制到 .env 并设置您的值:

cp .env.example .env

编辑 .env

NZBGET_HOST=localhost
NZBGET_PORT=6789
NZBGET_USERNAME=nzbget
NZBGET_PASSWORD=tegbzn6789
NZBGET_USE_HTTPS=false

运行 MCP 服务器

npm start

或直接运行:

node dist/index.js

测试

# Run all tests
npm test

# Run with coverage
npm run test:coverage

# Run tests in watch mode
npm run test:ui

架构

此 MCP 服务器使用模块化架构:

  • src/tools/*.ts - 单个工具实现

  • src/tools/index.ts - 工具注册与发现

  • src/utils/errors.ts - 错误处理工具

  • src/__tests__/mocks/ - 测试夹具和模拟

所有 15 个工具都是自包含的模块,在导入时会自动注册。

配置

变量

描述

默认值

NZBGET_HOST

NZBGet 主机名

localhost

NZBGET_PORT

NZBGet RPC 端口

6789

NZBGET_USERNAME

NZBGet 用户名

-

NZBGET_PASSWORD

NZBGet 密码

-

NZBGET_USE_HTTPS

使用 HTTPS

false

Claude Desktop 配置

添加到您的 Claude Desktop 配置中(macOS 上为 ~/Library/Application Support/Claude/claude_desktop_config.json,或其他平台上的等效路径):

{
  "mcpServers": {
    "nzbget": {
      "command": "node",
      "args": ["/path/to/nzbget-mcp/dist/index.js"],
      "env": {
        "NZBGET_HOST": "localhost",
        "NZBGET_PORT": "6789",
        "NZBGET_USERNAME": "nzbget",
        "NZBGET_PASSWORD": "tegbzn6789"
      }
    }
  }
}

Docker

本地构建

docker build -t nzbget-mcp .

运行

docker run --rm -it \
  -e NZBGET_HOST="localhost" \
  -e NZBGET_PORT="6789" \
  -e NZBGET_USERNAME="nzbget" \
  -e NZBGET_PASSWORD="tegbzn6789" \
  nzbget-mcp

公开的工具

状态与信息

  • nzbget_status - 获取服务器状态(速度、队列大小、磁盘空间)

  • nzbget_version - 获取 NZBGet 版本

  • nzbget_server_volumes - 获取每个服务器的下载统计信息

下载队列

  • nzbget_list_groups - 列出队列中的所有下载

  • nzbget_append - 将 NZB 文件添加到队列

  • nzbget_edit_queue - 编辑队列(暂停、恢复、删除、设置优先级)

历史记录

  • nzbget_history - 查看下载历史记录

控制

  • nzbget_pause_download / nzbget_resume_download

  • nzbget_pause_post / nzbget_resume_post

  • nzbget_rate - 设置下载速度限制 (KB/s)

  • nzbget_scan - 扫描新的 NZB 文件

日志记录

  • nzbget_log - 获取日志条目

  • nzbget_write_log - 写入自定义日志消息

使用示例

"Show me what's currently downloading"
"Pause the download queue"
"Set download speed to 5 MB/s"
"Add an NZB file to the queue"
"Show my recent download history"

开发

# Install dependencies
npm install

# Build
npm run build

# Watch mode
npm run dev

# Lint
npm run lint

# Type check
npm run typecheck

许可证

MIT

贡献

欢迎贡献!请随时提交 Issue 或 PR。

Install Server
A
license - permissive license
C
quality
C
maintenance

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

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/aserper/nzbget-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server