Skip to Content

AI Chat Integration

AI Chat uses MCP as an installed tool layer. The chat model does not receive every possible server on the platform. It receives only the tools that are relevant to the current user and safe for the current intent.

Chat Routing Flow

At a high level, an AI Chat request moves through this flow:

user message -> intent routing -> built-in tool filtering -> enabled MCP tool loading -> LLM tool-call planning -> MCPManager resolves server.tool -> transport call -> result returned to chat context

The intent router decides what kind of request the user is making. Built-in tools are filtered by intent. Installed MCP tools are exposed as external capabilities when the user has enabled the server.

Tool Exposure Rules

AI Chat should only see MCP tools that are:

  • from approved market servers, or from the user’s personal installs
  • installed by the current user
  • enabled for the current user
  • discoverable through server metadata and tool descriptions

This keeps the prompt smaller and avoids exposing tools that the user did not explicitly install.

Tool Naming

Good MCP tools are concise and specific:

  • use stable names
  • keep descriptions short and action-oriented
  • describe required inputs clearly
  • return structured JSON where possible
  • limit large result payloads before returning them to the model

Tool descriptions become part of the model’s planning context, so they should explain what the tool does without embedding long manuals.

Safety Expectations

MCP tools can bring external content into the chat loop. Server authors should avoid returning untrusted instructions as if they were system guidance.

For trading use cases:

  • read-only market and research tools are the safest default
  • write actions should require explicit confirmation
  • order placement should go through platform risk controls
  • secrets should be passed through user configuration, not hardcoded snippets

OKX Market-Only Example

For the official OKX MCP listing, Orien uses a market-only configuration:

{ "mcpServers": { "okx-cex-market": { "command": "npx", "args": ["-y", "@okx_ai/okx-trade-mcp", "--modules", "market"] } } }

This exposes market data tools without enabling trading modules by default.