Swap-API
MCP server giving AI agents executable token swap calldata for any EVM chain
Swap-API is an open-source MCP server for crypto and web3. It runs locally on your machine and is started by your AI client.
- Pricing
- Open source
- Platforms
- CLI, API
- Runs
- Locally
- Version
- 0.1.0
- Listing updated
Similar MCP servers
Install
Run in a terminal
claude mcp add mcp -- npx -y @swapapi/mcpAdd to claude_desktop_config.json
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@swapapi/mcp"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@swapapi/mcp"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@swapapi/mcp"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@swapapi/mcp"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@swapapi/mcp"
]
}
}
}Using several servers? Build one config file with the MCP config generator.
About Swap-API
The README describes this server as a bridge between AI clients and the SwapAPI swap service. Instead of quoting trades in prose, an agent calls a single swap_tokens tool that returns the router address, encoded calldata, native value, a gas estimate and a minimum guaranteed output after slippage, all ready to be signed by the user's wallet.
The tool takes a chain ID, input and output token addresses, an amount in the token's smallest unit, the sender address and an optional slippage ceiling that defaults to 0.5%. The README uses a placeholder address for native tokens and gives Ethereum, Base and Arbitrum as chain examples.
The server runs locally over stdio and is installed through npm or npx. The README includes configuration snippets for Claude Desktop and Cursor. It is aimed at developers and agent builders who want on-chain swap execution inside an AI workflow, and it asks the integrator to run approval, balance, gas and simulation checks before submitting any transaction. The calldata expires quickly, so the README advises submitting within 30 seconds of fetching a quote.
Tools this server provides (1)
Taken from the project documentation; the running server may differ.
- swap_tokens
- Get executable transaction data to swap tokens on EVM chains.
What it does
- Swap calldata generation
- Returns router address, encoded calldata, value and gas estimate for a token swap.
- Multi-chain EVM support
- Accepts a chain ID so the same tool works across EVM networks such as Base and Arbitrum.
- Adjustable slippage
- Takes an optional maximum slippage between 0 and 1, defaulting to 0.5%.
- Native token handling
- Uses a placeholder address to represent the chain's native token in trades.
- Local stdio transport
- Runs as a local process installed from npm and started with npx.
Good for
- Letting an AI assistant prepare a token swap for a user to sign
- Building an agent that rebalances wallet holdings across EVM chains
- Generating swap transactions for a trading bot to simulate before sending
- Testing swap routing from an MCP client using the MCP Inspector
Pricing
Open source
Free MIT-licensed npm package.
Swap-API FAQ
How do I install the server?
The README says to run npm install -g @swapapi/mcp or use npx @swapapi/mcp directly.
Which parameters does swap_tokens require?
chainId, tokenIn, tokenOut, amountIn and sender are required; maxSlippage is optional.
How long is returned calldata valid?
The README advises submitting within 30 seconds of fetching the quote because the calldata has an expiry.
What license is Swap-API under?
The README lists the license as MIT.
Is Swap-API free?
Yes. Swap-API is open source, so you can use and self-host it for free.
How do I add Swap-API to Claude Code?
Run this command in your terminal: claude mcp add mcp -- npx -y @swapapi/mcp
What are the best alternatives to Swap-API?
The closest alternatives to Swap-API are Universal Blockchain MCP, HelmSwap, Debridge MCP, SimpleSwap and Uniswap Tx Builder MCP.
Where this comes from
- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.