Repository avatar
AI Tools
v1.0.0
active

nodetrail

io.github.nodetrailio/nodetrail

Pay-per-call on-chain token and wallet facts for agents. x402 USDC scans on 62 chains.

Documentation

Nodetrail MCP server

Tests CodeQL

Open source. Scanned by GitHub CodeQL, Dependabot and secret scanning.

A public Model Context Protocol (MCP) server that wraps the live Nodetrail x402 pay-per-scan API, so an AI agent can run a Nodetrail read as one tool call and pay per call with its own x402 client.

  • Live endpoint: POST https://nodetrail.io/mcp (Streamable HTTP, protocol version 2025-03-26)
  • Upstream: the live API at https://nodetrail.io
  • Runtime: Node.js >= 18, plain node:http, zero dependencies
  • Contact: support@nodetrail.io

Design: keyless, no funds

This server holds no keys and no funds and never signs or pays anything.

  1. The agent calls a tool without a paymentSignature. The server forwards the request to the live API, which answers HTTP 402.
  2. The server returns that 402 quote as the tool result: the price, every payment rail in accepts, the PAYMENT-REQUIRED header value, and the retry steps.
  3. The agent's own x402 client pays one rail from the agent's own wallet.
  4. The agent calls the same tool again with the same arguments plus paymentSignature set to the base64 PAYMENT-SIGNATURE value. The server passes that header through to the API verbatim and returns the scan.

The payer is only charged if the scan is delivered. A paid request repeated with the same payment within 24 hours returns the same result with no second charge (the API answers with Idempotent-Replay: true).

Tools

ToolUpstream routePrice
nodetrail_infoGET /api/x402/v1/infoFree
nodetrail_scan_tokenGET /api/x402/v1/scan/token$0.01
nodetrail_scan_walletGET /api/x402/v1/scan/wallet$0.02
nodetrail_scan_devGET /api/x402/v1/scan/dev$0.03
nodetrail_scan_trioGET /api/x402/v1/scan/trio$0.05
nodetrail_launch_blockGET /api/x402/v1/launch-block$0.02
nodetrail_fee_trailGET /api/x402/v1/fee-trail$0.05

Payment rails quoted by the API (the payer picks one): USDC on Base (eip155:8453), Solana, Polygon (eip155:137), Arbitrum One (eip155:42161), Arc (eip155:5042) and NEAR (near:mainnet), and USD1 on BNB Chain (eip155:56). Exact amounts and pay-to addresses are read from each 402 quote; they are not repeated here.

Scan output is facts read from public chain data, plus a Low, Elevated or High risk signal and a list of what was not checked. It is information only, not financial advice.

Run it locally

node server.mjs            # listens on PORT (default 3000)

Smoke test:

curl -s http://localhost:3000/mcp -X POST -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Tests

node --test

The tests start the server on an ephemeral port with the upstream pointed at a local stub (the same override the NODETRAIL_API_BASE environment variable provides) and cover: the initialize handshake, tools/list returning all 7 tools, the free info tool proxying, a paid tool surfacing the 402 quote when unpaid, and a paid tool forwarding the PAYMENT-SIGNATURE header when paymentSignature is given.

Configuration

VariableDefaultMeaning
PORT3000Listen port when run as a plain server.
NODETRAIL_API_BASEhttps://nodetrail.ioUpstream API base. Tests only — leave unset in production so the server talks to the live mainnet API.

The hosted server at https://nodetrail.io/mcp is already deployed. This repository is the public, keyless source for that endpoint.

Registry file

server.json is the Official MCP Registry entry (name io.github.nodetrailio/nodetrail, remote https://nodetrail.io/mcp, streamable-http transport).

No installation packages available.

Remote