Build with AI#
OKX OnchainOS Trade give agents and developers a complete swap execution layer, from getting the best multi-chain quote to a transaction, without stitching together separate routing, signing, and RPC integrations. Whether you are building an automated trading agent or embedding swap execution into a product, the Skill and MCP Server handle the entire lifecycle with production-grade patterns already built in.
Why OnchainOS Trade for AI#
- Broadest on-chain liquidity coverage. The OKX DEX aggregator routes across 500+ DEXs on 20+ chains such as Solana, Ethereum, Base, BNB Chain, Arbitrum, Sui, TON, and more. At quote time, it splits orders across multiple pools and routes to minimize price impact and maximize the amount received, not just find the cheapest single route.
- **Full execution stack in one tool.**OnchainOS Trade AI tools cover every step from quote → swap → sign with multi-chain support. An Agent can execute a complete multi-step swap from a single high-level instruction, including Approve transactions where needed, chain-specific signing flows for EVM and Solana, and confirmation handling.
- Agent-optimized interface Skill and MCP Server. OKX Web3 Trade provides two integration paths depending on how your Agent is deployed. The Skill teaches your Agent how to call the OKX DEX API through structured instructions and code generation. The MCP Server exposes the same capabilities as directly callable tools via the Model Context Protocol.
Quickstart#
By adding the Skill files to the Agent’s skill directory, the Agent will automatically load the intent router, chain-specific execution playbooks, signing modes, and error-handling logic.
skills:npx skills add okx/onchainos-skills
For Claude Desktop, Cursor, and other MCP-compatible clients, add the following configuration:
# for cursor
{
"mcpServers": {
"okx/onchainos-mcp": {
"url": "https://web3.okx.com/api/v1/onchainos-mcp",
"headers": {
"OK-ACCESS-KEY": "your apiKey applyed on https://web3.okx.com/zh-hans/onchain-os/dev-portal/project"
}
}
}
}
# for Claude code
{
"mcpServers": {
"okx/onchainos-mcp": {
"url": "https://web3.okx.com/api/v1/onchainos-mcp",
"headers": {
"OK-ACCESS-KEY": "your apiKey applyed on https://web3.okx.com/zh-hans/onchain-os/dev-portal/project"
}
"type": "http"
}
}
}
One MCP server covers both Trade and Market capabilities. Restart your client after updating the config.
