Skip to main content
Glama
bonklek
by bonklek

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-tools provides the same operations as a JSON-first command-line interface.

  • vpn-mcp controls and inspects a supported NordVPN CLI.

  • torrent-mcp exposes explicit jackett_* and qbittorrent_* tools.

All three entrypoints share one configuration loader, validated operation layer, network guard, normalized responses, credential/path redaction, and fixed public errors. The MCP servers use stdio and keep VPN lifecycle separate from torrent lifecycle.

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

Supported CLI

Supported command switches

Not supported by this adapter

Status and vpn_require_active

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.

Related MCP server: MPilot

Requirements

  • Node.js 20 or newer. CI currently tests Node.js 24 on Windows, macOS, and Linux.

  • Jackett for search and indexer operations.

  • qBittorrent with its Web UI enabled for torrent operations.

  • A supported NordVPN CLI only when using vpn-mcp or the built-in network guard.

Quick start

From a reviewed source checkout:

npm ci
npm test
npm run build

The 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.

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.

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 vpn status
p2p-tools jackett search --query "example query" --limit 25
p2p-tools qbit list --filter downloading

The CLI writes the same { "ok": true, "data": ... } and { "ok": false, "error": ... } envelopes as the MCP tools. It exits with 0 for success, 1 for an operation failure, and 2 for invalid invocation or configuration. Use --stdin to supply a JSON object 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_status

  • vpn_connect

  • vpn_disconnect

  • vpn_public_ip

  • vpn_require_active

torrent-mcp, Jackett:

  • jackett_test_connection

  • jackett_search

  • jackett_caps

  • jackett_list_indexers

  • jackett_get_category

torrent-mcp, qBittorrent:

  • qbittorrent_test_connection

  • qbittorrent_add_magnet

  • qbittorrent_add_torrent_url

  • qbittorrent_list_torrents

  • qbittorrent_get_torrent

  • qbittorrent_pause_torrent

  • qbittorrent_resume_torrent

  • qbittorrent_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_ip contacts an external IP-check service and returns the current public IP.

  • qbittorrent_delete_torrent keeps downloaded files unless delete_files: true is supplied.

  • The network guard is fail-closed for configured operations, but it does not connect the VPN automatically.

Documentation

Development

npm test          # Vitest suite
npm run check     # TypeScript validation without output
npm run build     # compile into dist/

Generated binaries:

  • dist/p2p-tools.js

  • dist/vpn-mcp.js

  • dist/torrent-mcp.js

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 tools
vpn_connectC

Connect NordVPN. Optional argument: country.

ParametersJSON Schema
NameRequiredDescriptionDefault
countryNo

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action but gives no detail on side effects, such as whether connecting interrupts an existing VPN session, whether it blocks until the connection is established, or what happens on failure. It does not explicitly contradict annotations, but it is far from sufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is exceptionally brief (two sentences, six words) and wastes no words. It front-loads the core purpose and mentions the only parameter. However, it is slightly too terse to serve as a complete guide, though the conciseness itself is appropriate.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that this is a network-changing tool with no annotations, no output schema, and only one undocumented parameter, the description is too sparse to be considered complete. It lacks information about the connection behavior, prerequisites, fallback options, and how it relates to sibling tools like vpn_require_active. A description of this length leaves critical gaps for an agent to invoke the tool safely and correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has one parameter 'country' with no description; coverage is 0%. The description says 'Optional argument: country,' which adds the fact that it is optional (though schema already implies this via 'required: 0') and identifies its purpose as a country selector. However, it does not provide valid values, expected format (e.g., two-letter code vs. full name), or example inputs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Connect') and the resource ('NordVPN'), which is specific and unambiguous. It naturally distinguishes from siblings like vpn_status, vpn_disconnect, and vpn_public_ip by indicating a connection-establishing operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The only guidance is 'Optional argument: country,' which indicates a parameter but provides no context on when to use this tool versus alternatives. It does not mention that vpn_status is for checking connection, vpn_disconnect for terminating, or any prerequisites like having config files or authenticated sessions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

vpn_disconnectA
DestructiveIdempotent

Disconnect NordVPN

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds no behavioral details beyond the annotations. While idempotentHint and destructiveHint are declared, the description doesn't explain what disconnecting entails (e.g., terminates the active session, safe when already disconnected), so it fails to enrich the annotation-provided safety profile.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The one-sentence description is extremely concise and front-loaded, with every word contributing to clarity. There is no redundancy or filler, making it an efficient and effective statement of purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter tool with no output schema, the description is minimally sufficient. However, it doesn't state what happens if no VPN connection is active, though the idempotentHint annotation indirectly covers this, so the completeness is adequate but not exhaustive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the schema is fully covered by default. Per the rubric, a baseline of 4 is appropriate when no parameters exist, and the description adds no unnecessary parameter-related text.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Disconnect NordVPN' clearly specifies the action (disconnect) and the target resource (NordVPN), making it unambiguous and distinct from sibling tools like vpn_connect and vpn_status.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It lacks context about prerequisites, typical scenarios, or exclusions, leaving the agent to infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

vpn_public_ipA
Read-only

Return current public IP address

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotation readOnlyHint: true already indicates a safe read operation. The description's 'Return' aligns with that and adds no additional behavioral context (e.g., no mention of VPN-specific behavior, possible latency, or errors). It does not contradict the annotation, but it also does not provide extra transparency beyond what the annotation and the basic description show.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that directly states the purpose without any filler or redundant information. It is front-loaded and easy to parse, making it an model of efficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no parameters, no output schema, and a simple read-only operation, the description provides complete context: it clearly states what the tool returns (the current public IP address). The tool name and sibling names provide the VPN context, so the description is sufficiently complete for an agent to select and invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the description is not required to explain parameter semantics. The description implicitly conveys the return value (the IP address) by stating 'Return current public IP address', which is useful given the absence of an output schema. Following the baseline of 4 for zero-parameter tools, this is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's action with a specific verb ('Return') and resource ('current public IP address'). It is easily distinguishable from sibling tools like vpn_status, vpn_connect, vpn_disconnect, and vpn_require_active, which focus on connection state and control.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage: if you need the current public IP address, you use this tool. However, it does not explicitly state when to use it versus alternatives or provide any contextual exclusions. The simple nature of the tool makes the implied usage fairly clear, but there is no explicit guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

vpn_require_activeA
Read-only

Fail unless NordVPN is connected

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The readOnlyHint annotation already indicates a safe, side-effect-free operation. The description adds behavioral context by disclosing that the tool fails when the VPN is not connected, which is beyond the annotation. It does not detail the exact failure mode but provides essential gating behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that immediately conveys the tool's function without any filler. It is perfectly front-loaded and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter assertion tool with a read-only annotation, the description is contextually complete. It tells the agent exactly when it fails (when VPN is not connected) and implicitly when it passes. No output schema or return value details are necessary for this simple guard behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With zero parameters, the baseline score of 4 applies. There is no parameter information to add, and the description is not required to compensate for any missing schema details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: it fails unless NordVPN is connected. The verb 'fail' and resource 'NordVPN' make the purpose unmistakable, and it is clearly distinct from siblings like vpn_status (which reports status) and vpn_connect (which establishes a connection).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The usage is implied as a guard for operations requiring an active VPN, but the description does not explicitly say when to use it versus alternatives like vpn_status, nor does it mention exclusions or prerequisites. There is no alternative guidance, so it only meets the 'implied usage' level.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

vpn_statusA
Read-only

Return NordVPN connection status

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotation readOnlyHint=true already signals this is a safe read operation, so the description adds no additional behavioral context. It does not disclose what the status output looks like, whether it can fail when disconnected, or any other nuances, providing minimal value beyond the structured annotation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single short sentence that delivers exactly the needed information. Every word earns its place with no redundancy or unnecessary detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity, the description is adequate, but it lacks any explanation of the return value format (e.g., boolean, string). Since there is no output schema, the description should clarify what 'connection status' means to fully prepare the agent, but the one-line description is still a minimal viable explanation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and the schema is empty, so there is nothing to document. Baseline 4 applies because no parameter explanation is needed, and the description does not introduce any ambiguity.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a clear verb ('Return') and a specific resource ('NordVPN connection status'), which precisely states the tool's function. It distinguishes from siblings like vpn_connect/vpn_disconnect (actions) and vpn_public_ip (a different data point), leaving no ambiguity about what is checked.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus alternatives. The description does not mention sibling tools or provide context such as 'use to verify connectivity before other operations,' leaving the agent without explicit direction on when this tool is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.7/5.0
Disambiguation5/5

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.

Naming Consistency4/5

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.

Tool Count5/5

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.

Completeness4/5

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

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Unified MCP server for media acquisition, subtitle automation, and agent-run media workflows, enabling downloads via Prowlarr/qBittorrent and subtitle translation/sidecar creation.
    1
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    A 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.
    16
    MIT

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/bonklek/p2p-tools-mcp'

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