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

@suverselabs/x402-mcp

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@suverselabs/x402-mcp

Model Context Protocol server for buyer-side x402. Lets AI agents discover, compare, and call paid x402 APIs across our catalog and the wider ecosystem — pays automatically via @suverselabs/x402-client.

latest
Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
12
-55.56%
Maintainers
1
Weekly downloads
 
Created
Source

@suverselabs/x402-mcp

Model Context Protocol server for buyer-side x402. Lets an AI agent — Claude Desktop, Cursor, anything that speaks MCP — discover paid HTTP APIs across the suverse-pay catalog and the wider x402 ecosystem, compare them, and call them with automatic USDC payment.

Buyers install this. Sellers want @suverselabs/x402-server instead.

What it does

Four tools, surfaced to your AI client:

ToolWhat it does
catalog_searchFind paid x402 APIs by free-text query. Returns top matches with price, accepted networks, and a short description.
catalog_compareSide-by-side comparison of 2–10 listings by price / chains / category.
buy_and_callMake an HTTP request. If the response is a 402 challenge, the MCP signs + pays + retries automatically using the wallet keys you configured. Returns { data, payment receipt }.
list_recent_purchasesWhat did this agent buy lately, totalled in USDC. Local JSONL history; nothing leaves your machine.

Pays via @suverselabs/x402-client — works across 18 EVM mainnets (Base/Polygon/Arbitrum/…), Solana mainnet/devnet, Cosmos Noble, TRON.

Install

The MCP runs on demand via npx; no manual install needed if you wire it directly into your client config below. If you'd rather pin a version:

npm install -g @suverselabs/x402-mcp

Configure for Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "suverse-x402": {
      "command": "npx",
      "args": ["-y", "@suverselabs/x402-mcp"],
      "env": {
        "BASE_PRIVATE_KEY": "0xYOUR_EVM_PRIVATE_KEY",
        "SOLANA_KEYPAIR": "base58-encoded-secret-key-from-phantom",
        "COSMOS_MNEMONIC": "twelve or twenty four bip39 words ...",
        "TRON_PRIVATE_KEY": "64hex"
      }
    }
  }
}

Restart Claude Desktop after editing. Set as many or as few wallets as you want — chains without a configured signer simply aren't usable for buy_and_call.

Configure for Cursor

Edit ~/.cursor/mcp.json:

{
  "mcpServers": {
    "suverse-x402": {
      "command": "npx",
      "args": ["-y", "@suverselabs/x402-mcp"],
      "env": {
        "BASE_PRIVATE_KEY": "0x..."
      }
    }
  }
}

Environment variables

VarRequired?Purpose
BASE_PRIVATE_KEYone of the wallet varsEVM 0x-prefixed hex (works on every supported EVM mainnet — Base, ETH, Polygon, Arbitrum, OP, etc.)
EVM_PRIVATE_KEYaliasPreferred new name for BASE_PRIVATE_KEY
SOLANA_KEYPAIRone of the wallet varsBase58-encoded Solana secret key (Phantom → Settings → Export Private Key)
COSMOS_MNEMONICone of the wallet vars12 or 24-word BIP-39 mnemonic for your Noble wallet
TRON_PRIVATE_KEYone of the wallet vars64-hex TRON private key

You need at least one wallet variable. Tools fail with no_wallets_configured otherwise.

Example agent prompts

"Find me a US weather API and call it for ZIP 94110."

The agent calls catalog_search with query: "weather US zip", picks a listing, then calls buy_and_call with the endpoint URL and the request body.

"Compare the top 3 image-generation APIs."

catalog_search → top 3 ids → catalog_compare with those ids.

"How much have I spent today?"

list_recent_purchases with sinceIso: "<today midnight>".

Local purchase history

Every successful buy_and_call appends a record to a JSONL file in your OS state dir:

  • macOS / Linux: $XDG_STATE_HOME/suverse-x402-mcp/history.jsonl (or ~/.local/state/suverse-x402-mcp/history.jsonl)
  • Windows: %LOCALAPPDATA%\suverse-x402-mcp\history.jsonl

You can read it with cat, jq -s, etc. Delete the file to reset history.

Source

Repository: https://github.com/sudzikcoin/suverse-pay/tree/main/packages/x402-mcp-buyer

Apache-2.0. Issues + PRs welcome.

Keywords

x402

FAQs

Package last updated on 30 May 2026

Related posts