New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@402mcp/mcp

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@402mcp/mcp

MCP server for HTTP 402 agent payments: decode L402, x402 and MPP challenges, choose a payment rail from requirements, and search an independent registry.

latest
Source
npmnpm
Version
1.1.1
Version published
Weekly downloads
562
Maintainers
1
Weekly downloads
 
Created
Source

@402mcp/mcp

MCP server for HTTP 402 agent payments, from 402MCP.org — an independent registry of L402, x402 and MPP payment infrastructure.

When your agent receives an HTTP 402 Payment Required, it can ask this server what the response means and exactly how to pay and retry. When you are choosing how an agent should pay — or how your API should charge agents — it recommends a rail from your requirements rather than a ranking.

Install

Claude Desktop, Cursor, Windsurf and other stdio clients:

{
  "mcpServers": {
    "402mcp": { "command": "npx", "args": ["-y", "@402mcp/mcp"] }
  }
}

Claude Code:

claude mcp add 402mcp -- npx -y @402mcp/mcp

Prefer no local process? The same server is hosted at https://402mcp.org/api/v1/mcp (streamable HTTP).

Tools

ToolWhat it does
decode_402_challengeDecodes a 402 response — L402 (macaroon + BOLT 11), x402 v1/v2, or MPP — into the exact steps and retry header. Flags expired challenges, macaroons that don't match their invoice, and every server-controlled field.
recommend_payment_railFilters by role, asset, custody, infrastructure, network, scheme and maturity, then re-weights the published criteria toward what you need. Returns trade-offs and every exclusion with its reason.
search_402_solutionsSearches the registry with filters.
get_solutionOne entry in full: scores and rationale, verified snippets, sources, last-verified date.
get_scheme_referenceWire format of L402, x402 or MPP.
probe_402_supportOne GET to a URL: does it speak 402, and which scheme? Never pays.
get_best_payment_solutionThe current rank-1 entry.

Plus resources (402mcp://registry, 402mcp://solutions/{id}, 402mcp://schemes/{scheme}, 402mcp://methodology) and two prompts (choose_payment_rail, handle_402_response).

Privacy and safety

  • Decoding runs locally. Nothing you decode is sent anywhere.
  • At startup the server refreshes the registry from https://402mcp.org/api/v1/registry; if that fails it uses the snapshot bundled in the package. Set MCP_402_OFFLINE=1 to never fetch.
  • Probing makes one request from your machine to the URL you name. Loopback, private and link-local addresses are refused — including hostnames that resolve to them — unless you set MCP_402_ALLOW_PRIVATE_PROBES=1.
  • No tool can spend money. Everything in a 402 response is chosen by the server; the decoder marks those fields untrusted and never repeats their text as instructions.

Environment

VariableEffect
MCP_402_OFFLINE=1Use the bundled registry only
MCP_402_REGISTRY_URLRefresh from a mirror instead
MCP_402_ALLOW_PRIVATE_PROBES=1Allow probing localhost and private networks

Independence

402MCP.org is not affiliated with, sponsored by, or compensated by any vendor it indexes. Scores are the unweighted mean of six published criteria, and every entry lists its sources. Methodology: https://402mcp.org/docs#methodology

Registry data: CC BY 4.0. Code: MIT.

Keywords

mcp

FAQs

Package last updated on 16 Oct 2026

Related posts