Orderly Network MCP Server

Omnichain perpetual futures trading infrastructure documentation and SDK patterns

README.md

Orderly Network MCP Server

A Model Context Protocol (MCP) server providing documentation and SDK patterns for Orderly Network - an omnichain perpetual futures trading infrastructure.

Quick Start

Install the MCP server with one command for your AI client:

npx @orderly.network/mcp-server init --client <client>

Supported clients: claude, cursor, vscode, codex, opencode

Examples

# OpenCode
npx @orderly.network/mcp-server init --client opencode

# Claude Code
npx @orderly.network/mcp-server init --client claude

# Cursor
npx @orderly.network/mcp-server init --client cursor

# VS Code (with Copilot)
npx @orderly.network/mcp-server init --client vscode

# Interactive mode (prompts for client selection)
npx @orderly.network/mcp-server init

This command will:

  1. Create the appropriate configuration file for your AI client
  2. Install @orderly.network/mcp-server as a dev dependency
  3. Guide you through the next steps

After installation: Restart your AI client and try asking: "How do I connect to Orderly Network?"


What This Server Provides

This MCP server enables AI assistants to answer questions about Orderly Network and guide developers in building React components using the Orderly SDK v2.

Features

  • Documentation Search: Query Orderly docs for architecture, APIs, and concepts
  • SDK Patterns: Get code examples for all v2 hooks (useOrderEntry, usePositionStream, etc.)
  • Contract Addresses: Lookup smart contract addresses for all supported chains
  • Workflow Guides: Step-by-step explanations of common development tasks
  • Component Guides: Patterns for building trading UI components
  • API Reference: REST and WebSocket endpoint documentation
  • Indexer API: Trading metrics, account events, volume statistics, and rankings

Installation

Quick Install (Recommended)

Use the CLI to automatically configure your AI client:

npx @orderly.network/mcp-server init --client <client>

Available clients:

Client Command Config Location
Claude Code --client claude .mcp.json
Cursor --client cursor .cursor/mcp.json
VS Code --client vscode .vscode/mcp.json
Codex --client codex ~/.codex/config.toml
OpenCode --client opencode .opencode/mcp.json

Manual Setup

If you prefer to configure manually or the automatic setup doesn't work for your client:

Prerequisites
  • Node.js 18 or higher
  • Yarn (or npm)
Setup from Source
  1. Clone or create the project:
cd orderly-mcp
  1. Install dependencies:
yarn install
  1. Build the project:
yarn build

Running the Server

The MCP server supports two modes:

1. Stdio Mode (Default - for local MCP clients)

Use this for local AI assistants:

yarn start
Manual Configuration

If not using the automatic installer, add this configuration to your AI client:

Claude Code (.mcp.json):

{
  "mcpServers": {
    "orderly": {
      "command": "npx",
      "args": ["@orderly.network/mcp-server@latest"]
    }
  }
}

Cursor (.cursor/mcp.json):

{
  "mcpServers": {
    "orderly": {
      "command": "npx",
      "args": ["@orderly.network/mcp-server@latest"]
    }
  }
}

VS Code (.vscode/mcp.json):

{
  "servers": {
    "orderly": {
      "command": "npx",
      "args": ["@orderly.network/mcp-server@latest"]
    }
  }
}

OpenCode (.opencode/mcp.json):

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "orderly": {
      "type": "local",
      "command": ["npx", "@orderly.network/mcp-server@latest"],
      "enabled": true
    }
  }
}

Codex (~/.codex/config.toml):

[mcp_servers.orderly]
command = "npx"
args = ["@orderly.network/mcp-server@latest"]
2. HTTP Mode (for hosted deployments)

Run as an HTTP server for remote access:

yarn start:http

The server will start on port 3000 (or PORT env var):

  • MCP endpoint: http://localhost:3000/
  • Health check: http://localhost:3000/health

Docker Deployment:

# Build the image
docker build -t orderly-mcp .

# Run the container
docker run -p 3000:3000 orderly-mcp

The Docker image runs in stateless HTTP mode by default.

Development

For development with auto-rebuild:

yarn dev

Code Quality

This project uses ESLint and Prettier for code quality:

# Run linting
yarn lint

# Fix linting issues
yarn lint:fix

# Format code
yarn format

# Check formatting
yarn format:check

# Type check
yarn typecheck

Available Tools

1. `search_orderly_docs`

Search Orderly documentation for specific topics, concepts, or questions.

Parameters:

  • query (string, required): Search query about O

Tools 1

search_orderly_docsSearch Orderly documentation for specific topics, concepts, or questions.

Environment Variables

PORTPort for HTTP mode server

Try it

How do I connect to Orderly Network?
Show me the code example for the useOrderEntry hook.
What are the smart contract addresses for Orderly on Arbitrum?
Explain the workflow for building a trading UI component with Orderly SDK v2.
Search the documentation for information on the Indexer API trading metrics.

Frequently Asked Questions

What are the key features of Orderly Network?

Query Orderly documentation for architecture, APIs, and concepts. Retrieve code examples for v2 SDK hooks like useOrderEntry and usePositionStream. Lookup smart contract addresses for all supported chains. Access step-by-step workflow guides for common development tasks. Retrieve trading metrics and account event data via Indexer API.

What can I use Orderly Network for?

Developers building trading UIs needing quick access to SDK patterns. Engineers integrating Orderly Network into existing dApps. Users looking for specific smart contract addresses for deployment. Developers troubleshooting API integration using documentation search.

How do I install Orderly Network?

Install Orderly Network by running: npx @orderly.network/mcp-server init --client <client>

What MCP clients work with Orderly Network?

Orderly Network works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Orderly Network docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Open Conare