Skip to main content
Glama

AlphaBotPro MCP + x402 Example

A minimal, runnable example showing an AI agent discovering, paying for, and unlocking live trading data over MCP using the x402 machine-payment pattern — no human, no dashboard, no checkout form.

This talks to the real, live AlphaBotPro MCP server. Nothing here is a mock.

What it demonstrates

  1. initialize — standard MCP JSON-RPC handshake

  2. tools/list — discover the available tools

  3. get_catalog — a public tool: prices and sample payloads, no auth

  4. get_signals without a key — a clean, structured payment_required error (the x402 pattern) instead of a silent failure

  5. purchase_access — request a crypto invoice (USDT/USDC on TRON, Polygon or Base) for a paid tier

  6. check_payment — poll until the invoice settles, then receive a scoped API key

  7. get_signals again, now authenticated

Related MCP server: @praveen030686/data-apis-mcp

Run it

node example.mjs

No dependencies, no API key required to run steps 1–5 (only step 6/7 need a real payment to complete — the script prints the payment instructions and exits there unless you pass --pay, which is left as a manual step since it requires a funded wallet).

Server details

Why this exists

Most "AI-ready" APIs still assume a human signs up, enters a card number, and pastes a key into a config file. That breaks the moment the buyer is an autonomous agent. This server lets an agent discover the price, pay in stablecoins, and start pulling data — all inside one continuous session.

Full write-up: https://alphabotpro.cloud/blog/post/how-ai-agents-pay-for-data-with-crypto-x402-mcp-example

Disclaimer

Trading signals returned by this API are informational tools, not financial advice, and not a guarantee of profit. Trading carries risk of loss. AlphaBotPro is not affiliated with the Model Context Protocol project or the x402 project — this repo is an independent example of using both.

License

MIT — see LICENSE.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server for AgentPay — the payment gateway for autonomous AI agents. Fund a wallet once, give your agent the key, and it discovers, provisions, and pays for tool APIs on its own. One key, every tool.
    112
    1
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    22 MCP tools for AI agents: crypto prices and trading signals (53 coins), stock prices and company financials, forex rates and conversion, and web scraping with AI summaries. All powered by x402 USDC micropayments on Base. $0.01-$0.25 per request.
    22
    19
    MIT
  • A
    license
    B
    quality
    B
    maintenance
    agenticpay lets MCP server developers monetize tools via per-call USDC micropayments on Solana, using the x402 protocol. Each tool declares a price; agents pay via signed Solana transactions; settlement happens on-chain in ~1.5–2 seconds.
    1
    3
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Drop-in x402 payment middleware for MCP servers. Charge AI agents per tool call using USDC on Base chain — Python and JavaScript SDKs, no payment processor, no KYC.
    MIT