Connect

Give your agent onchain tools

Add the endpoint. Your agent sees every tool, calls one, pays for it, gets the answer.

The endpoint

https://onchainrouter.io/mcp

Connect

One package: a wallet on Hedera and Arc, and a call that pays the 402 for you.

import { createWallet, pay } from "onchainrouter";

const wallet = createWallet({
  hedera: { accountId: "0.0.12345", privateKey: "0x..." },
  arc: { privateKey: "0x..." },
});

const { data, receipt } = await pay(
  "https://onchainrouter.io/api/tools/lending-rates",
  { asset: "USDC", chain: "base" },
  wallet,
);

Over MCP instead: wrapMCPClientWithPayment(mcpClient, wallet.client) and connect to https://onchainrouter.io/mcp.

The wallet

Your agent's wallet signs every payment; the router never holds a key. The wallet in the repo is a reference, backed by a Circle agent wallet or a local key. Any wallet that signs x402 requests works in its place. Setup and caps are in the README.