OpenOcean

Model Context Protocol Server for Decentralized Exchanges
  • typescript

1

GitHub Stars

typescript

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "openocean-finance-openocean-mcp": {
      "command": "pnpm",
      "args": [
        "dlx",
        "openocean-mcp"
      ]
    }
  }
}

You are running an MCP server that delegates cross‑DEX token swaps via OpenOcean’s aggregation API. This server exposes MCP-compatible tools you can query to get quotes, fetch token and DEX data, and execute swaps across supported chains. It’s designed to be used by AI assistants, IDE extensions, and custom apps to automate and orchestrate multi‑DEX trades.

How to use

You interact with the server through an MCP client. The client can request chain data, price quotes, swap transactions, and transaction status across multiple chains. Use the tools to discover supported chains, fetch gas prices, obtain swap quotes, and construct or fetch details of a swap transaction before you submit it.

Key actions you can perform with the server include:

  • List supported chains and assets
  • Check current gas prices for a chain
  • Get a swap quote for a given input token, output token, and amount
  • Build and prepare a swap transaction for a specific account
  • Retrieve transaction status by hash
  • Retrieve token lists and DEX lists for a chain

How to install

Prerequisites you need on your local machine or CI environment:

  • Node.js version 18 or newer
  • pnpm package manager

Choose an installation method that fits your workflow.

Option A: Run directly with pnpm dlx (recommended for MCP client setups)

Option B: Install globally with pnpm to enable a system‑wide command

Option C: Build from source for development or customization

# Option A: Run via pnpm dlx (recommended for MCP clients)
pnpm dlx openocean-mcp

# If you are wiring this into an MCP client, you would reference the above runtime appropriately in your MCP config.
# Option B: Install globally with pnpm
pnpm add -g openocean-mcp

# Then you can run the server with:
openocean-mcp

Option C: Build from source for development

# Clone the repository
git clone https://github.com/openocean-finance/openocean-mcp.git
cd openocean-mcp

# Install dependencies
pnpm install

# Build the server (produces dist/)
pnpm run build

If you clone and install, the prepare step will run build automatically so dependencies are ready for use after install.

Additional sections

Configuration and runtime behavior are driven by how you start the server from an MCP client. The typical approach is to run the MCP server through a standard command invocation and point your client to that process. No extra server-side configuration is required beyond what your MCP client provides for environment variables and startup context.

Security considerations: limit access to the server by using your MCP client's authentication and wallet‑address controls. Do not expose the server to untrusted networks and ensure environment variables that hold secrets are managed securely by your deployment platform.

Troubleshooting tips: verify the server process is running, confirm the MCP client is pointed at the correct startup command, and check for environment variables required by wallet providers or API keys. If you encounter issues starting from a local build, ensure dependencies are installed and the build output directory is accessible to runtime scripts.

Available tools

CHAIN_LIST

Fetch the list of supported blockchain networks and chain codes the MCP server can interact with.

GAS_PRICE

Retrieve current gas prices for a specified chain code to estimate swap costs.

QUOTE

Request a swap quote by providing chain, input/output token addresses, amount, and slippage to receive pricing and routing information.

SWAP

Construct a swap transaction by specifying chain, input/output tokens, amount, slippage, and your wallet address.

GET_TRANSACTION

Obtain details and status for a previously submitted swap transaction using its hash.

TOKEN_LIST

Fetch the list of tradable tokens for a given chain.

DEX_LIST

Fetch the list of decentralized exchanges available on a specific chain.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational