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

mcp-crosschain-swap

v0.0.2

Published

MCP Server for DeFi swap aggregation

Downloads

92

Readme

LeoKit MCP Server

Give AI assistants like Claude superpowers to interact with DeFi. This MCP server lets Claude quote and execute cross-chain swaps across 30+ blockchains using the LeoKit aggregation API.

⚠️ Security Warning: Never commit API keys to version control. Always use environment variables or secure secret management. Read SECURITY.md before deploying.

Features

  • Multi-protocol quotes: Get swap quotes from THORChain, MAYAChain, Chainflip, Relay, and NEAR
  • Cross-chain swaps: Generate unsigned transactions for 30+ blockchains
  • Transaction tracking: Monitor swap status across protocols
  • Asset discovery: List all supported tokens with current prices
  • Balance queries: Check wallet balances across multiple chains

Installation

cd apps/leokit-mcp
npm install
npm run build

Configuration

Get your API key from dash.leokit.dev.

🔐 Security First:

  • Never hardcode API keys in your code
  • Use environment variables for all secrets
  • Don't commit .env files to git
  • Enable auth in production (never use MCP_AUTH_DISABLED=true)

Environment variables:

# Custom LeoKit API URL (defaults to https://api.leokit.dev)
export LEOKIT_API_URL="https://api.leokit.dev"

# Disable authentication for development (not recommended for production)
export MCP_AUTH_DISABLED=true

# Cache TTL for validated keys in milliseconds (default: 300000 = 5 minutes)
export MCP_AUTH_CACHE_TTL=300000

Quick Setup with Claude Desktop

Option 1: Web-Based Setup (Easiest) 🌐

Visit leokit.io/mcp-setup for an interactive setup guide that generates your configuration automatically.

Option 2: One-Line Setup Script 🚀

⚠️ Security Note: Review scripts before running them. You can view the source at the URLs below.

Option 3: Manual Configuration

Remote Server (Recommended)

Add to your Claude Desktop config (~/.config/claude/claude_desktop_config.json on macOS/Linux or %APPDATA%\Claude\claude_desktop_config.json on Windows):

{
  "mcpServers": {
    "leokit": {
      "transport": {
        "type": "http",
        "url": "http://mcp.leokit.dev/mcp",
        "headers": {
          "Authorization": "Bearer your-leokit-api-key"
        }
      }
    }
  }
}

Local Installation

{
  "mcpServers": {
    "leokit": {
      "command": "npx",
      "args": ["-y", "@inleo/leokit-mcp"],
      "env": {
        "LEOKIT_API_KEY": "your-leokit-api-key"
      }
    }
  }
}

After setup: Restart Claude Desktop and ask:

  • "Help me set up LeoKit" → Runs leokit_setup
  • "Is my API key working?" → Runs leokit_validate_key
  • "List available LeoKit tools"

Available Tools

🚀 Getting Started Tools

leokit_setup

Get help setting up your LeoKit API key. Perfect for first-time users!

Just ask Claude:

  • "Help me set up LeoKit"
  • "How do I get a LeoKit API key?"

What it provides:

  • Step-by-step setup guide
  • Links to create an account
  • Configuration examples
  • Current setup status

leokit_validate_key

Test if your API key is working.

Parameters:

  • api_key (optional): Test a specific key

Just ask Claude:

  • "Is my LeoKit API key working?"
  • "Validate my API key"

What it checks:

  • API key validity
  • Connection to LeoKit API
  • Provides troubleshooting tips

💱 Swap & DeFi Tools

leokit_get_quote

Get swap quotes from multiple DEX protocols.

Parameters:

  • from_asset (required): Source asset (e.g., ETH.ETH, BTC.BTC)
  • to_asset (required): Destination asset
  • amount (required): Amount to swap (e.g., 1.5)
  • origin (required): Sender wallet address
  • destination (required): Recipient wallet address
  • api_key (optional): Override default API key

Example:

Get a quote for swapping 1 ETH to BTC
- from_asset: ETH.ETH
- to_asset: BTC.BTC
- amount: 1
- origin: 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb
- destination: bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh

leokit_create_deposit

Generate unsigned transactions for a swap.

Parameters:

  • quote_id (required): Quote ID from leokit_get_quote
  • protocol (required): Protocol to use (e.g., thorchain, mayachain)
  • api_key (optional): Override default API key

leokit_check_status

Check the status of a swap transaction.

Parameters:

  • quote_id (required): Original quote ID
  • tx_id (required): Transaction hash on source chain
  • protocol (optional): Protocol hint
  • api_key (optional): Override default API key

leokit_get_assets

List supported tokens across blockchains.

Parameters:

  • chain (optional): Filter by chain (e.g., ETH, BTC, ARB)
  • api_key (optional): Override default API key

leokit_get_balances

Get wallet balances across multiple chains.

Parameters:

  • wallets (required): Array of { address, chain } objects
  • api_key (optional): Override default API key

Example:

{
  "wallets": [
    { "address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb", "chain": "ETH" },
    { "address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh", "chain": "BTC" }
  ]
}

Development

# Watch mode
npm run dev

# Test with MCP inspector
npm run inspect

# Build
npm run build

Asset Format

LeoKit uses a standardized asset format: CHAIN.SYMBOL-ADDRESS

Native assets:

  • BTC.BTC - Bitcoin
  • ETH.ETH - Ethereum
  • NEAR.NEAR - NEAR Protocol

Tokens:

  • ETH.USDC-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 - USDC on Ethereum
  • ARB.USDC-0xaf88d065e77c8cC2239327C5EDb3A432268e5831 - USDC on Arbitrum

Supported Chains

30+ blockchains including:

  • EVM: Ethereum, Arbitrum, BSC, Polygon, Avalanche, Optimism, Base
  • UTXO: Bitcoin, Litecoin, Dogecoin
  • Cosmos: THORChain, MAYAChain, Kujira
  • Other: NEAR, Solana, Tron, Cardano, XRP

Security

  • API keys are SHA-256 hashed before caching
  • Rate limiting: 100 req/15min per IP
  • Input validation on all parameters
  • Request size limits: 1MB max
  • See SECURITY.md for full policy

Contributing

Contributions welcome! See CONTRIBUTING.md for guidelines.

Changelog

See CHANGELOG.md for release history.

Support

License

MIT - see LICENSE for details.