Sponsored by Deepsite.site

Onlyswaps

Created By
OnlySwaps5 days ago
Multi-chain DEX meta-aggregator for AI agents. Queries 15+ DEX aggregators (0x, 1inch, Paraswap, etc.) and returns the best swap price across 13 chains.
Overview
⚠️

@onlyswaps/mcp-server
TypeScript icon, indicating that this package has built-in type declarations

0.2.3 • Public • Published

OnlySwaps MCP Server

Multi-chain DEX meta-aggregator for AI agents. Queries 15+ DEX aggregators, returns the best price.

MCP (Model Context Protocol) server that enables AI agents to execute token swaps. We query 0x, 1inch, Paraswap, DODO, Uniswap, Li.Fi, and 10+ more sources, returning only the best available quotes.

Why OnlySwaps?

  • Meta-Aggregator: Queries 15+ DEX aggregators (0x, 1inch, Paraswap, Li.Fi, etc.) and returns the best available price
  • 13 Chains: Ethereum, Base, Arbitrum, Optimism, Polygon, BSC, Avalanche, Solana, and more
  • One Integration: Single API call to access all DEX liquidity across all chains
  • AI-Native: Built for MCP - works with Claude Desktop, Cursor, and any MCP client

Tools

ToolDescription
get_quoteGet swap quotes from multiple DEX aggregators
build_swap_txBuild unsigned swap transaction (ready for client-side signing)
execute_swapExecute swap end-to-end with embedded wallet (Privy)
get_portfolioGet user token holdings across chains
get_tx_statusCheck transaction status
estimate_gasEstimate gas for a transaction
search_tokenSearch tokens by name or symbol

Quick Start

Using npx

npx @onlyswaps/mcp-server

Claude Desktop Configuration

Add to ~/.claude/claude_desktop_config.json:

{
  "mcpServers": {
    "onlyswaps": {
      "command": "npx",
      "args": ["-y", "@onlyswaps/mcp-server", "stdio"],
      "env": {
        "ONLYSWAPS_API_URL": "https://api.onlyswaps.fyi"
      }
    }
  }
}

Hosted Server (SSE)

Connect to our hosted MCP server:

https://mcp.onlyswaps.fyi/mcp

Supported Chains

ChainIDNative Token
Ethereum1ETH
Optimism10ETH
BSC56BNB
Gnosis100xDAI
Polygon137MATIC
Fantom250FTM
zkSync Era324ETH
Base8453ETH
Arbitrum42161ETH
Avalanche43114AVAX
Linea59144ETH
Scroll534352ETH
SolanasolanaSOL

Tool Examples

get_quote

Get the best swap quote across all aggregators.

{
  "fromToken": "ETH",
  "toToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "amount": "1000000000000000000",
  "chainId": "base"
}

Returns:

{
  "bestQuote": {
    "provider": "1inch",
    "buyAmount": "3245000000",
    "sellAmount": "1000000000000000000",
    "estimatedGas": "150000",
    "priceImpact": "0.05"
  },
  "allQuotes": [...],
  "meta": { "chain": "Base", "chainId": 8453, "sourcesQueried": 5 }
}

build_swap_tx

Build an unsigned transaction ready for client-side signing.

{
  "fromToken": "ETH",
  "toToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "amount": "1000000000000000000",
  "chainId": "base",
  "userAddress": "0xYourWalletAddress",
  "slippage": 1
}

Returns transaction data (to, data, value, gas, chainId) ready to sign.

execute_swap

Execute a swap end-to-end using an embedded Privy wallet. Requires Privy configuration.

{
  "fromToken": "ETH",
  "toToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "amount": "1000000000000000000",
  "chainId": "base",
  "userId": "privy-user-id"
}

get_portfolio

Get user token holdings across all supported chains.

{
  "address": "0xYourWalletAddress",
  "chainIds": ["ethereum", "base", "arbitrum"]
}

get_tx_status

Check the status of a transaction.

{
  "txHash": "0xabc123...",
  "chainId": "base"
}

estimate_gas

Estimate gas for a swap transaction.

{
  "fromToken": "ETH",
  "toToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "amount": "1000000000000000000",
  "chainId": "base",
  "userAddress": "0xYourWalletAddress"
}

search_token

Search for tokens by name or symbol.

{
  "query": "USDC",
  "chainId": "base"
}

Environment Variables

VariableDefaultDescription
MCP_PORT3001HTTP server port
MCP_TRANSPORThttpTransport mode: http or stdio
ONLYSWAPS_API_URL-OnlySwaps backend API URL
ONLYSWAPS_API_KEY-API key for authenticated access
CORS_ORIGINS*Comma-separated CORS origins
PRIVY_APP_ID-Privy App ID (for execute_swap)
PRIVY_APP_SECRET-Privy App Secret (for execute_swap)
PRIVY_AUTHORIZATION_PRIVATE_KEY-Privy auth key (for execute_swap)

Running Locally

# Install dependencies
pnpm install

# Build pnpm build

# Run HTTP server pnpm start

# Run stdio mode (for Claude Desktop) node dist/index.js stdio

Docker

docker build -t onlyswaps-mcp .
docker run -p 3001:3001 \
  -e ONLYSWAPS_API_URL=https://api.onlyswaps.fyi \
  onlyswaps-mcp

API Endpoints

EndpointDescription
GET /healthHealth check
GET /capabilitiesSupported chains and tools
GET /mcpMCP SSE connection endpoint
POST /mcp/messagesMCP message handler

License

MIT

Server Config

{
  "mcpServers": {
    "onlyswaps": {
      "command": "npx",
      "args": [
        "-y",
        "@onlyswaps/mcp-server",
        "stdio"
      ],
      "env": {
        "ONLYSWAPS_API_URL": "https://api.onlyswaps.fyi"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
ChatWiseThe second fastest AI chatbot™
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
CursorThe AI Code Editor
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Tavily Mcp
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Playwright McpPlaywright MCP server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Serper MCP ServerA Serper MCP Server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
DeepChatYour AI Partner on Desktop
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Amap Maps高德地图官方 MCP Server
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
WindsurfThe new purpose-built IDE to harness magic