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:
- Create the appropriate configuration file for your AI client
- Install
@orderly.network/mcp-serveras a dev dependency - 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
- Clone or create the project:
cd orderly-mcp
- Install dependencies:
yarn install
- 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