jackett-mcp-server
v1.0.0
Published
MCP server for Jackett service integration
Maintainers
Readme
Jackett MCP Server
一个用于 Jackett 集成的 Model Context Protocol (MCP) 服务器。允许通过 MCP 协议搜索各种种子索引器。
功能
- 🔍 搜索种子资源: 通过 Jackett 搜索多个索引器
- 📊 获取搜索结果: 返回包含磁力链、种子数、文件大小等信息
- 🧪 测试索引器: 验证配置的索引器是否正常工作
- 📋 列出索引器: 查看所有已配置的索引器
安装
前置要求
- Node.js >= 18.0.0
- Jackett 服务已安装并运行
- Jackett API Key
安装步骤
# 克隆或下载此项目
cd JackettMcp
# 安装依赖
npm install
# 添加可执行权限
chmod +x src/index.js配置
环境变量
| 变量名 | 必需 | 默认值 | 说明 |
|--------|------|--------|------|
| JACKETT_BASE_URL | 否 | http://localhost:9117 | Jackett 服务地址 |
| JACKETT_API_KEY | 是 | - | Jackett API 密钥 |
获取 API Key
- 打开 Jackett Web UI (默认: http://localhost:9117)
- 点击右上角的设置图标 ⚙️
- 在 "API Key" 部分点击 "Copy" 按钮
- 将 API Key 设置为环境变量
使用方法
推荐方式:使用 npx (无需本地安装)
# 全局安装(推荐)
npm install -g /path/to/JackettMcp
# 或者直接使用 npx
npm install -g /path/to/JackettMcp然后在 Claude Desktop 中配置(推荐):
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"jackett": {
"command": "jackett-mcp-server",
"env": {
"JACKETT_BASE_URL": "http://localhost:9117",
"JACKETT_API_KEY": "your-api-key-here"
}
}
}
}方式 1: 本地安装后运行
# 安装依赖
cd /path/to/JackettMcp
npm install
# 启动服务器
npm start在 Claude Desktop 中配置:
{
"mcpServers": {
"jackett": {
"command": "node",
"args": ["/path/to/JackettMcp/src/index.js"],
"env": {
"JACKETT_BASE_URL": "http://localhost:9117",
"JACKETT_API_KEY": "your-api-key-here"
}
}
}
}方式 2: 使用 npx (无需安装)
# 直接运行(自动下载并运行)
npx jackett-mcp-server在 Claude Desktop 中配置:
{
"mcpServers": {
"jackett": {
"command": "npx",
"args": ["jackett-mcp-server"],
"env": {
"JACKETT_BASE_URL": "http://localhost:9117",
"JACKETT_API_KEY": "your-api-key-here"
}
}
}
}注意: npx 方式首次运行时会自动下载包,需要网络连接。
环境变量配置
无论使用哪种方式,都需要设置以下环境变量:
# Linux/macOS
export JACKETT_BASE_URL="http://localhost:9117"
export JACKETT_API_KEY="your-api-key-here"
# Windows (PowerShell)
$env:JACKETT_BASE_URL="http://localhost:9117"
$env:JACKETT_API_KEY="your-api-key-here"
# Windows (CMD)
set JACKETT_BASE_URL=http://localhost:9117
set JACKETT_API_KEY=your-api-key-here可用工具
1. jackett_search
搜索种子资源。
参数:
query(string, 必需): 搜索关键词category(number, 可选): 分类 ID- 2000: Movies
- 5000: TV Shows
- 1000: Console
- 3000: Audio
- 4000: PC
limit(number, 可选): 返回结果数量,默认 20
示例:
{
"query": "Inception",
"category": 2000,
"limit": 10
}响应:
{
"success": true,
"query": "Inception",
"totalResults": 15,
"results": [
{
"Title": "Inception.2010.1080p.BluRay.x264",
"Size": 8589934592,
"Seeders": 150,
"Peers": 20,
"Tracker": " indexer-name",
"MagnetUri": "magnet:?xt=urn:btih:...",
"Link": "http://..."
}
]
}2. jackett_test_indexers
测试所有配置的索引器是否正常工作。
参数: 无
3. jackett_list_indexers
列出所有已配置的索引器及其能力。
参数: 无
响应:
{
"success": true,
"totalCount": 25,
"indexers": [
{
"name": "indexer-name",
"id": "indexer-id",
"type": "public",
"capabilities": ["search", "movie-search"],
"configured": true
}
]
}开发
项目结构
JackettMcp/
├── src/
│ └── index.js # MCP 服务器实现
├── tests/
│ ├── test-server.test.js # MCP 服务器测试
│ └── test-api.test.js # API 集成测试
├── package.json
└── README.md运行测试
# 测试 MCP 服务器
npm run test:server
# 测试 API 集成
npm run test:api
# 运行所有测试
npm run test:all开发模式
# 使用 --watch 模式,代码修改后自动重启
npm run dev示例用法
搜索电影
# 在 Claude 中询问
"搜索电影 'Interstellar',只看 1080p 版本"Claude 会调用 jackett_search 工具,然后你可以:
- 查看搜索结果
- 选择合适的资源
- 查看种子数和文件大小
- 获取磁力链接
搜索电视剧
# 在 Claude 中询问
"搜索 'Breaking Bad' 第一季"检查索引器状态
# 在 Claude 中询问
"测试所有索引器是否正常工作"常见问题
Q: 搜索没有结果?
A: 可能的原因:
- Jackett 中没有配置索引器
- 索引器配置不正确
- 搜索关键词不合适
- API Key 错误
运行 jackett_test_indexers 检查索引器状态。
Q: 如何添加更多索引器?
A:
- 打开 Jackett Web UI
- 点击 "Show All" → "Add indexer"
- 选择要添加的索引器
- 按照提示配置
- 测试索引器是否可用
Q: 返回的结果没有磁力链?
A: 某些索引器只提供下载链接,不提供磁力链。这是索引器的限制,不是 MCP 服务的问题。
相关资源
许可证
MIT
作者
MCP Community
更新日志
v1.0.0 (2025-01-XX)
- 初始版本
- 支持搜索种子
- 支持测试和列出索引器
- 完整的错误处理
