aira-mcp
v1.0.6
Published
Aria2 MCP (Media Control Protocol) Service CLI
Readme
Aira MCP Service
使用JavaScript构建的MCP服务,能够通过aria2进行下载,aria服务器地址可以通过npx参数配置传入。
安装
npm install运行
基本运行
npm start通过npx参数配置aria服务器地址
npx aira-mcp --aria2-host=localhost --aria2-port=6800 --aria2-secret=your-secret支持的命令行参数
| 参数名 | 描述 | 默认值 | |-------|------|--------| | --aria2-host | aria2服务器地址或完整URL | localhost | | --aria2-port | aria2服务器端口 | 6800 | | --aria2-secret | aria2服务器密钥 | 无 | | --aria2-secure | 是否使用HTTPS | false | | --aria2-path | aria2 JSON-RPC路径 | /jsonrpc |
示例
使用完整URL配置:
npx aira-mcp --aria2-host=http://localhost:6800/jsonrpc使用独立参数配置:
npx aira-mcp --aria2-host=192.168.1.100 --aria2-port=6801 --aria2-secret=mysecret --aria2-secure=false接口说明
健康检查
GET /health响应:
{
"status": "ok",
"message": "MCP Service is running"
}下载文件
POST /download请求体:
{
"uri": "http://example.com/file.zip",
"options": {
"dir": "/downloads",
"max-connection-per-server": 5
}
}响应:
{
"success": true,
"gid": "2089b05ecca3d829",
}Magnet下载
POST /download/magnet请求体:
{
"hashkey": "88594AAACBDE40EF3E2510C47374EC0AA396C08E",
"options": {
"dir": "/downloads"
}
}响应:
{
"success": true,
"gid": "2089b05ecca3d829",
}获取下载状态
GET /download/:gid响应:
{
"success": true,
"status": {
"gid": "2089b05ecca3d829",
"status": "active",
"totalLength": "1000000",
"completedLength": "500000",
"uploadLength": "0",
"bitfield": "eeeeeeeeeeeeeeee",
"downloadSpeed": "100000",
"uploadSpeed": "0",
"infoHash": "",
"numSeeders": "0",
"seeder": false,
"connections": "5",
"errorCode": "0",
"errorMessage": "",
"followedBy": [],
"following": "",
"belongsTo": "",
"dir": "/downloads",
"files": [
{
"index": "1",
"path": "/downloads/file.zip",
"length": "1000000",
"completedLength": "500000",
"selected": true,
"uris": [
{
"uri": "http://example.com/file.zip",
"status": "used"
}
]
}
],
"bittorrent": null,
"verifiedLength": "0",
"verifyIntegrityPending": false
}
}暂停下载
POST /download/:gid/pause响应:
{
"success": true,
"message": "Download paused"
}恢复下载
POST /download/:gid/resume响应:
{
"success": true,
"message": "Download resumed"
}删除下载
DELETE /download/:gid响应:
{
"success": true,
"message": "Download removed"
}配置参数
| 参数名 | 描述 | 默认值 | |-------|------|--------| | --aria2-host | aria2服务器地址 | http://localhost:6800 | | --aria2-secret | aria2服务器密钥 | 无 |
MCP配置方式
在MCP配置文件中,可以按照以下方式配置Aira MCP Service:
{
"mcpServers": {
"aira-mcp": {
"command": "npx",
"args": [
"aira-mcp",
"--aria2-host=localhost",
"--aria2-port=6800",
"--aria2-secret=your-secret"
]
}
}
}配置说明
command: 使用npx命令来执行包args: 命令行参数列表aira-mcp: 包名--aria2-host: aria2服务器地址--aria2-port: aria2服务器端口--aria2-secret: aria2服务器密钥(可选)
完整配置示例
{
"mcpServers": {
"aira-mcp": {
"command": "npx",
"args": [
"aira-mcp",
"--aria2-host=http://192.168.1.100:6801/jsonrpc",
"--aria2-secret=mysecret"
]
}
}
}