io.github.OrderlyNetwork/orderly-mcp MCP Server
io.github.OrderlyNetwork/orderly-mcp
MCP server for Orderly Network documentation, SDK patterns, and perpetual futures trading infrastructure
What is the io.github.OrderlyNetwork/orderly-mcp MCP server?
The Orderly Network MCP server provides AI assistants with access to Orderly's documentation, SDK v2 patterns, smart contract addresses, and API references. It enables developers to quickly learn about omnichain perpetual futures trading infrastructure and build trading UIs using the Orderly SDK.
This MCP server gives Claude, Cursor, and other AI clients instant access to Orderly Network's comprehensive documentation, SDK hooks and components, contract addresses across multiple chains, workflow guides, and API specifications. Use it to get code examples, understand trading concepts, look up smart contracts, and build React trading components with the Orderly SDK.
How to install io.github.OrderlyNetwork/orderly-mcp
Copy-paste configuration for popular MCP clients.
Tools & capabilities
Tools this server exposes to the agent.
search_orderly_docs— Search Orderly documentation for topics, concepts, SDK symbols (hooks, types, components), and questions. Returns documentation chunks and inline SDK symbol records with signatures and examples.get_contract_addresses— Look up smart contract addresses for Orderly on specific chains (Arbitrum, Optimism, Base, Mantle, Solana, Ethereum, Orderly L2) for mainnet or testnet.explain_workflow— Get step-by-step explanations of common development workflows: wallet connection, placing first order, depositing funds, setting take profit/stop loss, and subaccount management.get_api_info— Retrieve documentation for Orderly REST API, WebSocket streams, and authentication endpoints with parameter details and examples.get_indexer_api_info— Access Orderly Indexer API documentation for trading metrics, account events, trades, volume statistics, and rankings endpoints.get_component_guide— Get guidance on building React UI components (order entry, orderbook, positions, wallet connector) using Orderly SDK with minimal, standard, or advanced complexity levels.get_orderly_one_api_info— Retrieve Orderly One API documentation for DEX creation, graduation, theme management, statistics, leaderboards, and admin operations.
Use cases
- Build a React order entry form using Orderly SDK hooks with complete implementation guidance
- Look up smart contract addresses and integrate Orderly trading infrastructure into your dApp
- Understand Orderly's vault architecture, trading fees, order types, and leverage calculation
- Create a complete trading UI with orderbook, positions table, and wallet connection components
- Integrate Orderly Indexer API to display trading metrics, account events, and volume statistics in your application
io.github.OrderlyNetwork/orderly-mcp MCP server FAQ
It's an MCP server that gives AI assistants like Claude and Cursor access to Orderly Network's documentation, SDK patterns, contract addresses, and API specifications for building perpetual futures trading applications.
Yes, the MCP server itself is free. A public hosted instance runs at https://mcp.orderly.network. You only pay for Orderly Network's trading services if you use them.
Run `npx @orderly.network/mcp-server init --client cursor` (or `--client claude`) to automatically configure your client. Or manually add the configuration to `.cursor/mcp.json` or `.mcp.json` with the npx command.
No authentication is required for the MCP server itself. The server provides documentation and SDK patterns. Trading on Orderly Network requires wallet connection and Orderly key setup, which is documented in the workflows.
Yes. Clone the repository, run `yarn install && yarn build`, then use `yarn start` for stdio mode or `yarn start:http` for HTTP mode. Docker deployment is also supported.
Orderly supports Ethereum, Arbitrum, Optimism, Base, Mantle, Solana, and Orderly L2. Use get_contract_addresses to look up addresses for specific chains.
README (reference)
Source of truth, from the repository.
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, trades, and volume statistics
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
Hosted Server
A publicly hosted instance is available at https://mcp.orderly.network.
Health check:
curl https://mcp.orderly.network/health
Use in MCP client config (Streamable HTTP):
{
"mcpServers": {
"orderly": {
"url": "https://mcp.orderly.network/"
}
}
}
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 self-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
Note: A public instance is already deployed at
https://mcp.orderly.network- see Hosted Server above.
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 Orderlylimit(number, optional): Maximum results (default: 5)
Example queries:
- "how does the vault work"
- "trading fees"
- "order types"
- "leverage calculation"
SDK symbols (hooks, types, components, functions) are now surfaced inline by
search_orderly_docs— see SDK symbol search below.
2. get_contract_addresses
Get smart contract addresses for Orderly on specific chains.
Parameters:
chain(string, required): Chain name (e.g., 'arbitrum', 'optimism', 'base')contractType(string, optional): Contract type or 'all' (default: 'all')network(string, optional): 'mainnet' or 'testnet' (default: 'mainnet')
Supported chains:
- EVM: ethereum, arbitrum, optimism, base, mantle, solana
- Orderly L2: orderlyL2
3. explain_workflow
Get step-by-step explanation of common development workflows.
Parameters:
workflow(string, required): Workflow name
Available workflows:
wallet-connection: Connect wallet and create Orderly keyplace-first-order: Complete flow for placing first tradedeposit-funds: Deposit USDC/tokens to Orderlyset-tp-sl: Set Take Profit and Stop Losssubaccount-management: Create and manage subaccounts
4. get_api_info
Get information about Orderly REST API or WebSocket streams.
Parameters:
type(string, required): 'rest', 'websocket', or 'auth'endpoint(string, optional): Specific endpoint or stream name
5. get_indexer_api_info
Get information about Orderly Indexer API for trading metrics, account events, trades, and volume statistics (rankings endpoints available via endpoint search).
Parameters:
endpoint(string, optional): Specific endpoint path or name (e.g., '/events_v2', 'daily_volume', 'ranking/positions')category(string, optional): Filter by category (e.g., 'trading_metrics', 'events::events_api', 'trades::trades_api')
Available categories:
- Trading Metrics: Daily volume, fees, perp trading data (
/daily_volume,/daily_trading_fee,/daily_orderly_perp) - Events: Account events with pagination (
/events_v2) - trades, settlements, liquidations, transactions - Volume Statistics: Account and broker volume stats (
/get_account_volume_statistic,/get_broker_volume_statistic) - Trades: Trade data with filters (
/trades)
Rankings (no category; search by endpoint):
- Positions, PnL, trading volume, deposits/withdrawals (
/ranking/positions,/ranking/realized_pnl,/ranking/trading_volume,/ranking/deposit,/ranking/withdraw)
Example:
# Get all indexer API endpoints
get_indexer_api_info
# Get specific endpoint details
get_indexer_api_info endpoint="/events_v2"
# Get all endpoints in a category
get_indexer_api_info category="trading_metrics"
6. get_component_guide
Get guidance on building React UI components using Orderly SDK.
Parameters:
component(string, required): Component typecomplexity(string, optional): 'minimal', 'standard', or 'advanced' (default: 'standard')
Available components:
order-entry: Order placement formorderbook: Market depth displaypositions: Position management tablewallet-connector: Wallet connection UI
7. get_orderly_one_api_info
Get information about Orderly One API for DEX creation, graduation, and management.
Parameters:
endpoint(string, optional): Specific endpoint path or name (e.g., '/dex', 'verify-tx', '/theme/modify')category(string, optional): Filter by category (e.g., 'auth', 'dex', 'graduation', 'theme', 'stats', 'leaderboard', 'admin')
Available categories:
- auth: Wallet signature-based authentication (nonce, verify, validate)
- dex: DEX management - create, update, delete, deploy, and manage exchanges
- graduation: Graduation system - upgrade from demo to full broker with fee splits
- theme: AI-powered theme generation and CSS customization
- stats: Platform-wide statistics and analytics
- leaderboard: DEX rankings, performance metrics, and leaderboards
- admin: Administrative operations for platform management
Example:
# Get overview and authentication flow
get_orderly_one_api_info
# Get all endpoints in a category
get_orderly_one_api_info category="dex"
get_orderly_one_api_info category="graduation"
# Get specific endpoint details
get_orderly_one_api_info endpoint="verify-tx"
get_orderly_one_api_info endpoint="/theme/modify"
Available Resources
Access comprehensive documentation via resource URIs. All resources support fuzzy search with pagination:
Query Parameters:
search(required) - Fuzzy search querypage(optional) - Page number (default: 1)limit(optional) - Results per page, max 10 (default: 10)
Resources:
orderly://overview- High-level protocol architecture (no search required)orderly://sdk/hooks?search=orderEntry- Search SDK hooks by name, description, or categoryorderly://sdk/components?search=Checkbox- Search components by name or descriptionorderly://contracts?search=arbitrum- Search contracts by chain or nameorderly://workflows?search=wallet- Search workflows by name or stepsorderly://api/rest?search=position- Search REST API endpointsorderly://api/websocket?search=orderbook- Search WebSocket streamsorderly://api/indexer?search=events- Search Indexer API endpoints
Example:
orderly://sdk/hooks?search=useOrderEntry&page=1&limit=5
Example Usage
Searching Documentation
User: "How does Orderly's vault system work?"
AI uses search_orderly_docs with query "vault system"
→ Returns explanation of cross-chain vault architecture
Searching SDK Symbols
User: "Show me how to use useOrderEntry"
AI uses search_orderly_docs with query "useOrderEntry"
→ Returns inline SDK hook record: signature, params, returns, source path
Looking Up Contracts
User: "What's the USDC address on Arbitrum?"
AI uses get_contract_addresses with chain "arbitrum", contractType "USDC"
→ Returns contract address
Explaining Workflows
User: "How do I place my first order?"
AI uses explain_workflow with workflow "place-first-order"
→ Returns step-by-step guide
Component Building Guide
User: "How do I build an order entry component?"
AI uses get_component_guide with component "order-entry"
→ Returns complete implementation guide
Data Sources
This MCP server includes embedded data from:
- Orderly Documentation: Architecture, concepts, and guides
- SDK Patterns: v2 hook examples and patterns from @orderly.network/hooks
- DEX Examples: Complete working components from the example-dex repository
- Contract Addresses: All deployed contracts across supported chains
- API Specifications: REST and WebSocket endpoints
- Indexer API: Trading metrics, account events, trades, and volume statistics
- Orderly One API: DEX creation, graduation, and management API documentation
- Workflow Guides: Common development task explanations
Project Structure
orderly-mcp/
├── src/
│ ├── index.ts # Main server entry (stdio mode)
│ ├── http-server.ts # HTTP server entry (stateless mode)
│ ├── server.ts # Shared MCP server logic
│ ├── tools/
│ │ ├── searchDocs.ts # Unified doc + SDK symbol search
│ │ ├── contracts.ts # Contract address lookup
│ │ ├── workflows.ts # Workflow explanations
│ │ ├── apiInfo.ts # API documentation
│ │ ├── indexerApi.ts # Indexer API documentation
│ │ ├── componentGuides.ts # Component building guides
│ │ ├── orderlyOneApi.ts # Orderly One API documentation
│ │ ├── svApi.ts # Strategy Vault API documentation
│ │ └── publicInfoApi.ts # Public Info API documentation
│ ├── resources/
│ │ └── index.ts # Resource handlers
│ └── data/
│ ├── documentation.json # Searchable documentation chunks
│ ├── sdk-symbols.json # Type-accurate SDK symbols (hooks/types/components/functions)
│ ├── contracts.json # Contract addresses
│ ├── workflows.json # Workflow explanations
│ ├── api.json # API specifications
│ ├── indexer-api.json # Indexer API documentation
│ ├── orderly-one-api.json # Orderly One API documentation
│ ├── sv-api.json # Strategy Vault API documentation
│ ├── public-info-api.json # Public Info API documentation
│ ├── component-guides.json # Component guides
│ └── resources/
│ └── overview.md # Protocol overview
├── .vscode/ # VS Code settings
│ ├── settings.json
│ └── extensions.json
├── package.json
├── tsconfig.json
├── eslint.config.mjs # ESLint configuration
├── .prettierrc # Prettier configuration
├── .gitignore
├── .dockerignore # Docker ignore rules
├── Dockerfile # Docker build configuration
└── README.md
Updating Data
All data files in src/data/ are auto-generated via scripts in the scripts/ folder. Do not edit JSON files manually - they will be overwritten when regeneration scripts run.
Quick Free Refresh
Refresh all OpenAPI-sourced data (no AI calls, no API keys, internet only):
yarn update:free
This runs: generate_api_from_openapi, generate_indexer_api, generate_sv_api, generate_contracts, and generate_orderly_one_api, then builds and tests.
Prerequisites
- NEAR AI API key in
.envfile:NEAR_AI_API_KEY=your_key - Get API key at: https://cloud.near.ai/api-keys
Complete Regeneration (Recommended)
Generate everything from scratch:
# 1. (Optional) Process Telegram export — 2 steps with manual review between
node scripts/clean_telegram_export.js # 🆓 free, filter → telegram_chats_filtered/
# ...review + delete unwanted files manually...
node scripts/analyze_telegram_chats.js # 💰 costs money → tg_analysis.json
# 2. Analyze docs → docs_analysis.json 💰 costs money
# (clones OrderlyNetwork/documentation-public automatically)
node scripts/analyze_docs.js
# 3. Get type-accurate SDK symbols from npm 🆓 free
node scripts/generate_sdk_symbols.js
# 4. Get component-building guides from SDK source 🆓 free
node scripts/analyze_sdk.js
# 5. Generate documentation and workflows 💰 costs money
node scripts/generate_mcp_data.js
# 6. Generate API docs from OpenAPI spec 🆓 free
node scripts/generate_api_from_openapi.js
# 7. Generate Indexer API docs from OpenAPI spec 🆓 free
node scripts/generate_indexer_api.js
# 8. Generate Orderly One API docs from OpenAPI spec 🆓 free
node scripts/generate_orderly_one_api.js
# 9. Generate contract addresses 🆓 free
node scripts/generate_contracts.js
# 10. Build and test
yarn build && yarn test:run
Update Only Documentation
Refresh from official docs (uses git-cloned repo as source):
# 1. Analyze docs only (clones repo automatically) 💰 costs money
node scripts/analyze_docs.js
# 2. Generate 💰 costs money
node scripts/generate_mcp_data.js
# 3. Build
yarn build
Data Files
| File | Source | Generation Script |
|---|---|---|
| documentation.json | Official docs (git: documentation-public) | generate_mcp_data.js |
| sdk-symbols.json | @orderly.network/sdk-docs npm package | generate_sdk_symbols.js |
| component-guides.json | SDK source code (GitHub) | analyze_sdk.js |
| workflows.json | Official docs (git: documentation-public) | generate_mcp_data.js |
| api.json | OpenAPI spec | generate_api_from_openapi.js |
| indexer-api.json | Indexer API OpenAPI spec | generate_indexer_api.js |
| orderly-one-api.json | Orderly One OpenAPI spec | generate_orderly_one_api.js |
| sv-api.json | Strategy Vault OpenAPI spec | generate_sv_api.js |
| public-info-api.json | Public Info API MDX docs | generate_public_info_api.js |
| contracts.json | Official docs (Git: documentation-public) | generate_contracts.js |
Contributing
To add new content, you need to update the source data and regenerate:
- New Documentation: Update
documentation-publicrepo (or Telegram exports), then run generation scripts - New SDK Pattern: The SDK is auto-parsed from GitHub - patterns appear automatically when SDK updates
- New DEX Examples: Clone the example-dex repo and run the analysis scripts
- New Chain: Update source documentation, then regenerate
- New Workflow: Add to source docs or Telegram chats, then regenerate
License
MIT
Support
- Orderly Documentation: https://orderly.network/docs
- SDK Repository: https://github.com/OrderlyNetwork/js-sdk
- Orderly Discord: https://discord.gg/OrderlyNetwork
Related MCP servers

zotio
Zotero MCP server: local-first search, library checks, and preview-first writes for AI agents.
Research articles and live crypto prices for AI agents via x402 on Base.

Orphograph
Anchor a file's SHA-256 fingerprint to Bitcoin. The file never leaves the device.

Domain Security
Audit a domain's email and web security: SPF, DKIM, DMARC, MTA-STS, DNSSEC, TLS, WHOIS. No API keys.

Mexican Tax & Banking
Validate RFC, CURP, CLABE and NSS, read CFDI 4.0 invoices and check their SAT status. No keys.

