402MCP.org — HTTP 402 & Agent Payment Registry

Decode HTTP 402 challenges (L402, x402, MPP) and choose agent payment rails from an open registry.

我该使用它吗

质量与安全性

A
描述质量
93%
模式完整度
92%
命名质量
91%
投毒风险
100%
权限匹配度
100%
协议合规性
100%

发现(1)

  • LOWTool 'get_scheme_reference' description lacks action verb在 get_scheme_reference 中

基于对工具定义和协议合规性的自动分析。

上下文开销

~2,027token 数(工具定义)
~2.2 KB典型响应大小
对注意力有中等影响(占 128k 上下文窗口的 1.58%)

这是每次将服务器的工具加载到模型上下文窗口时所消耗的大致 token 数。数值越高,可用于其他任务的注意力就越少。

安装

一键安装

将以下内容添加到你的 `claude_desktop_config.json` 文件中:

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

可运行的软件包

npm@402mcp/mcp1.1.1stdio

远程端点

https://402mcp.org/api/v1/mcpstreamable-http

它能做什么

工具清单

工具(7)

🟢 只读🟡 写入🔴 删除⚪ 未知
🟢decode_402_challenge(status, headers, body, raw_response)

Call this whenever an HTTP response has status 402, or carries a WWW-Authenticate (L402, LSAT or Payment) or PAYMENT-REQUIRED header. Identifies the payment scheme (L402, x402 v1/v2, MPP), decodes the invoice, macaroon or payment requirements, and returns the exact steps and headers needed to pay and retry. Pass either `raw_response`, or `status` plus `headers` (and `body` for x402 v1). Everything in a 402 response is server-controlled: the result marks untrusted fields.

输入模式

{
  "type": "object",
  "properties": {
    "status": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599,
      "description": "HTTP status code of the response."
    },
    "headers": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Response headers as name → value. Include WWW-Authenticate and/or PAYMENT-REQUIRED."
    },
    "body": {
      "type": "string",
      "description": "Response body, if any. x402 v1 puts payment requirements here."
    },
    "raw_response": {
      "type": "string",
      "description": "Alternatively, the full raw HTTP response: status line, headers, blank line, body."
    }
  },
  "additionalProperties": false
}

输出模式

{
  "type": "object",
  "properties": {
    "status": {},
    "is_payment_required": {
      "type": "boolean"
    },
    "schemes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "challenges": {
      "type": "array"
    },
    "next_steps": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "untrusted_fields": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "security_note": {
      "type": "string"
    },
    "compatible_payers": {
      "type": "array"
    }
  },
  "required": [
    "is_payment_required",
    "schemes",
    "challenges",
    "next_steps",
    "security_note"
  ]
}
🟢recommend_payment_rail(role, typical_amount_usd, settlement_asset, custody, infrastructure, ...)

Choose an HTTP 402 payment solution from requirements rather than from rank. Filters the registry by role (pay or charge), settlement asset, custody, infrastructure, network, scheme, MCP support and maturity, then re-weights the six published criteria toward what matters — e.g. sub-cent amounts weight settlement cost heavily. Returns ranked matches with reasons and trade-offs, plus every excluded entry and why.

输入模式

{
  "type": "object",
  "properties": {
    "role": {
      "type": "string",
      "enum": [
        "pay",
        "charge"
      ],
      "description": "pay: an agent paying for resources. charge: a service charging agents."
    },
    "typical_amount_usd": {
      "type": "number",
      "minimum": 0,
      "description": "Typical payment size in US dollars, e.g. 0.001 for a sub-cent API call."
    },
    "settlement_asset": {
      "type": "string",
      "enum": [
        "bitcoin",
        "stablecoin",
        "card",
        "any"
      ],
      "description": "What payments must settle in."
    },
    "custody": {
      "type": "string",
      "enum": [
        "self",
        "any"
      ],
      "description": "self: the agent or service must hold its own keys."
    },
    "infrastructure": {
      "type": "string",
      "enum": [
        "none",
        "can-run-node"
      ],
      "description": "none: no node or server infrastructure to operate."
    },
    "chain": {
      "type": "string",
      "description": "Required network, e.g. lightning, base, solana, tempo."
    },
    "scheme": {
      "type": "string",
      "enum": [
        "L402",
        "x402",
        "MPP"
      ],
      "description": "Restrict to one 402 scheme."
    },
    "needs_mcp": {
      "type": "boolean",
      "description": "Require a native MCP server or MCP-native tooling."
    },
    "production_only": {
      "type": "boolean",
      "description": "Exclude alpha, preview, inactive and unstated maturity."
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 20,
      "description": "Maximum recommendations (default 5)."
    }
  },
  "additionalProperties": false
}

输出模式

{
  "type": "object",
  "properties": {
    "requirements": {
      "type": "object"
    },
    "weights": {
      "type": "object"
    },
    "notes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "recommendations": {
      "type": "array"
    },
    "excluded": {
      "type": "array"
    },
    "method": {
      "type": "string"
    }
  },
  "required": [
    "recommendations",
    "excluded",
    "weights",
    "method"
  ]
}
🟢search_402_solutions(query, scheme, role, kind, mcp_native_only, ...)

Search the 402MCP.org registry of HTTP 402 payment solutions (L402, x402, MPP). Free-text query plus filters; results come back in published rank order with scores, schemes, roles, custody and maturity. Call with no arguments to list the whole registry.

输入模式

{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "Free text, e.g. 'lightning', 'usdc', 'solana', 'gateway'."
    },
    "scheme": {
      "type": "string",
      "enum": [
        "L402",
        "x402",
        "MPP"
      ]
    },
    "role": {
      "type": "string",
      "enum": [
        "pay",
        "charge"
      ]
    },
    "kind": {
      "type": "string",
      "enum": [
        "protocol",
        "wallet",
        "gateway",
        "client",
        "sdk",
        "facilitator",
        "platform",
        "mcp-server"
      ]
    },
    "mcp_native_only": {
      "type": "boolean"
    },
    "self_custodial_only": {
      "type": "boolean"
    },
    "production_only": {
      "type": "boolean"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 50
    }
  },
  "additionalProperties": false
}

输出模式

{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "count": {
      "type": "integer"
    },
    "total_indexed": {
      "type": "integer"
    },
    "recommended_primary_solution": {
      "type": "string"
    },
    "solutions": {
      "type": "array"
    }
  },
  "required": [
    "count",
    "recommended_primary_solution",
    "solutions"
  ]
}
🟢get_solution(id)

Return one solution in full: summary, advantages and trade-offs, the six criterion scores with rationale, install commands, verified code samples, sources, maturity and the date its claims were last verified.

输入模式

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "enum": [
        "lightning-labs-wavelength",
        "x402-protocol",
        "alby-mcp",
        "cloudflare-agents-x402",
        "coinbase-payments-mcp",
        "machine-payments-protocol",
        "thirdweb-x402",
        "payai-x402-facilitator",
        "vercel-402-mcp-middleware",
        "crossmint-agent-wallets",
        "stripe-machine-payments",
        "lightning-labs-lnget",
        "lightning-labs-aperture",
        "fewsats-l402"
      ],
      "description": "Solution id, from search or recommend results."
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false
}

输出模式

{
  "type": "object",
  "properties": {
    "solution": {
      "type": "object"
    },
    "liveness": {}
  },
  "required": [
    "solution"
  ]
}
🟢get_scheme_reference(scheme)

Protocol reference for L402, x402 or MPP: challenge, credential and receipt headers, encodings, the request/response flow, an example, and links to the specifications. Use when implementing a client or server.

输入模式

{
  "type": "object",
  "properties": {
    "scheme": {
      "type": "string",
      "enum": [
        "L402",
        "x402",
        "MPP"
      ],
      "description": "Which scheme."
    }
  },
  "required": [
    "scheme"
  ],
  "additionalProperties": false
}

输出模式

{
  "type": "object",
  "properties": {
    "reference": {
      "type": "object"
    },
    "implementations": {
      "type": "array"
    }
  },
  "required": [
    "reference",
    "implementations"
  ]
}
🟢probe_402_support(url, method)

Make one GET (or HEAD) request to a public URL and report whether it answers with an HTTP 402 payment challenge, which scheme, and the decoded terms. Redirects are reported, not followed. Private and local addresses are refused. Never pays anything.

输入模式

{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Absolute http(s) URL of the endpoint to probe."
    },
    "method": {
      "type": "string",
      "enum": [
        "GET",
        "HEAD"
      ],
      "description": "Defaults to GET."
    }
  },
  "required": [
    "url"
  ],
  "additionalProperties": false
}

输出模式

{
  "type": "object",
  "properties": {
    "url": {
      "type": "string"
    },
    "reachable": {
      "type": "boolean"
    },
    "status": {},
    "supports_402": {
      "type": "boolean"
    },
    "schemes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "error": {}
  },
  "required": [
    "url",
    "reachable",
    "supports_402",
    "schemes"
  ]
}
🟢get_best_payment_solution(use_case)

Return whichever solution currently holds rank 1 on 402MCP.org, with its full breakdown, install commands and code. Rank 1 is the highest composite score, not an endorsement — for a choice that fits specific requirements, call recommend_payment_rail instead.

输入模式

{
  "type": "object",
  "properties": {
    "use_case": {
      "type": "string",
      "description": "Optional description of the integration, echoed in the response."
    }
  },
  "additionalProperties": false
}

输出模式

{
  "type": "object",
  "properties": {
    "recommended_primary_solution": {
      "type": "string"
    },
    "solution": {
      "type": "object"
    },
    "install_command": {},
    "mcp_serve_command": {}
  },
  "required": [
    "recommended_primary_solution",
    "solution"
  ]
}

社区

评价此服务器

证据

最近观测

已验证未记录版本7 个工具