Agents & MCP
TollNode is built for agents that buy their own tools. There's no sign-up and no API key: the agent pays each call in USDC on Base with x402, and only when the call succeeds. Here are three ways to plug it in.
1. Claude Code, Cursor, Codex (MCP)
AgentCash is an MCP server with a built-in USDC wallet. This command installs it if needed and adds all 35 TollNode nodes as tools your agent can find and pay for:
npx agentcash add https://tollnode.com- 1. Fund the wallet it creates with a few dollars of USDC on Base. One dollar covers dozens to hundreds of calls.
- 2.Ask your agent for what you need: “search the web for…”, “make a 2K image of…”, “read this aloud…”. It picks the node, sees the price, pays and returns the result.
- 3. If a call fails, nothing is collected. Your wallet only pays for results.
2. Any agent or script (x402)
Every node is a plain HTTP POST. Any x402 client handles the 402, signs the exact USDC amount and retries:
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = registerExactEvmScheme(new x402Client(), {
signer: privateKeyToAccount(process.env.WALLET_KEY),
});
const pay = wrapFetchWithPayment(fetch, client);
const res = await pay("https://tollnode.com/api/v1/nodes/web-search", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ query: "best espresso grinder" }),
});
console.log(await res.json());3. Let the agent discover it
Agents and indexers such as x402scan read these files to learn every node, its input schema and its price:
- /.well-known/mcp.jsonEvery node described as an MCP tool, with input schema and price.
- /openapi.jsonOpenAPI 3.1 with x402 payment info on each operation.
- /.well-known/x402The x402 manifest.
- /llms.txtShort index for language models.
Prices that depend on options
Some nodes cost more for a bigger result, for example a 4K image or high quality. The 402 always quotes the exact price for the options in your request, and options without a published price are refused before any payment. Each node page lists every option and its price.