Skip to main content
Glama
rpc402-mcp

rpc402-mcp

rpc402-mcp

MCP server (stdio) for RPC402 — composed on-chain reads, paid per call in USDC via the x402 protocol. One tool call replaces 3–61 raw RPC calls: you get a whole answer (a wallet's full balance sheet, a chain's status bundle, a transaction with its receipt), not a raw passthrough.

Price: $0.002 USDC per tool call, settled on Base, Solana or Polygon (your choice, see RPC402_PAY_NETWORK). No accounts, no API keys — payment is the auth. Read chains: ethereum, solana, base.

Tools

Tool

Arguments

Returns

token_balance

chain, wallet, token

One token balance: raw balance, decimals, symbol, formatted

wallet_balances

chain, wallet, tokens[]? (≤20)

Native + all token balances in one call; per-token failures marked partial

chain_status

chain

Block/slot, chain id, gas price, epoch/blockhash/health bundle

tx_lookup

chain, hash

Tx + receipt composed: found, status, success, confirmations, fees

event_logs

chain, address, fromBlock?, toBlock?, topics?, limit?

EVM eth_getLogs (≤2,000-block range, ≤1,000 results) or Solana signatures for the account

Related MCP server: obol

Install & run

cd rpc402-mcp
npm install
node src/index.js        # stdio MCP server; logs go to stderr

Requires Node ≥ 20.

Configuration

Env var

Required

Meaning

RPC402_KEYFILE

paid mode

Payer keyfile path. Formats: 0x… EVM private-key text file, Solana CLI keypair JSON, or base58 secret-key text file. The key never leaves your machine; it only signs the x402 payment authorization locally.

RPC402_PAY_NETWORK

no

Settlement network preference: base (default), solana, or polygon. Must match the keyfile type (EVM key → base/polygon, Solana key → solana).

RPC402_BASE_URL

no

API base URL. Default https://rpc.zero-orbit.online.

MCP_DEMO

no

1 = demo mode: no keyfile, no payment; calls send X-PAYMENT: demo. Only works against a local RPC402 instance running with DEMO_MODE=1.

SOLANA_RPC_URL

no

Custom Solana RPC used to build the payment transaction.

Fund the payer wallet with a little USDC on your chosen settlement network (EVM payments are EIP-3009 signatures — gasless for the payer; the facilitator submits. On Solana the facilitator's feePayer covers the network fee).

Client configs

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "rpc402": {
      "command": "node",
      "args": ["/absolute/path/to/rpc402-mcp/src/index.js"],
      "env": {
        "RPC402_KEYFILE": "/absolute/path/to/payer-keyfile",
        "RPC402_PAY_NETWORK": "base"
      }
    }
  }
}

Cursor (.cursor/mcp.json)

Same shape as Claude Desktop above.

Generic MCP client

Launch node /absolute/path/to/rpc402-mcp/src/index.js as a stdio subprocess with the env vars above set.

Demo mode (no wallet)

"env": { "MCP_DEMO": "1", "RPC402_BASE_URL": "http://127.0.0.1:3000" }

…against a locally started RPC402 with DEMO_MODE=1. Demo calls serve real live reads; only the payment is simulated.

Notes

  • Input validation happens server-side before payment verification, so a malformed call is a 400, never a charge.

  • If a payment settles and the read then fails (502), the error body carries a single-use compensatingCredit for one free identical retry within 24h.

Available Tools

5 tools
chain_statuschain_statusB

Chain status bundle in one RPC402 call ($0.002 USDC via x402). EVM: block number, chain id, gas price (wei + gwei), head block timestamp/age. Solana: slot, block height, epoch, latest blockhash, health.

Inputs: chain (required).

event_logsevent_logsA

Event logs for one contract in one RPC402 call ($0.002 USDC via x402). EVM: eth_getLogs (range cap 2,000 blocks, result cap 1,000; defaults fromBlock=toBlock-99, toBlock=head). Solana: latest transaction signatures for the account (getSignaturesForAddress) — Solana has no block-range log query; the response carries a note saying so.

Inputs: chain (required), address (required), limit, topics, +2 more.

token_balancetoken_balanceA

Balance of one token for one wallet, composed in a single RPC402 call ($0.002 USDC via x402): ERC-20 balanceOf+decimals+symbol (EVM) or SPL token-account sum + mint decimals (Solana). Returns balance (raw integer string), decimals, symbol (null on Solana), formatted.

Inputs: chain (required), token (required), wallet (required).

tx_lookuptx_lookupA

Transaction lookup composed in one RPC402 call ($0.002 USDC via x402): transaction + receipt — found, status (confirmed/pending/not_found), success, confirmations, value, gas used, effective gas price (EVM); slot, block time, fee, success (Solana). A nonexistent hash returns found:false, which is the answer, not an error.

Inputs: hash (required), chain (required).

wallet_balanceswallet_balancesA

Whole wallet snapshot in ONE RPC402 call ($0.002 USDC via x402): native balance plus up to 20 token balances. Per-token failures degrade to marked entries (partial: true) instead of failing the call.

Inputs: chain (required), wallet (required), tokens.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool targets a clearly distinct on-chain read concern: chain status, single-token balance, whole-wallet balances, transaction lookup, and event logs. The overlap between token_balance and wallet_balances is resolved by explicit scope differences in the descriptions.

    Naming Consistency4/5

    All names use consistent snake_case and are concise resource-oriented identifiers. There are minor pattern variations (singular token_balance vs plural wallet_balances; noun phrases like tx_lookup/event_logs) but nothing confusing.

    Tool Count5/5

    Five tools is well-scoped for a focused read-only RPC402 server, and each tool corresponds to a meaningful composite RPC operation. No obvious filler or missing tool-count pressure.

    Completeness4/5

    The surface covers the core read workflows: chain status, token balances, wallet snapshot, transaction lookup, and event logs. Some adjacent RPC capabilities such as block lookup, nonce/account metadata, or fee estimation are absent, but major workflows are covered.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents to access Solana wallet analytics, token data, and DeFi tools via pay-per-request USDC micropayments using the x402 protocol, without API keys or subscriptions.
      13
      58 npm
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Pay-per-call data and tools for AI agents over x402, by UnyKorn. Hundreds of endpoints (live count in the catalog): DeFi and market data, multi-chain wallet reads, wallet and token risk signals, SEC filings, web and domain intel, and AI text tools. Settled per call in USDC on Base ($0.001-$0.25). No API keys or subscriptions; unpaid calls return the exact quote first.
      22
      MIT