Back to Browse

X402 MCP Server

Developer ToolsUse Caution4.8MCP RegistryLocal
Free

Server data from the Official MCP Registry

Local MCP server that signs x402 USDC payments (Solana, EVM) to buy PrivadoVPN access

About

Local MCP server that signs x402 USDC payments (Solana, EVM) to buy PrivadoVPN access

Security Report

4.8
Use Caution4.8High Risk

This is a well-designed MCP server for signing and broadcasting x402 USDC payments with appropriate security controls. Private keys are loaded from environment variables and used only for in-process signing, never transmitted over the network. The code properly validates inputs, handles errors with informative messages to prevent duplicate charges, and implements proper balance checks before payment. Minor code quality observations exist but do not constitute security vulnerabilities. Supply chain analysis found 5 known vulnerabilities in dependencies (1 critical, 3 high severity). Package verification found 1 issue.

7 files analyzed · 9 issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

env_vars

Check that this permission is expected for this type of plugin.

HTTP Network Access

Connects to external APIs or services over the internet.

File System Write

Writes or modifies files on your machine. Check that this is expected for the tool.

File System Read

Reads files on your machine. Normal for tools that analyze or process local data.

What You'll Need

Set these up before or after installing:

Base58-encoded Solana secret key used to sign and pay in SPL USDC. At least one of SOLANA_PRIVATE_KEY or EVM_PRIVATE_KEY is required.Required

Environment variable: SOLANA_PRIVATE_KEY

Hex-encoded EVM private key used to sign EIP-3009 USDC authorizations. At least one of SOLANA_PRIVATE_KEY or EVM_PRIVATE_KEY is required.Required

Environment variable: EVM_PRIVATE_KEY

Which network to prefer when a quote offers both. Accepts 'solana' or 'evm' ('eip155' is an accepted alias for 'evm'). Defaults to 'solana' if SOLANA_PRIVATE_KEY is set, else 'evm'.Optional

Environment variable: PREFERRED_NETWORK

Base URL of the x402 payment backend used for catalog, quote, and fulfillment requests. Defaults to https://x402.privadovpn.com.Optional

Environment variable: X402_BASE_URL

Solana RPC endpoint used to check balances and broadcast transactions. Defaults to https://api.mainnet-beta.solana.com.Optional

Environment variable: SOLANA_RPC_URL

EVM RPC endpoint used to check balances and broadcast transactions. Required for EVM payments.Optional

Environment variable: EVM_RPC_URL

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-privadovpn-x402-mcp": {
      "env": {
        "EVM_RPC_URL": "your-evm-rpc-url-here",
        "X402_BASE_URL": "your-x402-base-url-here",
        "SOLANA_RPC_URL": "your-solana-rpc-url-here",
        "EVM_PRIVATE_KEY": "your-evm-private-key-here",
        "PREFERRED_NETWORK": "your-preferred-network-here",
        "SOLANA_PRIVATE_KEY": "your-solana-private-key-here"
      },
      "args": [
        "-y",
        "@privadovpn/x402-mcp"
      ],
      "command": "npx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

@privadovpn/x402-mcp

Local stdio MCP server that signs and broadcasts x402 USDC payments (Solana, EVM) to buy PrivadoVPN access.

npm version CI license MCP registry

Security model

This server signs payments locally and never transmits your private key anywhere.

  • SOLANA_PRIVATE_KEY and EVM_PRIVATE_KEY are read from local process environment variables. They are used only to sign transactions in-process and are never sent over the network or written to disk by this server.
  • The only data that leaves the machine is a signed payment authorization (EVM EIP-3009) or a broadcast transaction signature (Solana), sent to X402_BASE_URL to fulfill a purchase.
  • Use a dedicated, low-balance wallet for this server — never point it at a primary or high-balance wallet.
  • wallet_status returns configured addresses and network selection only. It never returns private keys or any secret material.
  • Credentials returned after a successful purchase are written only to ~/.privado/ on your local machine.

Quick start

npx -y @privadovpn/x402-mcp

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "privadovpn-x402-mcp": {
      "command": "npx",
      "args": ["-y", "@privadovpn/x402-mcp"],
      "env": {
        "SOLANA_PRIVATE_KEY": "<your-base58-key>"
      }
    }
  }
}

Claude Code:

claude mcp add privadovpn-x402-mcp -e SOLANA_PRIVATE_KEY=<your-base58-key> -- npx -y @privadovpn/x402-mcp

Cursor (.cursor/mcp.json):

{
  "mcpServers": {
    "privadovpn-x402-mcp": {
      "command": "npx",
      "args": ["-y", "@privadovpn/x402-mcp"],
      "env": {
        "SOLANA_PRIVATE_KEY": "<your-base58-key>"
      }
    }
  }
}

Configuration

VariableRequiredDefaultDescription
SOLANA_PRIVATE_KEYAt least one of SOLANA_PRIVATE_KEY / EVM_PRIVATE_KEY—Base58-encoded Solana secret key (32 or 64 bytes) used to sign and pay in SPL USDC.
EVM_PRIVATE_KEYAt least one of SOLANA_PRIVATE_KEY / EVM_PRIVATE_KEY—Hex-encoded EVM private key used to sign EIP-3009 USDC authorizations.
PREFERRED_NETWORKNosolana if SOLANA_PRIVATE_KEY is set, else evmWhich network to prefer when a quote offers both. Accepts solana or evm (eip155 is an accepted alias for evm).
X402_BASE_URLNohttps://x402.privadovpn.comBase URL of the x402 payment backend used for catalog, quote, and fulfillment requests.
SOLANA_RPC_URLNohttps://api.mainnet-beta.solana.comSolana RPC endpoint used to check balances and broadcast transactions.
EVM_RPC_URLRequired for EVM payments—EVM RPC endpoint used to check balances and broadcast transactions.

Tools

ToolPurpose
wallet_statusShow configured wallet addresses and network selection. Never returns private keys.
list_vpn_catalogList purchasable VPN plans and supported server country codes.
buy_vpnPreferred purchase flow: quote, sign and pay on-chain, fulfill, and save credentials in one call.
fulfill_paymentRecovery only: exchange an already-broadcast payment for VPN credentials.
sign_and_payDebug only: sign and broadcast payment without fulfilling. Prefer buy_vpn.

Purchase flow and recovery

Each GET /pay request creates a new invoice on the server. Because of this, buy_vpn must be called exactly once per purchase attempt — calling it again after funds have already been sent creates a second invoice and results in a duplicate charge.

If buy_vpn reports that the on-chain payment succeeded but fulfillment failed (for example, due to a network error when exchanging the payment for credentials), do not call buy_vpn again. Instead call fulfill_payment with the plan, invoice_no, payment_signature, and settlement_tx values from the error. This exchanges the already-completed payment for credentials without creating a new invoice or sending additional funds.

buy_vpn and sign_and_pay both accept a dry_run flag that performs balance checks without broadcasting a transaction. Note that a dry run still creates a real invoice on the server; it does not need to be followed by a real purchase, but it should not be repeated for the same purchase attempt.

How it works

sequenceDiagram
    participant Agent
    participant MCP as Local MCP (this server)
    participant Backend as x402.privadovpn.com

    Agent->>MCP: buy_vpn(plan, country)
    MCP->>Backend: GET /pay?plan=...
    Backend-->>MCP: 402 Payment Required + quote (accepts[])
    MCP->>MCP: sign payment locally (private key never leaves process)
    MCP->>Backend: broadcast transaction on-chain
    Backend-->>MCP: transaction confirmed
    MCP->>Backend: GET /pay (PAYMENT-SIGNATURE, X-Settlement-Transaction)
    Backend-->>MCP: VPN credentials
    MCP-->>Agent: credentials + settlement_tx + credentials_path

Supported networks: Solana (SPL USDC transfer) and EVM (EIP-3009 transferWithAuthorization USDC).

Server-side discovery

  • Catalog and payment discovery: https://x402.privadovpn.com/.well-known/x402-payment
  • Agent-readable service description: https://x402.privadovpn.com/llms.txt
  • Remote MCP (catalog/docs only, no wallet access): https://x402.privadovpn.com/mcp

Development

git clone git@github.com:privadovpn/x402-mcp.git
cd x402-mcp
npm install
npm run build
npm test

Run with the MCP Inspector:

npx @modelcontextprotocol/inspector node dist/index.js

License

MIT. See LICENSE.

mcp-name: io.github.privadovpn/x402-mcp

Reviews

No reviews yet

Be the first to review this server!