Orderly Network MCP Server
OfficialThis MCP server helps AI assistants answer Orderly Network development questions and retrieve docs, SDK patterns, contracts, workflows, and API details.
Search Orderly documentation and type-accurate SDK symbols (hooks, components, types, functions).
Look up smart contract addresses by chain, network, and contract type.
Get step-by-step guides for common workflows like wallet connection, deposits, withdrawals, and placing orders.
Retrieve REST, WebSocket, and auth API information.
Explore Indexer API data for trading metrics, events, volume stats, trades, and rankings.
Get React component-building guidance for Orderly SDK UIs.
Browse Orderly One API docs for DEX creation, graduation, themes, stats, leaderboards, and admin.
Browse Strategy Vault API docs for yield optimization, strategy providers, fund management, and liquidity providers.
Explore Public Info API query types for market, account, platform, and system data.
Provides access to Orderly Network smart contract addresses for both mainnet and testnet deployments on Ethereum.
Provides smart contract addresses for Orderly Network deployments on the Optimism network.
Provides SDK patterns, hook examples (like useOrderEntry and usePositionStream), and UI component guides specifically for building trading interfaces with React and the Orderly SDK v2.
Provides smart contract addresses for Orderly Network deployments on the Solana blockchain.
Includes patterns and setup guides for integrating TradingView charts and widgets into applications built on the Orderly Network infrastructure.
Provides hooks and UI patterns for managing wallet connections and account authentication within the Orderly Network ecosystem.
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 initThis command will:
Create the appropriate configuration file for your AI client
Install
@orderly.network/mcp-serveras a dev dependencyGuide you through the next steps
After installation: Restart your AI client and try asking: "How do I connect to Orderly Network?"
Related MCP server: hyperliquid-mcp
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
Orderly Predict: 5-minute BTC Up/Down rounds, order rules, settlement, fees, and SDK integration (covered by documentation search)
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 |
|
|
Cursor |
|
|
VS Code |
|
|
Codex |
|
|
OpenCode |
|
|
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-mcpInstall dependencies:
yarn installBuild the project:
yarn buildHosted Server
A publicly hosted instance is available at https://mcp.orderly.network.
Health check:
curl https://mcp.orderly.network/healthUse 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 startManual 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:httpThe 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-mcpThe Docker image runs in stateless HTTP mode by default.
Development
For development with auto-rebuild:
yarn devCode 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 typecheckAvailable 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 an Orderly keyplace first order/limit order: Create, track, edit, and cancel an orderdeposit: Approve and deposit through the Vault contractwithdraw: Sign the EIP-712 withdrawal and submit itset tp sl: Create bracket take-profit/stop-loss orders
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, transactionsVolume 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 guides: TradingPage, OrderBook, OrderEntryWidget, OrderEntry, PositionsWidget, WalletConnectorWidget.
Other components return a pointer to search_orderly_docs (scope sdk).
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=5Example 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 architectureSearching 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 pathLooking Up Contracts
User: "What's the USDC address on Arbitrum?"
AI uses get_contract_addresses with chain "arbitrum", contractType "USDC"
ā Returns contract addressExplaining Workflows
User: "How do I place my first order?"
AI uses explain_workflow with workflow "place first order"
ā Returns step-by-step guideComponent Building Guide
User: "How do I build an order entry component?"
AI uses get_component_guide with component "order-entry"
ā Returns complete implementation guideData 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
Orderly Predict: Round lifecycle, order rules, settlement, fee schedule, and SDK integration
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.mdUpdating 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:freeThis 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_keyGet 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:runUpdate 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 buildData Files
File | Source | Generation Script |
documentation.json | Official docs (git: documentation-public) |
|
sdk-symbols.json |
|
|
component-guides.json | Hand-written, checked against | ā |
workflows.json | Official docs (git: documentation-public) |
|
api.json | OpenAPI spec |
|
indexer-api.json | Indexer API OpenAPI spec |
|
orderly-one-api.json | Orderly One OpenAPI spec |
|
sv-api.json | Strategy Vault OpenAPI spec |
|
public-info-api.json | Public Info API MDX docs |
|
contracts.json | Official docs (Git: documentation-public) |
|
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 scriptsNew 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
Available Tools
9 toolsexplain_workflowCInspect
Get step-by-step explanation of common Orderly development workflows
Inputs: workflow (required).
get_api_infoCInspect
Get information about Orderly REST API endpoints or WebSocket streams
Inputs: type (required), endpoint.
get_component_guideCInspect
Get guidance on building React UI components using Orderly SDK
Inputs: component (required), complexity.
get_contract_addressesBInspect
Get smart contract addresses for Orderly on specific chains
Inputs: chain (required), network, contractType.
get_indexer_api_infoBInspect
Get information about Orderly Indexer API for trading metrics, account events, trades, and volume statistics (rankings endpoints available via endpoint search)
Inputs: category, endpoint.
get_orderly_one_api_infoBInspect
Get information about Orderly One API for DEX creation, graduation, and management
Inputs: category, endpoint.
get_public_info_api_infoAInspect
Get information about the Orderly Public Info API ā a zero-auth single endpoint (POST /v1/public/query) for market, account, and platform data via a type field. Covers 24 query types (marketSummary, accountState, orderbook, candles, topAddresses, etc.)
Inputs: category, queryType.
get_strategy_vault_api_infoCInspect
Get information about Orderly Strategy Vault API for yield optimization, strategy providers, and liquidity providers
Inputs: category, endpoint.
search_orderly_docsCInspect
Search Orderly Network documentation for specific topics, concepts, or questions
Inputs: query (required), limit, scope, detail.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 9 tools
Most tools target clearly distinct areas: contract addresses, workflows, React components, and several named APIs. However, search_orderly_docs overlaps with the specialized informational tools, and the multiple get_*_api_info tools can be hard to distinguish without knowing which API hosts the needed endpoint.
All tool names use consistent snake_case and follow a predictable verb_noun pattern (get_*, search_*, explain_*). The repeated get_*_api_info suffix is stable and readable rather than chaotic.
Nine tools is well scoped for a documentation and guidance server covering multiple Orderly APIs and workflows. Each tool appears to earn its place without excessive fragmentation.
The surface covers contract addresses, docs search, workflows, REST/WebSocket info, Indexer, Public Info, Orderly One, Strategy Vault, and React component guidance. Minor gaps remain, such as a general SDK/hooks reference or troubleshooting tool, but core developer needs are addressed.
Maintenance
Related MCP Connectors
Trade 16 crypto exchanges + MetaTrader 5 from your AI assistant via one MCP connection.
The OpenRouter MCP server plugs OpenRouter into the AI tools you already use. Once connected, your assistant can pull live OpenRouter data (models, prices, your credits, rankings, and docs) and send quick test messages, all without leaving your editor.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
The OpenZeppelin Solidity Contracts MCP server integrates OpenZeppelin's security and style rules into AI-driven development workflows, enabling AI assistants to generate safe, correct, and production-ready smart contracts. It automatically validates generated code against OpenZeppelin standards (including imports, modifiers, naming conventions, and security checks) and supports various contract types including ERC-20, ERC-721, ERC-1155, Stablecoins, RWA, Governor, and Account contracts through prompt-driven workflows.
Related MCP Servers
AlicenseNot gradedqualityBmaintenanceMCP server connecting AI assistants to OKX exchange, enabling trading, market data, account management, and more via 150+ tools across 11 modules.510MIT- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server for the Hyperliquid decentralized exchange, enabling AI assistants to perform trading operations, manage accounts, and retrieve market data.45 PyPI3MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for the Nado Protocol on the Ink blockchain, enabling AI assistants to query market data, manage positions, place orders, and access historical trading data.24 npm1MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that gives AI agents real-time access to DeFi across multiple chains, enabling non-custodial crypto trading, portfolio queries, and transaction execution.7MIT