p2p-tools-mcp
This is the vpn-mcp server, which controls and inspects a supported NordVPN CLI through five stdio tools.
Check VPN status —
vpn_statusreports the current NordVPN connection state (read-only).Connect to VPN —
vpn_connectconnects NordVPN, optionally to a specificcountry(e.g. a country name/code string).Disconnect from VPN —
vpn_disconnectdisconnects NordVPN (marked destructive and idempotent).Look up public IP —
vpn_public_ipqueries an external IP-check service and returns the current public IP (read-only).Enforce VPN gating —
vpn_require_activefails unless NordVPN is connected, so a caller can verify VPN is active before other work.Notes — all tools forbid task execution, take no or minimal arguments, and rely on the shared config (
P2P_TOOLS_CONFIG) plus the host-level network guard; connect/disconnect results distinguish accepted commands from observed state, so state may be unverifiable (e.g. on Windows). Platform support varies: connect/disconnect and status/require_active work via the supported CLI on Linux, connect/disconnect only on Windows, and macOS is unsupported by this adapter.
Controls a NordVPN connection, including status checks, connect/disconnect, public IP lookup, and a fail-closed network guard for guarded operations.
Manages qBittorrent torrent lifecycle: add magnets and torrent URLs, list and inspect torrents, pause/resume, and delete torrents with optional file removal.
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., "@p2p-tools-mcp search for 'ubuntu 24.04' on Jackett and list top 5 results"
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.
p2p-tools-mcp
One npm package with a unified CLI and two local-first MCP servers for VPN checks, Jackett search, and qBittorrent lifecycle operations:
p2p-toolsprovides the same operations as a JSON-first command-line interface.vpn-mcpcontrols and inspects a supported NordVPN CLI.torrent-mcpexposes explicitjackett_*andqbittorrent_*tools.Seven optional adapters add slskd/Soulseek, Prowlarr, Gluetun, cross-seed, Transmission, Syncthing, and IPFS/Kubo. See the basket guide for configuration and supported operations.
Optional Jev AI ranking scores Soulseek search metadata after results arrive; it never downloads automatically. See Jev ranking.
Completed music downloads can be checked and staged with conservative MusicBrainz metadata using music enrichment.
The resumable music workflow combines duplicate planning, Soulseek acquisition, enrichment, storage guards, and verified Android delivery.
p2p-tools setup statustells agents when user credentials are needed;p2p-tools setup credentialscollects the slskd API key in a hidden local prompt.
All three entrypoints share one configuration loader, validated operation layer, network guard, normalized responses, credential/path redaction, and safe error guidance. The MCP servers use stdio and keep VPN lifecycle separate from torrent lifecycle.
This package is for operators who already run Jackett and qBittorrent and want an agent or script to search and manage them. MCP (Model Context Protocol) lets an agent call these operations as tools; the CLI provides the same operations directly.
Capabilities and limits
Search and inspect Jackett's Torznab feed (its standardized search API), then submit a usable BTIH magnet or HTTP(S) torrent URL to qBittorrent. BTIH identifies a torrent by its content hash.
List, inspect, pause, resume, and delete explicitly identified torrents. qBittorrent 4.x/5.x protocol differences are covered by synthetic fixtures; your deployed versions still need integration testing.
Add success means qBittorrent accepted at least part of the submission. Use list/get to verify the torrent's actual state and eventual completion.
Search results omit download links and tracker credentials. URL-only or private-tracker results may need acquisition through the service's own UI; there is no opaque search-result-to-add resolver in this version.
The host guard checks status before selected operations. Ongoing traffic isolation requires a correctly configured VPN network boundary or kill switch, including after the operation returns.
Run
p2p-tools doctor(or thep2p_doctorMCP tool) for read-only setup checks and recovery steps. It checks service access and the host guard; traffic isolation remains explicitly unverified.Optional adapters default to disabled and expose tools only when correctly configured. Each has its own deadline, concurrency limit, and bounded HTTP responses. A failed optional service leaves other tools available.
basket searchpreserves per-provider failures and pending Soulseek searches.Redaction uses conservative patterns: it can obscure ordinary titles containing words such as “secret,” and cannot guarantee removal of every arbitrary secret embedded in untrusted text.
The validation record distinguishes local automated evidence from live-service and VPN checks still required. Start with the topology appropriate to your host below, then verify connectivity before adding torrents.
Related MCP server: MPilot
Platform support
The Node.js servers and Jackett/qBittorrent integrations run on Windows, macOS, and Linux.
The bundled NordVPN adapter has narrower support:
Capability | Linux | Windows | macOS |
Connect/disconnect | Not supported by this adapter | ||
Status and | Supported CLI | Not supported by this adapter | Not supported by this adapter |
Built-in torrent network guard | Supported | Use an external boundary | Use an external boundary |
For an operating-system-neutral deployment, run Jackett and qBittorrent behind a dedicated VPN container/network boundary and disable the host-level guard. See Torrent-side VPN isolation.
Requirements
Built JavaScript: Node.js 20 or newer. Source development, tests, and packing: Node.js 20.19+, 22.12+, or 24+ (excluding 21/23), matching the locked tooling. CI is configured for Node.js 24 on Windows, macOS, and Linux plus 20.19/22.12 on Linux; those remote runs are not claimed as completed here.
Jackett for search and indexer operations.
qBittorrent with its Web UI enabled for torrent operations.
A supported NordVPN CLI only when using
vpn-mcpor the built-in network guard.
Quick start
From a reviewed source checkout:
npm ci
npm test
npm run buildThe build produces all three package commands. Try the CLI directly from the checkout:
node dist/p2p-tools.js --help
node dist/p2p-tools.js jackett category --query "audio flac"Copy the annotated configuration to an untracked location, add the service credentials, and register one or both servers with an MCP client:
mcp_servers:
torrent:
command: node
args: ["<repo-root>/dist/torrent-mcp.js"]
env:
P2P_TOOLS_CONFIG: "<private-config-file>"Add vpn-mcp only when the host supports the required VPN operation:
mcp_servers:
vpn:
command: node
args: ["<repo-root>/dist/vpn-mcp.js"]
env:
P2P_TOOLS_CONFIG: "<private-config-file>"Restart the MCP client after changing its registration. A server started directly in a terminal normally appears idle because it is waiting for MCP messages on stdin.
With P2P_TOOLS_CONFIG set, run node dist/p2p-tools.js doctor before your first search or addition. Address failed checks using their next_action guidance. Warnings, including a deliberately disabled host guard, appear separately; a completed report does not prove VPN isolation. See doctor output and exit codes.
Configuration
Set P2P_TOOLS_CONFIG to a YAML file. When it is unset, the servers use loopback defaults for Jackett and qBittorrent, but authenticated operations will still require their credentials.
vpn:
provider: nordvpn
command: nordvpn
network_guard:
enabled: true
requireVpnConnected: true
guarded_operations:
- torrent_search
- torrent_caps
- torrent_list_indexers
- torrent_add
jackett:
baseUrl: http://127.0.0.1:9117
apiKey: <jackett-api-key>
qbittorrent:
baseUrl: http://127.0.0.1:8080
username: <web-ui-username>
password: <web-ui-password>The guard configuration deliberately uses stable internal operation IDs (torrent_search, torrent_add, and so on), including when callers use the newer canonical tool names. See the User Guide for the full mapping and environment-variable overrides.
Unknown keys/operation IDs, ambiguous aliases, non-boolean guard flags, and invalid timeout values are rejected. Timeouts are integer milliseconds from 1 to 2,147,483,647 and cover HTTP response-body reads. Service base URLs must be direct HTTP(S) endpoints without user-info credentials, queries, or fragments; redirects are rejected. Reverse-proxy path prefixes are supported.
On Windows, set vpn.command to the trusted absolute path of the NordVPN command executable. The adapter deliberately does not inherit the caller's search path.
File-permission hardening is optional. If the host is shared or its default file permissions are broad, restrict the populated configuration to the account that launches p2p-tools or either MCP server.
CLI
The same package installs p2p-tools alongside vpn-mcp and torrent-mcp:
p2p-tools doctor
p2p-tools vpn status
p2p-tools jackett search --query "example query" --limit 25
p2p-tools qbit list --filter downloadingThe CLI writes shared-handler { "ok": true, "data": ... } and { "ok": false, "error": ... } envelopes. It exits with 0 for success, 1 for an operation failure, and 2 for invalid invocation or configuration. Doctor returns exit 1 for a blocked report and 0 for passed checks or warnings; inspect data.status even when ok is true. Use --stdin to supply a JSON object to operation commands and --compact for one-line output.
See the CLI Guide for every command, option, stdin examples, and delete confirmation behavior.
Canonical tools
vpn-mcp:
vpn_statusvpn_connectvpn_disconnectvpn_public_ipvpn_require_active
torrent-mcp, setup diagnostics:
p2p_doctorp2p_integrations(configuration inventory without probes)p2p_search(combined search with explicit partial and pending outcomes)
Configured optional adapters additionally expose the tools listed in the basket guide.
torrent-mcp, Jackett:
jackett_test_connectionjackett_searchjackett_capsjackett_list_indexersjackett_get_category
torrent-mcp, qBittorrent:
qbittorrent_test_connectionqbittorrent_add_magnetqbittorrent_add_torrent_urlqbittorrent_list_torrentsqbittorrent_get_torrentqbittorrent_pause_torrentqbittorrent_resume_torrentqbittorrent_delete_torrent
The torrent_* names are deprecated compatibility aliases for the 0.2 release line. New integrations should use the canonical names above.
Safety and privacy behavior
Successful service responses pass through a recursive credential/path redactor.
Unexpected exceptions become stable public errors instead of exposing raw messages.
Jackett results omit comments, arbitrary attributes, unsafe download URLs, and peer-identifying fields; safe magnet output contains only the BTIH identifier.
qBittorrent output omits local save paths and other unnecessary raw API fields.
VPN child processes receive a small sanitized environment.
vpn_public_ipcontacts an external IP-check service and returns the current public IP.VPN connect/disconnect results distinguish accepted commands from observed state.
state_verified: falseandconnected: nullmean the state could not be observed, including on Windows.qbittorrent_delete_torrentkeeps downloaded files unlessdelete_files: trueis supplied.Torrent targets must be individual 40- or 64-character hexadecimal hashes. The
allsentinel, embedded separators, and conflicting target fields are rejected.The network guard is fail-closed for configured operations, but it does not connect the VPN automatically.
Documentation
User Guide: setup, configuration, tool arguments, verification, privacy, and troubleshooting.
CLI Guide: CLI installation, commands, options, JSON input, output, and exit codes.
Hermes wiring: focused MCP registration examples.
Standalone migration: migrate from separate Jackett/qBittorrent servers.
Torrent-side VPN isolation: containerized network-boundary deployment.
Versioning: compatibility and release policy.
Validation record: audited behavior, local checks, compatibility changes, and remaining evidence gaps.
Example config: annotated configuration template.
Development
npm test # Vitest suite
npm run check # TypeScript validation of source and tests without output
npm run build # compile into dist/Generated binaries:
dist/p2p-tools.jsdist/vpn-mcp.jsdist/torrent-mcp.js
Android integration build
The Android transfer package includes the signed ARM64 APK, Termux installer, corresponding source, checksums, and handoff guide for Hermes with Shizuku.
See the architecture plan, device integration guide, and build validation. The Seeker-derived backend retains its upstream GPL license and additional terms. This alpha has passed build and package checks; live phone integration and playback remain pending.
License
Released under the Viral Public License. The VPL applies its full terms to redistribution and to works that copy, depend on, link to, derive from, or combine with this work.
Available Tools
5 toolsvpn_connectC
Connect NordVPN. Optional argument: country.
Inputs: country.
vpn_disconnectADestructiveIdempotent
Disconnect NordVPN
Inputs: no named parameters.
vpn_public_ipARead-only
Return current public IP address
Inputs: no named parameters.
vpn_require_activeARead-only
Fail unless NordVPN is connected
Inputs: no named parameters.
vpn_statusARead-only
Return NordVPN connection status
Inputs: no named parameters.
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 has a clearly distinct purpose: connect, disconnect, check status, get public IP, and enforce an active connection. No two tools overlap in functionality, reducing the chance of misselection.
All tools share the vpn_ prefix and use snake_case, which is consistent. There is a slight mix of verb-based names (vpn_connect, vpn_disconnect, vpn_require_active) and noun-based names (vpn_status, vpn_public_ip), but the pattern remains predictable and readable.
Five tools is a well-scoped set for a VPN control server, covering the essential operations without unnecessary redundancy. The count is appropriate for the domain and neither sparse nor bloated.
The tool set covers the core VPN lifecycle: connect, disconnect, status, public IP, and an active-connection guard. Minor gaps exist, such as listing available countries or retrieving current server details, but these are not critical for basic workflows and can be worked around.
Maintenance
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
MCP gateway and cloud hosting for MCP servers, agents and apps like RAG, managed from your agent.
One MCP server for all web data. Scrape, search, crawl, and AI research in one install.
Related MCP Servers
- AlicenseAqualityBmaintenanceA Python MCP server that allows programmatic interaction to find torrents programmatically on ThePirateBay, Nyaa and YggTorrent.7281 PyPI43PythonMIT
- AlicenseNot gradedqualityCmaintenanceUnified MCP server for media acquisition, subtitle automation, and agent-run media workflows, enabling downloads via Prowlarr/qBittorrent and subtitle translation/sidecar creation.1MIT
- AlicenseNot gradedqualityCmaintenanceMCP server and CLI for yt-dlp to search and download media, embed metadata and cover art, and deliver to local, SSH, rclone, or Plex targets.3AGPL 3.0
- AlicenseAqualityAmaintenanceA unified MCP server for your self-hosted media stack (Radarr, Sonarr, Jellyfin, etc.). It correlates across services to answer questions no single service can, with safety features like untrusted-output fencing and safe-by-default deletions.240132MIT