
Swap API
io.github.Swap-APIPublished by GitHub account Swap-APIv0.1.0Updated Oct 24, 2026
MCP server for SwapAPI - get executable token swap calldata for EVM chains
Overview
Local MCP server that gives an assistant executable token swap calldata for EVM chains via SwapAPI, with one swap_tokens tool.
- What you can do
- Get executable swap transaction data (router address, calldata, native value, gas estimate, minimum output) for a token pair on a given EVM chain
- Specify chain ID, input and output token addresses, amount in smallest units, sender wallet and optional slippage tolerance (default 0.5%)
- Use the native-token placeholder address for swaps from or to ETH, MATIC and similar
- Returns calldata only; the assistant or user still signs, approves and submits the transaction
- When to use it
- Useful when an agent needs to prepare token swaps on EVM chains such as Ethereum, Base or Arbitrum and hand back ready-to-sign transaction data, for example inside a trading or DeFi workflow. Not needed if you only want quotes or if you do not intend to submit on-chain transactions.
- Requirements
- Runs locally over stdio, installed from the npm package @swapapi/mcp (Node.js/npx) and configured in an MCP client such as Claude Desktop or Cursor. No environment variables, headers or authentication are declared; network access to the SwapAPI service is implied.
Installation
In SourceWeft
- Open Swap API in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
SwapAPI MCP Server
MCP (Model Context Protocol) server for SwapAPI. Enables AI agents to get executable token swap calldata for any EVM chain.
Installation
Or use directly with npx:
Client Configuration
Claude Desktop
Add to your Claude Desktop config:
Or with a local install:
Cursor
Add to your Cursor settings (Settings → MCP):
Other Clients
Any MCP-compatible client can use the same configuration format. Check your client's documentation for where to add MCP server settings.
Available Tools
swap_tokens
Get executable transaction data to swap tokens on EVM chains.
Parameters:
Returns:
Examples
Swap 0.001 ETH to USDC on Base
Swap USDC to ETH on Arbitrum with 1% slippage
Pre-flight Checklist
Before submitting any swap transaction:
- ERC-20 Approval: If
tokenInis not native token, ensure sender has approved the router for at leastamountIn - Balance Check: Verify sender has sufficient balance for
amountIn(plusvalueif native token) - Gas Estimation: Call
eth_estimateGason the transaction and add 20% buffer - Simulation: Run
eth_callto verify the transaction won't revert - Timing: Submit within 30 seconds of fetching the quote (calldata has expiry)
See the main README.md for full API documentation.
Development
Testing
Run the test suite:
Or use the MCP Inspector:
License
MIT
Source: mcp/README.md at commit bdfd033
Tools
0Version history
1- v0.1.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts