Tollbooth MCP Server

Tollbooth MCP Server

Enables AI agents to resolve tokens, get quotes, check for honeypots/rug pulls, build swaps, and retrieve receipts via x402 micropayments.

Category
Visit Server

README

Tollbooth Examples — AI Agent Token Swaps with x402 Micropayments

Working, copy-paste examples for letting an autonomous AI agent swap tokens and screen tokens for honeypots/rug pulls using Tollbooth and the x402 payment protocol. No API keys, no accounts, no custody: the agent pays ~half a cent in USDC per call and signs its own transactions.

Supported chains: Solana, Base, Ethereum, Arbitrum, Polygon, Optimism, BSC, Avalanche (Jupiter aggregation on Solana, 0x on EVM chains).

How it works

  1. GET /v1/tokens/:chain/:symbol — resolve a ticker like PEPE to contract addresses, ranked by DEX liquidity (free)
  2. GET /v1/quote — fee-inclusive swap quote (free)
  3. GET /v1/check/:chain/:token — honeypot / rug-pull safety check (x402, $0.01)
  4. POST /v1/swap/build — unsigned, ready-to-sign swap transaction (x402, ~$0.005)
  5. Your agent signs and submits with its own wallet. Tollbooth never touches keys or funds.

Tolls are payable in USDC on Base (gasless via EIP-3009) or Solana mainnet (gas sponsored by the facilitator — the payer wallet needs zero SOL). The @x402/fetch client handles the whole 402 payment loop automatically.

Run the examples

npm install --legacy-peer-deps

# free endpoints, no wallet needed
npx tsx examples/01-resolve-and-quote.ts

# paid endpoints: fund a wallet with a little USDC on Base first
PAYER_KEY=0x... npx tsx examples/02-safety-check.ts
PAYER_KEY=0x... TAKER=<your wallet> npx tsx examples/03-build-swap.ts

# pay tolls from a Solana wallet instead (USDC on Solana mainnet, no SOL needed)
SOLANA_PAYER_KEYPAIR=/path/to/keypair.json npx tsx examples/04-solana-payer.ts

Use from MCP (Claude, Cursor, any MCP client)

Tollbooth also ships an MCP server exposing resolve_token, get_quote, check_token, build_swap and get_receipt as tools. Example config in mcp.json.

Docs

  • Agent usage guide: https://api.tollboothswap.xyz/skill.md
  • Full tutorial: https://api.tollboothswap.xyz/guides/agent-swaps.md
  • Service manifest: https://api.tollboothswap.xyz/.well-known/x402-service
  • x402 Bazaar (service discovery for agents): https://docs.cdp.coinbase.com/x402/bazaar

Keywords

AI agent token swap, x402 payment protocol example, autonomous agent DeFi, Solana swap API for agents, honeypot checker API, rug pull detection API, non-custodial swap transaction builder, USDC micropayments, HTTP 402, machine-to-machine payments, Jupiter aggregator API, 0x swap API, MCP DeFi tools.

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured