aria2-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@aria2-mcp download https://example.com/data.zip to ./downloads and tell me when it's done"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
aria2-mcp
English | 简体中文
A zero-config, zero-dependency Model Context Protocol (MCP) server and Magpie tools plugin that gives AI coding agents reliable background HTTP(S) file downloads powered by aria2.
Why aria2-mcp?
Asking an agent to run ad-hoc curl / Invoke-WebRequest in a shell breaks on real-world downloads: interrupted sessions drop progress, proxies silently fail over to direct connections or leak credentials in logs, and existing files get clobbered. Most existing aria2 MCP wrappers also require you to manually start and configure an aria2c RPC daemon first.
aria2-mcp solves this out of the box:
Zero-config local daemon: Automatically locates
aria2c, binds a free127.0.0.1port with a random 32-byte RPC secret, locks down the state directory (icaclson Windows,0700on macOS/Linux), prevents concurrent duplicate launches, and persists resumable sessions (downloads.session).Fail-closed OS proxy safety: Automatically reads the system proxy (Windows Internet Settings registry, macOS
scutil --proxy, Linux env vars), TCP-probes reachability before starting, refuses silent fallback to direct, rejects unsupported PAC/WPAD explicitly, and never modifies system/global proxy settings.Agent-safe by default: Never overwrites existing files (auto-suffixes a UUID on conflict), validates filenames and rejects embedded URL credentials, and strips URLs/proxy secrets from tool outputs.
Zero dependencies, fast startup: Pure Node.js 20+ (and Bun-compatible), ~50ms cold start.
Dual-mode + Remote RPC: Runs as a standard stdio MCP server (
npx -y aria2-mcp), as a 1-click Magpie tools plugin (magpie-plugin), or pointed at an existing/NASaria2cinstance viaARIA2_RPC_URL.
Related MCP server: abdm-mcp
Prerequisites
Node.js 20+ (or Bun when installed as a Magpie plugin)
aria2 installed locally (unless connecting to a remote instance via
ARIA2_RPC_URL):Windows:
winget install aria2.aria2orscoop install aria2macOS:
brew install aria2Linux:
sudo apt install aria2(or your distro's package manager)
Quick Start
1. Any MCP Client (npx)
{
"mcpServers": {
"aria2": {
"command": "npx",
"args": ["-y", "aria2-mcp"]
}
}
}Works with Claude Code, Claude Desktop, Codex, Cursor, Windsurf, Antigravity (agy), VS Code, and any stdio MCP host.
For Claude Code CLI:
claude mcp add aria2 -- npx -y aria2-mcp2. Magpie (1-click for every connected agent)
Install from Magpie's Plugins → Discover → Unofficial, on GitHub, or via CLI:
magpie plugin add github:Neko-Yukari/aria2-mcp
# or once published to npm:
magpie plugin add aria2-mcpMagpie automatically serves its tools to every connected agent over its built-in MCP router (aria2-mcp__submit, aria2-mcp__status, aria2-mcp__list, aria2-mcp__control, aria2-mcp__wait), with per-agent toggles in Library → MCP.
3. Remote / NAS aria2 Instance
{
"mcpServers": {
"aria2": {
"command": "npx",
"args": ["-y", "aria2-mcp"],
"env": {
"ARIA2_RPC_URL": "http://192.168.1.10:6800/jsonrpc",
"ARIA2_RPC_SECRET": "your-secret",
"ARIA2_DEFAULT_PROXY": "direct"
}
}
}
}Tools
MCP Tool | Magpie Plugin Tool | Purpose |
|
| Submit a background HTTP(S) download ( |
|
| Query progress, speed, status, and safe error code for a GID. |
|
| List active, waiting, and recently stopped downloads (up to 100 per queue). |
|
|
|
|
| Wait cleanly (up to 120s in MCP, 50s in Magpie) for completion/error/pause without tight polling loops. |
Completion & Progress Notifications
Because MCP hosts differ in how they handle server-initiated events, aria2-mcp supports three layers:
In-call waiting (
download_wait+notifications/progress): For short/medium files, calldownload_wait. When the MCP client passes_meta.progressToken,aria2-mcpstreams standard MCPnotifications/progressupdates as bytes arrive.Proactive MCP notifications (
notifications/message+ optionalclaude/channel): Downloads submitted viadownload_submitare watched in the background (every 5s by default, configurable viaARIA2_NOTIFY_POLL_MS). When a download completes or errors,aria2-mcpemits a standard MCPnotifications/message(never leaking URLs or credentials) and, for clients advertisingexperimental["claude/channel"](or withARIA2_CLAUDE_CHANNEL=1), also emitsnotifications/claude/channel.CLI Reactive Waiter (
--wait <gid>): For multi-minute downloads in agents that wake up automatically when a background shell task exits (e.g., Antigravity, Claude Code, Codex), run:
npx -y aria2-mcp --wait <gid> [--timeout 3600]Exit codes: 0 = complete, 1 = error/removed, 2 = paused, 124 = timed out.
Environment Variables
Variable | Default | Description |
| Auto-detected | Explicit path to |
| OS app-data dir | Directory storing |
|
| Default destination directory for local downloads. |
|
| Default proxy mode: |
| (unset) | Use an external/remote aria2 JSON-RPC URL instead of spawning a local daemon. |
| (unset) | RPC secret token for |
Security Model
Loopback-only RPC (
127.0.0.1, random free port, 256-bit random token,rpc-allow-origin-all=false).Private state directory verified via
icacls(Windows) or0700(POSIX).Proxy environment variables (
HTTP_PROXY,HTTPS_PROXY,ALL_PROXY,NO_PROXY) are stripped from thearia2cprocess and applied strictly per-task.Tool responses only return
{ gid, status, totalLength, completedLength, downloadSpeed, errorCode, progress }— never echoing URLs, query tokens, or proxy credentials.
Development & Tests
npm testLicense
Available Tools
5 toolsdownload_controlA
Pause, resume or cancel a download by GID. Cancel retains partial files and does not delete them. Resume continues the same GID and partial data; query download_status afterward to verify the resulting state.
Inputs: gid (required), action (required).
download_listA
List background downloads (active, waiting, recently stopped) in the aria2 daemon. Find an existing task before submitting a duplicate; use download_status for the selected GID.
Inputs: no named parameters.
download_statusA
Get download progress, speed and safe error code by GID. Confirm status=complete before claiming success or using the downloaded file; active, waiting and paused are not completion. Report errors honestly and avoid tight polling loops.
Inputs: gid (required).
download_submitA
Download an HTTP(S) file to disk in the background via local aria2c; returns a GID, not proof of completion. Call download_wait for short/medium files, or check download_status later or run node "/app/server.mjs" --wait <gid> in a background shell before reporting success or consuming the file. Defaults to the OS system proxy and Downloads; use direct or an explicit HTTP proxy when requested. Keep global and system proxy settings unchanged, report a proxy failure instead of silently switching to direct, and keep URLs and proxy credentials out of chat. Existing files stay untouched. For webpage reading, API calls, Git or package managers, use the dedicated tool. If a requested download feature is unsupported, explain the limitation before choosing another method.
Inputs: url (required), proxy, filename, directory.
download_waitA
Wait up to timeout_seconds (default 30, max 120) for a download GID to reach complete, error, removed, or paused without tight polling. If timedOut=true, do not loop download_wait tightly: continue other work, check download_status later or run node "/app/server.mjs" --wait <gid> in a background shell.
Inputs: gid (required), timeout_seconds.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct action on the download lifecycle: submit (create), status (inspect one), list (enumerate), control (pause/resume/cancel), wait (blocking poll). Boundaries are explicit and the descriptions reinforce when to use each (e.g., submit returns a GID, wait/status confirm completion).
All tools follow a single predictable pattern: download_<verb> in snake_case (submit, status, list, control, wait). No mixing of conventions or stray verbs.
Five tools is well-scoped for a background download manager, and each maps to a genuine lifecycle operation with no redundant or filler tools.
Core lifecycle (submit, list, status, control, wait) is covered with no dead ends for typical workflows. Minor gaps remain: there is no tool to remove/purge completed or cancelled downloads (control cancel explicitly retains files), so cleanup requires out-of-band action.
Maintenance
Related MCP Connectors
AI Agent Utility Layer for agent safety, web monitoring, crypto research and tool discovery.
Build agents to automate any background task. Works with your ChatGPT/Claude subscription.
Agent-native security, trust, reliability, data and procurement tools for AI workflows.
Durable background job execution, async task scheduling, and state persistence for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceA download tool for AI agents that wraps aria2 with safety rules and MCP server support, enabling reliable downloads without false positives.1MIT
- AlicenseAqualityCmaintenanceEnables AI coding agents to offload large downloads to AB Download Manager with multi-threaded acceleration, pause/resume, and queueing, while enforcing sandboxing and security guardrails.12MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to remotely execute shell commands and transfer files on SSH hosts, including jump-host tunneling, background tasks, resumable transfers, and optional approval of destructive commands, while SSH credentials remain in the local process. It runs over stdio or a streamable HTTP daemon and supports auditing, allow/deny lists, and multiple authentication methods.ISC
- AlicenseAqualityBmaintenanceEnables AI agents and CLI tools to dispatch downloads through Chrome's native download engine over the MCP protocol, automatically inheriting browser cookies, login sessions, and proxy settings. Supports submitting, monitoring, pausing, resuming, and cancelling download tasks locally without manual server setup.8MIT