Menu

Explorer & Settings

Tempo Explorer Submit Project
Back to all projects

rail402-mcp

by Rail402 · Updated 1 month ago

MCP server for Rail402. Browse, discover, and call paid APIs from Claude, Cursor, and Base MCP — payments handled autonomously via x402 on Base.

In the AI payments ecosystem

rail402-mcp is an early-stage TypeScript project in the AI payments / x402 ecosystem, focused on x402, LLM / MCP, Agent, Blockchain. It currently has 9 GitHub stars and 0 forks, and sits alongside related tools like x402-payments-mcp, AgenticDeFi-Trainer, AgenticDeFi-Trainer, AgenticDeFi-Trainer, AgenticDeFi-Trainer, AgenticDeFi-Trainer.

README.md View on GitHub →

@rail402/mcp

npm MCP Base License: MIT

An MCP server that gives Claude, Cursor, and any MCP-compatible LLM direct access to the Rail402 marketplace — browse paid APIs, read their schemas, and pay for and call them with USDC on Base, all from inside the model.

Tools

Tool What it does
list_services Browse the marketplace by category or free-text query.
get_service_details Get a service's input/output JSON Schema, price, method, and examples.
call_service Execute a paid call — settles the x402 USDC payment, returns the response.
check_payment_status Verify a USDC payment transaction on Base by its hash.

call_service requires a funded agent wallet (RAIL402_PRIVATE_KEY). The other three tools work read-only with no wallet.

Quick start

npx -y @rail402/mcp     # runs the stdio MCP server

Configure via environment variables:

Variable Default Purpose
RAIL402_API_BASE https://rail402.app Marketplace API base URL.
RAIL402_NETWORK base base or base-sepolia.
RAIL402_PRIVATE_KEY (unset) Agent wallet key; enables call_service.
RAIL402_RPC_URL public Base RPC Optional RPC override.

Install in Claude Desktop

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

{
  "mcpServers": {
    "rail402": {
      "command": "npx",
      "args": ["-y", "@rail402/mcp"],
      "env": {
        "RAIL402_NETWORK": "base",
        "RAIL402_PRIVATE_KEY": "0xYourAgentWalletKey"
      }
    }
  }
}

Restart Claude Desktop. Ask: "List Rail402 security APIs and call the wallet risk scorer for 0x…".

Install in Cursor

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global):

{
  "mcpServers": {
    "rail402": {
      "command": "npx",
      "args": ["-y", "@rail402/mcp"],
      "env": { "RAIL402_NETWORK": "base" }
    }
  }
}

Install with Base MCP

This server ships a Base MCP–compatible skill manifest at skill/skill.json. Register it alongside Base MCP so an agent can use Base's wallet and chain tools and Rail402's marketplace together:

{
  "mcpServers": {
    "base": { "command": "npx", "args": ["-y", "@base-org/base-mcp"] },
    "rail402": { "command": "npx", "args": ["-y", "@rail402/mcp"], "env": { "RAIL402_NETWORK": "base" } }
  }
}

A ready-to-edit config is included at mcp-config.json.

Example session

You:    Find an analytics API for Base tokens and tell me what it costs.
Claude: (list_services category=Analytics) → "Token Analytics", 0.05 USDC on base.
        (get_service_details token-analytics) → input: { address }, output: {...}
You:    Run it for 0x1bc0c42215582d5a085795f4badbac3ff36d1bcb.
Claude: (call_service token-analytics {address}) → pays 0.05 USDC, returns holder stats.

Security

  • Keep RAIL402_PRIVATE_KEY in a wallet funded with only what you're willing to let an agent spend. Treat it like a hot wallet.
  • Without the key, the server is read-only (call_service returns a clear error).
  • All logs go to stderr, never stdout, so they can't corrupt the JSON-RPC stream.

Develop

npm install
npm run dev        # tsx src/index.ts
npm run typecheck
npm run build      # → dist/index.js

License

MIT © Rail402

All LLM projects →