npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@onlyswaps/mcp-server

v0.2.3

Published

Give your Privy wallet swap superpowers. Multi-chain DEX meta-aggregator for AI agents - queries 15+ DEX aggregators for best swap prices.

Readme

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

| Tool | Description | |------|-------------| | get_quote | Get swap quotes from multiple DEX aggregators | | build_swap_tx | Build unsigned swap transaction (ready for client-side signing) | | execute_swap | Execute swap end-to-end with embedded wallet (Privy) | | get_portfolio | Get user token holdings across chains | | get_tx_status | Check transaction status | | estimate_gas | Estimate gas for a transaction | | search_token | Search 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

| Chain | ID | Native Token | |-------|-----|--------------| | Ethereum | 1 | ETH | | Optimism | 10 | ETH | | BSC | 56 | BNB | | Gnosis | 100 | xDAI | | Polygon | 137 | MATIC | | Fantom | 250 | FTM | | zkSync Era | 324 | ETH | | Base | 8453 | ETH | | Arbitrum | 42161 | ETH | | Avalanche | 43114 | AVAX | | Linea | 59144 | ETH | | Scroll | 534352 | ETH | | Solana | solana | SOL |

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

| Variable | Default | Description | |----------|---------|-------------| | MCP_PORT | 3001 | HTTP server port | | MCP_TRANSPORT | http | Transport 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

| Endpoint | Description | |----------|-------------| | GET /health | Health check | | GET /capabilities | Supported chains and tools | | GET /mcp | MCP SSE connection endpoint | | POST /mcp/messages | MCP message handler |

Links

  • Website: https://onlyswaps.fyi
  • Hosted MCP: https://mcp.onlyswaps.fyi
  • GitHub: https://github.com/Delegueinu/onlyswaps

License

MIT