io.github.plagtech/spraay-x402-mcp

السجل الرسمي المالية والمدفوعات

MCP server for Spraay x402 Gateway. 60 tools for crypto payments, DeFi, and AI on Base.

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

NPM package spraay-x402-mcp
Claude Code
claude mcp add spraay-x402-mcp -e 'X402_WALLET_PRIVATE_KEY=<your x402_wallet_private_key>' -- npx -y spraay-x402-mcp@3.1.1
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "spraay-x402-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "spraay-x402-mcp@3.1.1"
            ],
            "env": {
                "X402_WALLET_PRIVATE_KEY": "<your x402_wallet_private_key>"
            }
        }
    }
}

متغيرات البيئة

  • X402_WALLET_PRIVATE_KEY إلزامي سري Private key for the wallet that pays for x402 requests (USDC on Base)

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. 💧 Spraay x402 MCP Server
  2. Quick Start
  3. Tool catalog
  4. How it works
  5. Security & Wallet Safety
  6. Requirements
  7. Environment variables
  8. Links
  9. License

💧 Spraay x402 MCP Server

Full-stack DeFi infrastructure for AI agents — 183 pay-per-call tools, backed by the 192-endpoint Spraay x402 Gateway on Base, with Solana, Ethereum, XRP, and Stellar payment rails.

Connect Claude, Cursor, or any MCP client to onchain payments, batch payouts, swaps, bridging, payroll, invoicing, escrow, oracle data, analytics, 200+ AI models, GPU/compute, research APIs, search/RAG, and more. Agents pay USDC per request via the x402 protocol — no API keys, no accounts.

The tool list is generated from the live gateway manifest at build time (npm run sync), so the authoritative catalog and pricing always live at the gateway — see Tool catalog. 24 of the gateway's endpoints are free (no payment required).


Quick Start

Install and go — no config, no API keys, no env vars. On first run the server auto-creates a wallet, saves it to ~/.spraay/.session, and prints the address to stderr. Fund that address with USDC on Base and start calling tools.

Read Security & Wallet Safety — these tools move real funds.

One-line install (Claude Code)
claude mcp add spraay -s user -- npx -y spraay-x402-mcp
Manual config (Cursor / Claude Desktop)

Cursor (.cursor/mcp.json) or Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "spraay": {
      "command": "npx",
      "args": ["-y", "spraay-x402-mcp"]
    }
  }
}

That's it. The first run prints something like:

💧 Spraay created a new wallet: 0xABC…123
   Private key saved to ~/.spraay/.session (keep it safe — it controls funds).
   Fund this address with USDC on Base to start paying for tool calls.
Optional — bring your own wallet

To sign with a key you already control instead of the auto-created one, set EVM_PRIVATE_KEY in your environment (it overrides the session wallet). Never paste a raw key into a committed config file — use a dedicated hot wallet funded only with what the agent may spend. See Security & Wallet Safety.

Remote URL (no wallet on your machine)

Settlement is handled gateway-side; your client never holds a signing key.

{
  "mcpServers": {
    "spraay": {
      "url": "https://spraay-x402-mcp--plagtech.run.tools"
    }
  }
}
Smithery
smithery mcp add Plagtech/Spraay-x402-mcp
From source
git clone https://github.com/plagtech/spraay-x402-mcp
cd spraay-x402-mcp
npm install
npm run build
npm start                     # auto-creates a wallet on first run

Tool catalog

183 tools spanning the gateway's 33 categories. Highlights by area:

AreaWhat it covers
AI & Inference200+ LLMs (OpenAI-compatible), wallet/tx classification, contract explanation, summaries
ComputeText / image / video / TTS / STT / embeddings across Replicate, Chutes, OpenRouter; batch jobs
Compute FuturesPrepaid compute credits with tier discounts; draw down per inference
BittensorDecentralized inference, image gen, and embeddings via SN64 / SN19
PaymentsBatch payouts up to 200 recipients (Base, XRP Ledger, Stellar); estimates
PayrollStablecoin payroll runs across Base, Ethereum, Solana
Invoicing & EscrowCrypto-native invoices and milestone escrow (persistent)
DeFi & DataSwaps (Uniswap V3 / Aerodrome), oracle prices/gas/FX, bridge quotes, balances, ENS/Basename
AnalyticsWallet profiles and decoded transaction history
Research250M+ papers (OpenAlex), arXiv, Crossref, PubMed, PubChem, US Census, dictionary
Search & RAGWeb search, content extraction, question answering
CommunicationEmail, SMS, XMTP messaging, webhooks
InfrastructureMulti-chain RPC, IPFS/Arweave storage, cron scheduling, structured logs
Identity & ComplianceKYC/sanctions screening, auth sessions, audit trail, crypto tax (FIFO, IRS 8949)
Supply Chain (SCTP)Supplier registration, purchase orders, invoice verification, settlement
Robotics (RTP)Register robots, dispatch paid tasks, escrow-backed completion
Trust & SafetyProofLayer trust scores; free token-safety, address-safety, and tx-decode checks

24 free endpoints require no payment — gas/prices/chain-status, address & batch validation, ENS resolution, unit conversion, x402 discovery probes, and model/compute discovery.

For the exact, current tool list and per-tool pricing, query the live manifest:

curl https://gateway.spraay.app/.well-known/x402.json

Pricing ranges from $0.001 (reads) to ~$0.10 (payroll, escrow release, tax), settled in USDC on Base.


How it works

  1. An agent calls a tool (e.g. spraay_batch_execute).
  2. The MCP server hits the Spraay x402 Gateway.
  3. The gateway responds 402 Payment Required with a USDC amount.
  4. Remote mode: settlement is handled gateway-side. Local mode: @x402/axios signs a USDC micropayment from the auto-created (or overridden) wallet.
  5. The gateway validates payment and returns the data.

Security & Wallet Safety

These tools can initiate real USDC payments. Treat the server like any tool with funds access.

  • The auto-created wallet only holds what you send it. Fund it with only as much USDC as you're willing to let the agent spend. It starts empty, so a fresh install cannot move funds until you fund it; read-only tools work regardless.
  • The session key lives at ~/.spraay/.session. Protect that file like any secret — anyone who reads it controls the wallet. It's written with 0600 permissions on POSIX systems. Back it up if the funds matter; delete it to rotate to a new wallet on the next run.
  • Prefer the remote URL if you'd rather keep no signing key on your machine — settlement is handled gateway-side.
  • If you bring your own key via EVM_PRIVATE_KEY, use a dedicated hot wallet that controls no other assets, and never put a raw private key in a config file, issue, or any committed file — keep it in your shell environment only.

The published npm package ships only dist/, README, and LICENSE (verify with npm pack --dry-run) — no binaries, no build tooling, no install scripts.

Report security issues to security@spraay.app, not a public issue.


Requirements

  • Node.js 20+
  • MCP client — Claude Desktop, Cursor, or any MCP-compatible client
  • USDC on Base — fund the auto-created wallet (or your own); even $1 covers thousands of calls

Environment variables

None are required — the server runs with zero configuration. All of the following are optional overrides.

VariableRequiredDefaultDescription
EVM_PRIVATE_KEYNoauto-created at ~/.spraay/.sessionOverride the auto-created wallet with your own key. Use a dedicated, funded-as-needed hot wallet.
SPRAAY_GATEWAY_URLNohttps://gateway.spraay.appOverride the gateway URL.

License

MIT

الأسئلة الشائعة

ما هو io.github.plagtech/spraay-x402-mcp؟

MCP server for Spraay x402 Gateway. 60 tools for crypto payments, DeFi, and AI on Base.

كيف أثبّت io.github.plagtech/spraay-x402-mcp؟

يعمل على جهازك. في Claude Code: claude mcp add spraay-x402-mcp -e 'X402_WALLET_PRIVATE_KEY=<your x402_wallet_private_key>' -- npx -y spraay-x402-mcp@3.1.1. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج io.github.plagtech/spraay-x402-mcp إلى مفتاح API؟

نعم. يتطلب X402_WALLET_PRIVATE_KEY، وتضبطها في إعداداته.

هل io.github.plagtech/spraay-x402-mcp مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص MIT.

من يصون io.github.plagtech/spraay-x402-mcp؟

ينشره plagtech. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.