RAEN x402 Gateway
LocalAbout RAEN x402 Gateway
RAEN x402 Gateway is an MCP server for accessing RAEN’s paid services through five tools, covering legal lookup, market analysis, dispute letters, image generation, and contract review. Each call pays a USDC micropayment on Base, so it is intended for MCP clients configured with a payer key.
Key features
- 01Five paid service tools
- 02Legal citations and dispute letters
- 03Ticker and contract analysis
- 04AI image generation
- 05USDC payments on Base
Use cases
- 01Look up FCRA, FDCPA, TILA, or state UDAP citations
- 02Generate a credit dispute letter with an SVG certificate
- 03Request a ticker analysis or contract risk review
- 04Generate an image from a prompt
MCP support
Exposes five RAEN service tools to MCP clients over stdio or streamable HTTP. Tool calls use x402 to settle USDC micropayments on Base.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEraen-mcp
Model Context Protocol server for RAEN's paid x402 services. One MCP tool per service; each call settles a USDC micropayment on Base mainnet via the x402 protocol.
Live gateway (streamable HTTP): https://raen-mcp-gateway.fly.dev/mcp
Auth: Authorization: Bearer <MCP_GATEWAY_KEY> (gateway key required — tool calls spend real USDC).
Tools
| Tool | Service | Price (USDC, Base) | Input |
|---|---|---|---|
raen_law_lookup | royal-ruby | $0.05 | {topic} — FCRA/FDCPA/TILA/state-UDAP citations |
raen_ticker_analysis | tradingagents | $0.05 | {ticker, date?} — synthetic market-consensus demo (not financial advice) |
raen_dispute_letter | dispute-forge | $0.75 | {creditor, reason} — FCRA dispute letter + SVG certificate |
raen_image_generate | nanobanana | $0.01 | {prompt, aspectRatio?} — AI image, base64 PNG |
raen_contract_analysis | contract-eye | $0.05 | {text, focus?} — contract risk score + flagged clauses |
Run it
Stdio (local MCP clients / Smithery)
{
"mcpServers": {
"raen-mcp": {
"command": "node",
"args": ["src/index.js"],
"env": { "RAEN_PAYER_KEY": "0x...private key of a Base-mainnet USDC wallet..." }
}
}
}
Streamable HTTP (remote)
RAEN_PAYER_KEY=0x... MCP_GATEWAY_KEY=<random-secret> node src/http.js # :8080/mcp
Connect from any MCP client: POST https://raen-mcp-gateway.fly.dev/mcp with Authorization: Bearer <key>.
Fly.io deploy
flyctl apps create raen-mcp-gateway
flyctl secrets set -a raen-mcp-gateway RAEN_PAYER_KEY=- MCP_GATEWAY_KEY=<secret>
flyctl deploy --remote-only
How payment works
Tool handlers call wrapFetchWithPayment(fetch, x402Client) from @x402/fetch + @x402/evm (v2). First request → HTTP 402 with a PAYMENT-REQUIRED challenge header → client signs EIP-3009 transferWithAuthorization → settled via facilitator → final HTTP 200 with the product payload. Payer key comes only from RAEN_PAYER_KEY (env), never logged or committed.
Endpoints (live manifests)
Repo family
- Templates for agents: raen-agent-kit — LangChain/LangGraph + CrewAI, plug into this gateway in minutes.
- Integration recipes for every endpoint: the x402-cookbook — copy-paste curl/Python recipes for the 402-challenge flow, free-first-call charge-and-rebate, and gateway config.
Each endpoint's path and schema are verified against the service's /.well-known/x402.json:
- https://royal-ruby-x402.fly.dev/.well-known/x402.json
- https://tradingagents-x402.fly.dev/.well-known/x402.json
- https://dispute-forge-x402.fly.dev/.well-known/x402.json
- https://nanobanana-x402.fly.dev/.well-known/x402.json
- https://contract-eye-x402.fly.dev/.well-known/x402.json
Test evidence (Nov 9 2026)
npm run test:paid→ HTTP 200, real citations (15 U.S.C. § 1681i,15 U.S.C. § 1692g) for a $0.05 law-lookup.- MCP client (SDK) over streamable HTTP →
tools/listreturns all 5 tools;tools/call raen_law_lookup→ HTTP 200 with citations via the deployed gateway.
Information only — not legal or financial advice.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.