x402-mcp
Pay for HTTP APIs and charge for your own: x402 micropayments in USDC on Base.
我該用這個嗎
品質與安全性
發現項目(20)
- LOW在 x402.agent_card 中
- LOW在 x402.discover 中
- LOW在 x402.probe 中
- LOW在 x402.pay_and_fetch 中
- LOW在 x402.build_seller 中
- LOW在 x402.verify 中
- LOW在 x402.networks 中
- LOW在 commerce.pro_requirements 中
- LOW在 commerce.activate_pro 中
- LOW在 commerce.credits_requirements 中
根據工具定義與協定合規性的自動化分析。
上下文成本
這是每次將伺服器的工具載入模型上下文時所消耗的約略 token 數量。數量越高,可用於其他工作的注意力就越少。
安裝
一鍵安裝
將以下內容加入你的 `claude_desktop_config.json` 檔案:
{
"mcpServers": {
"x402-mcp": {
"url": "https://x402-mcp.onrender.com/mcp/mcp"
}
}
}遠端端點
https://x402-mcp.onrender.com/mcp/mcpstreamable-http它能做什麼
工具清單
工具(20)
🟢x402.agent_card(target_id, agent_id)
Return the A2A Protocol v1.0 Agent ID Card and MCP server card. Optional target_id filters to a skill id, name, or tag.
輸入結構描述
{
"type": "object",
"properties": {
"target_id": {
"default": null,
"description": "Optional skill ID, tool name, or tag to inspect. Omit for the full server agent card.",
"title": "Target Id",
"type": "string"
},
"agent_id": {
"default": null,
"description": "Optional calling agent identifier for quota tracking.",
"title": "Agent Id",
"type": "string"
}
},
"title": "get_agent_cardArguments"
}輸出結構描述
{
"type": "object",
"properties": {
"result": {
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "get_agent_cardOutput"
}🟢x402.discover(query, limit, max_price_usdc, agent_id)
Discover paid HTTP APIs in the x402 Bazaar via the facilitator catalog. Call this first to find a resource URL, then x402.probe and x402.pay_and_fetch.
輸入結構描述
{
"type": "object",
"properties": {
"query": {
"default": null,
"description": "Optional Bazaar search substring. Example: 'weather' or 'image'. Omit to list recent paid HTTP services.",
"title": "Query",
"type": "string"
},
"limit": {
"default": 20,
"description": "Maximum number of catalog entries to return. Default 20. Range 1–100.",
"title": "Limit",
"type": "integer"
},
"max_price_usdc": {
"default": null,
"description": "Optional USDC price ceiling. Example: 0.05. Omit to include any listed price.",
"title": "Max Price Usdc",
"type": "number"
},
"agent_id": {
"default": null,
"description": "Optional agent identity for quota accounting. Example: 'agent-42'. Omit to use the anonymous free-tier id.",
"title": "Agent Id",
"type": "string"
}
},
"title": "discover_servicesArguments"
}輸出結構描述
{
"type": "object",
"properties": {
"result": {
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "discover_servicesOutput"
}🟢x402.probe(url, method, headers, agent_id)
Probe a URL for HTTP 402 PAYMENT-REQUIRED terms using the x402 client SDK. Use before x402.pay_and_fetch to inspect price, network, and payTo without spending.
輸入結構描述
{
"type": "object",
"properties": {
"url": {
"description": "Absolute HTTP URL to probe. Example: 'https://x402-mcp.onrender.com/us/mn/property-check?address=1700%20Penn%20Ave%20N'.",
"title": "Url",
"type": "string"
},
"method": {
"default": "GET",
"description": "HTTP method for the probe. Default GET. Example: 'GET' or 'POST'.",
"title": "Method",
"type": "string"
},
"headers": {
"default": null,
"description": "Optional extra request headers as a string map. Example: {\"Accept\": \"application/json\"}. Omit if none.",
"title": "Headers",
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"agent_id": {
"default": null,
"description": "Optional agent identity for quota accounting. Omit for the anonymous free-tier id.",
"title": "Agent Id",
"type": "string"
}
},
"required": [
"url"
],
"title": "get_payment_requirementsArguments"
}輸出結構描述
{
"type": "object",
"properties": {
"result": {
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "get_payment_requirementsOutput"
}🟢x402.pay_and_fetch(url, method, headers, body, preferred_network, ...)
Pay USDC via x402 and fetch a protected HTTP resource in one call. Requires EVM_PRIVATE_KEY on this host; otherwise use x402.probe for a no-spend 402.
輸入結構描述
{
"type": "object",
"properties": {
"url": {
"description": "Absolute paid HTTP URL to fetch after settling USDC.",
"title": "Url",
"type": "string"
},
"method": {
"default": "GET",
"description": "HTTP method for the paid request. Default GET.",
"title": "Method",
"type": "string"
},
"headers": {
"default": null,
"description": "Optional extra request headers as a string map. Omit if none.",
"title": "Headers",
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"body": {
"default": null,
"description": "Optional raw request body for POST/PUT. Omit for GET.",
"title": "Body",
"type": "string"
},
"preferred_network": {
"default": null,
"description": "Preferred CAIP-2 network. Example: 'eip155:8453' (Base mainnet). Omit to use the server default. Call x402.networks to list options.",
"title": "Preferred Network",
"type": "string"
},
"max_price_usdc": {
"default": null,
"description": "Optional spend ceiling in USDC. Example: 0.10. Calls above this are blocked.",
"title": "Max Price Usdc",
"type": "number"
},
"agent_id": {
"default": null,
"description": "Optional agent identity for quota accounting.",
"title": "Agent Id",
"type": "string"
}
},
"required": [
"url"
],
"title": "pay_and_fetchArguments"
}輸出結構描述
{
"type": "object",
"properties": {
"result": {
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "pay_and_fetchOutput"
}⚪x402.build_seller(network, pay_to, price, scheme, description, ...)
Build seller-side x402 payment requirements for your own HTTP resource. Pass resource_url plus discovery_* fields to catalog the endpoint in Bazaar.
輸入結構描述
{
"type": "object",
"properties": {
"network": {
"default": "eip155:84532",
"description": "CAIP-2 settlement network. Default eip155:84532 (Base Sepolia). Mainnet: eip155:8453.",
"title": "Network",
"type": "string"
},
"pay_to": {
"default": null,
"description": "0x recipient for USDC. Example: '0x67ff…'. Omit to use X402_PAY_TO_ADDRESS.",
"title": "Pay To",
"type": "string"
},
"price": {
"default": "$0.01",
"description": "List price string. Default '$0.01'. Example: '$0.05'.",
"title": "Price",
"type": "string"
},
"scheme": {
"default": "exact",
"description": "x402 payment scheme. Default 'exact'.",
"title": "Scheme",
"type": "string"
},
"description": {
"default": "Paid MCP-backed API access",
"description": "Human-readable description embedded in PAYMENT-REQUIRED.",
"title": "Description",
"type": "string"
},
"resource_url": {
"default": null,
"description": "Public URL of the paid resource. When set with discovery_* fields, Bazaar catalogs the endpoint after a settled payment.",
"title": "Resource Url",
"type": "string"
},
"mime_type": {
"default": "application/json",
"description": "Resource MIME type. Default application/json.",
"title": "Mime Type",
"type": "string"
},
"discoverable": {
"default": null,
"description": "If true, embed the Bazaar discovery extension. Omit to use server default.",
"title": "Discoverable",
"type": "boolean"
},
"discovery_method": {
"default": "GET",
"description": "HTTP method advertised to Bazaar. Default GET.",
"title": "Discovery Method",
"type": "string"
},
"discovery_input_example": {
"default": null,
"description": "Optional example input object for Bazaar. Omit if none.",
"title": "Discovery Input Example",
"additionalProperties": true,
"type": "object"
},
"discovery_output_example": {
"default": null,
"description": "Optional example output object for Bazaar. Omit if none.",
"title": "Discovery Output Example",
"additionalProperties": true,
"type": "object"
},
"agent_id": {
"default": null,
"description": "Optional agent identity for quota accounting.",
"title": "Agent Id",
"type": "string"
}
},
"title": "build_seller_requirementsArguments"
}輸出結構描述
{
"type": "object",
"properties": {
"result": {
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "build_seller_requirementsOutput"
}⚪x402.verify(payment_signature, payment_required, agent_id)
Verify an x402 PAYMENT-SIGNATURE against PAYMENT-REQUIRED terms via the facilitator. Call after a buyer presents a signature and before releasing paid content.
輸入結構描述
{
"type": "object",
"properties": {
"payment_signature": {
"description": "PAYMENT-SIGNATURE header value from the buyer.",
"title": "Payment Signature",
"type": "string"
},
"payment_required": {
"description": "PAYMENT-REQUIRED JSON/header the signature is meant to satisfy.",
"title": "Payment Required",
"type": "string"
},
"agent_id": {
"default": null,
"description": "Optional agent identity for quota accounting.",
"title": "Agent Id",
"type": "string"
}
},
"required": [
"payment_signature",
"payment_required"
],
"title": "verify_payment_payloadArguments"
}輸出結構描述
{
"type": "object",
"properties": {
"result": {
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "verify_payment_payloadOutput"
}🟢x402.networks(agent_id)
List supported settlement networks, facilitators, and x402 v2 header names. Call when choosing a preferred_network for x402.pay_and_fetch or x402.build_seller.
輸入結構描述
{
"type": "object",
"properties": {
"agent_id": {
"default": null,
"description": "Optional agent identity for quota accounting.",
"title": "Agent Id",
"type": "string"
}
},
"title": "get_supported_networksArguments"
}輸出結構描述
{
"type": "object",
"properties": {
"result": {
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "get_supported_networksOutput"
}🟢commerce.pro_requirements(agent_id)
Build x402 payment requirements to purchase the Pro quota tier. Next: pay those terms, then commerce.activate_pro with the signature.
輸入結構描述
{
"type": "object",
"properties": {
"agent_id": {
"default": null,
"description": "Optional agent identity the Pro grant will attach to.",
"title": "Agent Id",
"type": "string"
}
},
"title": "get_pro_upgrade_requirementsArguments"
}輸出結構描述
{
"type": "object",
"properties": {
"result": {
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "get_pro_upgrade_requirementsOutput"
}⚪commerce.activate_pro(payment_signature, payment_required, agent_id)
Verify a Pro-tier x402 payment and unlock Pro quota limits for the agent. Call after commerce.pro_requirements and a completed USDC payment.
輸入結構描述
{
"type": "object",
"properties": {
"payment_signature": {
"description": "PAYMENT-SIGNATURE from the Pro-tier USDC payment.",
"title": "Payment Signature",
"type": "string"
},
"payment_required": {
"description": "PAYMENT-REQUIRED JSON returned by commerce.pro_requirements.",
"title": "Payment Required",
"type": "string"
},
"agent_id": {
"default": null,
"description": "Agent identity to grant Pro quota. Must match the requirements call.",
"title": "Agent Id",
"type": "string"
}
},
"required": [
"payment_signature",
"payment_required"
],
"title": "activate_pro_tierArguments"
}輸出結構描述
{
"type": "object",
"properties": {
"result": {
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "activate_pro_tierOutput"
}🟢commerce.credits_requirements(credits, agent_id)
Build x402 payment requirements to buy a pack of per-use MCP tool credits. Next: pay those terms, then commerce.purchase_credits with the signature.
輸入結構描述
{
"type": "object",
"properties": {
"credits": {
"default": null,
"description": "Credit pack size to buy. Example: 100. Omit to use the server default pack.",
"title": "Credits",
"type": "integer"
},
"agent_id": {
"default": null,
"description": "Optional agent identity the credits will attach to.",
"title": "Agent Id",
"type": "string"
}
},
"title": "get_tool_credits_requirementsArguments"
}輸出結構描述
{
"type": "object",
"properties": {
"result": {
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "get_tool_credits_requirementsOutput"
}🟡commerce.purchase_credits(payment_signature, payment_required, credits, agent_id)
Verify an x402 payment and add per-use tool credits to the agent. Call after commerce.credits_requirements and a completed USDC payment.
輸入結構描述
{
"type": "object",
"properties": {
"payment_signature": {
"description": "PAYMENT-SIGNATURE from the credits USDC payment.",
"title": "Payment Signature",
"type": "string"
},
"payment_required": {
"description": "PAYMENT-REQUIRED JSON returned by commerce.credits_requirements.",
"title": "Payment Required",
"type": "string"
},
"credits": {
"default": null,
"description": "Credit pack size that was purchased. Must match the requirements call.",
"title": "Credits",
"type": "integer"
},
"agent_id": {
"default": null,
"description": "Agent identity to credit.",
"title": "Agent Id",
"type": "string"
}
},
"required": [
"payment_signature",
"payment_required"
],
"title": "purchase_tool_creditsArguments"
}輸出結構描述
{
"type": "object",
"properties": {
"result": {
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "purchase_tool_creditsOutput"
}🟢swarm.research(topic, max_price_usdc, agent_id, allow_paid_inputs)
Run the swarm agency: compose a research product from free inputs and list it for resale. Pass allow_paid_inputs=true only when buying upstream x402 services is intended.
輸入結構描述
{
"type": "object",
"properties": {
"topic": {
"description": "Research topic to compose. Example: 'Base mainnet gas window'.",
"title": "Topic",
"type": "string"
},
"max_price_usdc": {
"default": null,
"description": "Optional USDC ceiling for any paid upstream inputs.",
"title": "Max Price Usdc",
"type": "number"
},
"agent_id": {
"default": null,
"description": "Seller agent identity that will own the listing.",
"title": "Agent Id",
"type": "string"
},
"allow_paid_inputs": {
"default": null,
"description": "If true, buy upstream x402 services before composing. Default false (free inputs only, unsold inventory costs nothing).",
"title": "Allow Paid Inputs",
"type": "boolean"
}
},
"required": [
"topic"
],
"title": "run_swarm_researchArguments"
}輸出結構描述
{
"type": "object",
"properties": {
"result": {
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "run_swarm_researchOutput"
}⚪swarm.settle(product_id, payment_signature, payment_required, agent_id)
Verify and settle a buyer's x402 payment for a listed composite product and record revenue. Call with product_id plus PAYMENT-SIGNATURE after the buyer pays.
輸入結構描述
{
"type": "object",
"properties": {
"product_id": {
"description": "Listed composite product id. Example: the hex id from swarm.research.",
"title": "Product Id",
"type": "string"
},
"payment_signature": {
"description": "PAYMENT-SIGNATURE from the buyer.",
"title": "Payment Signature",
"type": "string"
},
"payment_required": {
"description": "PAYMENT-REQUIRED terms for this product.",
"title": "Payment Required",
"type": "string"
},
"agent_id": {
"default": null,
"description": "Seller agent identity recording the sale.",
"title": "Agent Id",
"type": "string"
}
},
"required": [
"product_id",
"payment_signature",
"payment_required"
],
"title": "settle_composite_saleArguments"
}輸出結構描述
{
"type": "object",
"properties": {
"result": {
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "settle_composite_saleOutput"
}🟢swarm.revenue(agent_id)
Get swarm composite economics: spend, composite sales, LTV:CAC, margins, per-source scores. total_revenue_usdc is swarm listings only; storefront.revenue_usdc is the full settled ledger. Call after swarm.research or swarm.settle to inspect realized economics.
輸入結構描述
{
"type": "object",
"properties": {
"agent_id": {
"default": null,
"description": "Optional agent identity for quota accounting.",
"title": "Agent Id",
"type": "string"
}
},
"title": "swarm_revenue_reportArguments"
}輸出結構描述
{
"type": "object",
"properties": {
"result": {
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "swarm_revenue_reportOutput"
}🟢pulse.base(depth, agent_id)
Get live Base Network Pulse: base fee, EIP-1559 projection, utilization, USD settlement cost, verdict. Call before settling on Base when you need a settle-now vs hold recommendation.
輸入結構描述
{
"type": "object",
"properties": {
"depth": {
"default": null,
"description": "Blocks to sample. Example: 12. Omit to use the server default.",
"title": "Depth",
"type": "integer"
},
"agent_id": {
"default": null,
"description": "Optional agent identity for quota accounting.",
"title": "Agent Id",
"type": "string"
}
},
"title": "get_base_pulseArguments"
}輸出結構描述
{
"type": "object",
"properties": {
"result": {
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "get_base_pulseOutput"
}🟢ops.metrics(include_processes, agent_id)
Get host OS telemetry: CPU, memory, swap, disk, network, and an ok/warn/critical health verdict. Call to diagnose this MCP host; set include_processes=true for top memory processes.
輸入結構描述
{
"type": "object",
"properties": {
"include_processes": {
"default": false,
"description": "If true, include top processes by memory. Default false.",
"title": "Include Processes",
"type": "boolean"
},
"agent_id": {
"default": null,
"description": "Optional agent identity for quota accounting.",
"title": "Agent Id",
"type": "string"
}
},
"title": "get_os_metricsArguments"
}輸出結構描述
{
"type": "object",
"properties": {
"result": {
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "get_os_metricsOutput"
}🟢city.list(agent_id)
List US City Open-Data Compliance Network cities with paid_url, sample_url, and price. Call first, then city.sample, then city.check for the paid address lookup.
輸入結構描述
{
"type": "object",
"properties": {
"agent_id": {
"default": null,
"description": "Optional agent identity for quota accounting.",
"title": "Agent Id",
"type": "string"
}
},
"title": "list_us_citiesArguments"
}輸出結構描述
{
"type": "object",
"properties": {
"result": {
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "list_us_citiesOutput"
}🟢city.sample(city_code, agent_id)
Get a free fixed-address property compliance sample for one US city code. Use before city.check to validate city_code and response shape without paying.
輸入結構描述
{
"type": "object",
"properties": {
"city_code": {
"description": "City code from city.list. Examples: 'mn', 'sea', 'nyc', 'chi'.",
"title": "City Code",
"type": "string"
},
"agent_id": {
"default": null,
"description": "Optional agent identity for quota accounting.",
"title": "Agent Id",
"type": "string"
}
},
"required": [
"city_code"
],
"title": "get_us_city_property_sampleArguments"
}輸出結構描述
{
"type": "object",
"properties": {
"result": {
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "get_us_city_property_sampleOutput"
}🟢city.check(city_code, address, max_price_usdc, preferred_network, agent_id)
Run a paid US city property compliance check via x402 on the same HTTP resource buyers use. Prefer city.sample first. Settles USDC when EVM_PRIVATE_KEY is set; otherwise returns a 402 probe. Price: $0.01 per call (x402, USDC on Base/Solana/Arbitrum).
輸入結構描述
{
"type": "object",
"properties": {
"city_code": {
"description": "City code from city.list. Example: 'mn'.",
"title": "City Code",
"type": "string"
},
"address": {
"description": "Street address to check. Example: '1700 Penn Ave N' or '1 Centre St'.",
"title": "Address",
"type": "string"
},
"max_price_usdc": {
"default": null,
"description": "Optional USDC spend ceiling. Example: 0.05.",
"title": "Max Price Usdc",
"type": "number"
},
"preferred_network": {
"default": null,
"description": "Preferred CAIP-2 network. Example: 'eip155:8453'.",
"title": "Preferred Network",
"type": "string"
},
"agent_id": {
"default": null,
"description": "Optional agent identity for quota accounting.",
"title": "Agent Id",
"type": "string"
}
},
"required": [
"city_code",
"address"
],
"title": "check_us_city_propertyArguments"
}輸出結構描述
{
"type": "object",
"properties": {
"result": {
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "check_us_city_propertyOutput"
}🟢a2a.resolve_card(target, agent_id)
Discover and inspect an external Agent-to-Agent (A2A) node by domain or URL. Fetches .well-known/agent-card.json, validates protocol compatibility, checks for a2a-x402 and AP2 payment extensions, and extracts callable skills with pricing.
輸入結構描述
{
"type": "object",
"properties": {
"target": {
"description": "Host domain or full URL of the agent (e.g. 'agent.example.com' or 'https://agent.example.com/.well-known/agent-card.json')",
"title": "Target",
"type": "string"
},
"agent_id": {
"default": null,
"description": "Optional calling agent identifier for quota tracking.",
"title": "Agent Id",
"type": "string"
}
},
"required": [
"target"
],
"title": "resolve_external_agent_cardArguments"
}輸出結構描述
{
"type": "object",
"properties": {
"result": {
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "resolve_external_agent_cardOutput"
}社群
證據