1inch Cross-Chain Swap MCP Server

1inch Cross-Chain Swap MCP Server

An MCP server that enables cross-chain token swapping between different blockchains using 1inch Fusion+ API, along with portfolio management tools for tracking assets across chains.

Category
Visit Server

README

1inch Cross-Chain Swap Tool

A tool for executing cross-chain token swaps using 1inch Fusion+ and Model Context Protocol (MCP).

Demo Video

Video Title

Overview

This tool facilitates cross-chain token swaps between different blockchains (Arbitrum, Base, Polygon, etc.) using the 1inch Fusion+ API. It handles the entire swap process, from initiating orders to monitoring their execution status through a background worker system.

Installation

Dependencies must be installed using pnpm or yarn and not npm:

pnpm install
# or
yarn install

Configuration

The project must be setup as a CommonJS project. The design of the library does not work in its current form if you import it as ESM.

  1. Create a .env file in the root directory and populate it with the following variables:
DEV_PORTAL_KEY=replace_with_developer_portal_api_key
WALLET_ADDRESS=replace_with_wallet_address
WALLET_KEY=replace_with_wallet_private_key
RPC_URL_ETHEREUM=replace_with_ethereum_rpc_url
RPC_URL_BASE=replace_with_base_rpc_url
INCH_API_KEY=replace_with_1inch_api_key

Usage

Start the MCP Server

npm start

This starts the Model Context Protocol server which exposes tools for cross-chain swapping and portfolio management.

Available MCP Tools

The tool provides the following MCP functions that can be used with Claude or other MCP-compatible assistants:

Cross-Chain Swap

  • swap: Initiates a cross-chain token swap
    Parameters:
    - srcChainId: Source chain ID (default: 8453/Base)
    - dstChainId: Destination chain ID (default: 42161/Arbitrum)
    - srcTokenAddress: Source token address
    - dstTokenAddress: Destination token address
    - amount: Amount to swap (in base units or human-readable format)
    - invert: Swap direction toggle (default: false)
    

Order Management

  • swap-status: Checks the status of swap orders
    Parameters:
    - orderHash: (Optional) Specific order hash to check
    

Portfolio Management

  • portfolio-protocols-value: Gets the value of protocols in your portfolio

    Parameters:
    - chainId: Blockchain ID (default: 1/Ethereum)
    
  • portfolio-tokens-details: Gets detailed information about tokens in your portfolio

    Parameters:
    - chainId: Blockchain ID (default: 1/Ethereum)
    - closed: Include closed positions (default: true)
    - closedThreshold: Threshold for considering positions closed (default: 1)
    
  • portfolio-general-value: Gets the general value of your portfolio

    Parameters:
    - chainId: Blockchain ID (default: 1/Ethereum)
    
  • portfolio-value-chart: Gets chart data for portfolio value over time

    Parameters:
    - chainId: Blockchain ID (default: 1/Ethereum)
    

Monitoring System

The application includes a background worker system that monitors and processes swap orders:

Monitor Commands

# Start the monitor daemon
npm run monitor:start

# Check status of all orders
npm run status

# Check status of monitor daemon
npm run monitor:status

# Stop the monitor daemon
npm run monitor:stop

How the Worker System Functions

  1. When a swap is initiated, the order information is saved to order-status.json
  2. The monitor daemon continuously checks for new orders that need monitoring
  3. For each new order, a dedicated worker process is spawned
  4. The worker monitors the order status and submits secrets when needed to complete the swap
  5. Once an order is executed, the worker is terminated and the status is updated

Technical Notes

  • Built with the 1inch Cross-Chain SDK for secure cross-chain swaps
  • Uses Model Context Protocol for AI-assistant integration
  • PrivateKeyProviderConnector in the Fusion SDK supports BlockchainProviderConnector
  • The tool handles secret management for cross-chain swap verification

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured