Skip to main content
MCP server CX Codex

mcp · swap-api — Claude Code MCP server: token swap calldata for EVM

SwapAPI's MCP server hands your agent executable calldata for token swaps on EVM chains. Useful when the swap has to be assembled inside the chat.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add mcp -- npx -y @swapapi/mcp
Open on GitHub

What mcp does

There is one tool, swap_tokens. It takes a chainId, the tokenIn and tokenOut addresses, amountIn in the smallest units, the sender wallet, and optionally maxSlippage from 0 to 1 (0.005 by default). What comes back: the router address in to, ABI-encoded data, a value field for native coins, an estimated gas limit and the guaranteed output after slippage.

No transaction leaves the server. It only builds the payload; your wallet signs and broadcasts. The README's checklist follows from that: approve an ERC-20 first, confirm the balance, run eth_estimateGas with headroom, dry-run with eth_call. Timing matters too. Calldata expires, so act on a quote quickly rather than parking it in a queue.

For a native coin on either side, pass 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE as the token address. The server never needs a private key, which keeps signing keys out of your MCP config. Default slippage of 0.5% is a tight fit for volatile pairs; set it yourself when the trade calls for it.

What it helps with

  • build swap calldata for a given EVM chain
  • turn ETH into USDC from inside an agent chat
  • work out the minimum output after slippage
  • get router address and gas estimate for a Base or Arbitrum trade

Example prompts for the agent

  • Build the calldata to swap 0.001 ETH for USDC on Base, my wallet is 0xYourAddress
  • Prepare a USDC to ETH swap on Arbitrum with 1% slippage
  • Call swap_tokens for chainId 1 with 1000000000000000 wei

How to install mcp

Platform CLI

claude mcp add mcp -- npx -y @swapapi/mcp

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about mcp

How do I install mcp in Claude Code?

Run claude mcp add mcp -- npx -y @swapapi/mcp. The server is registered and swap_tokens becomes available in the session.

What does mcp do?

It returns swap transaction data: router address, calldata, value for native coins, gas estimate and the post-slippage minimum. Signing and sending stay with your wallet.

What should I check before sending a swap?

Approve the router for at least amountIn when swapping an ERC-20, verify the balance and dry-run with eth_call for reverts. Use the quote promptly, since calldata expires.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →

mcp by other authors comes first.

mcp kubeshark This MCP server gives AI agents access to Kubernetes network traffic. Use it to inspect API calls, investigate incidents, and trace failures across services. CX Codex +1 ★ 12,109repo stars mcp butterbase-ai The Butterbase MCP server gives your agent access to schemas, auth, functions, storage, RAG and deploys. Useful when your backend runs on Butterbase. CX Codex +1 ★ 3,031repo stars mcp medplum Connect an AI agent to healthcare data stored in Medplum and work with those records through MCP. Useful when you want an agent to access FHIR data. CX Codex +1 ★ 2,760repo stars mcp sceneview This MCP server gives an AI assistant access to SceneView API docs and samples, and helps generate and validate code. Use it when building a 3D or AR app with SceneView. CX Codex +1 ★ 1,348repo stars mcp Buoy-gg Lets an AI agent read and control a running React Native or Flutter app through Buoy devtools. Useful when you want requests, caches or state inspected inside the app itself. CX Codex +1 ★ 691repo stars REA morluto Analyzes binaries, Electron bundles, and JavaScript runtimes directly from your agent. It inspects compiled apps without source code to recreate specific features. CX Codex +1 ★ 386,989repo stars GitHub official github Wires your AI agent into GitHub: read code, open issues and pull requests, watch Actions runs. Saves a trip to the browser. CX Codex +1 ★ 33,918repo stars Netdata netdata Hands your AI agent live monitoring data: metrics, logs, alerts and anomaly detection. Useful when you need to know what a server is doing without opening the dashboard. CX Codex +1 ★ 81,115repo stars browser-use browser-use Give an agent browser tasks such as finding information, extracting page data, and filling forms. Connect it when those actions need to happen on the web. CX Codex +1 ★ 119,160repo stars Codebase Memory DeusData A local MCP server that maps your repo's code, docs and infrastructure into a graph. Gives the agent structural context without re-reading files. CX Codex +1 ★ 47,392repo stars mcp-server HeyPuter Connects your AI agent to Puter for files, websites and workers. Useful when the project already lives in Puter's cloud. CX Codex +1 ★ 43,872repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor