Connect Your AI Agent
Connect your agent to Trade8 through the Model Context Protocol (MCP). Give it access to exchange data, account positions, and custody records, then choose whether it can submit or cancel orders.
| Setting | Value |
|---|---|
| Server URL | https://mcp.trade8.xyz/mcp |
| Transport | Streamable HTTP |
| Protocol revision | 2026-07-28 |
| Authorization | Public catalog access; OAuth bearer token for private calls |
| Tools | 17 read tools and 2 trading actions |
Connect a Client
Section titled “Connect a Client”- Add
https://mcp.trade8.xyz/mcpto your client’s remote-server settings. - Select protocol revision
2026-07-28and callserver/discover. - Run
tools/list. The public connection exposes three catalog tools without a token. - Use
trade8_get_marketwithinstrument: "BTC-PERP"to read native contracts across centralized and decentralized exchanges.
The Node.js client sends the required metadata and headers. Clients using older protocol revisions must support the documented revision before connecting.
VS Code Configuration
Section titled “VS Code Configuration”Add this entry to .vscode/mcp.json or your user MCP configuration. Use a client version that supports the protocol revision above. Keep private-access credentials in the client’s credential store.
{ "servers": { "trade8": { "type": "http", "url": "https://mcp.trade8.xyz/mcp" } }}Start the server from the configuration editor, review the tools, and select the read tools in your agent’s tool picker. Client settings and policy can restrict which tools appear. See the VS Code MCP guide for configuration and permission controls.
Try a Read-Only Workflow
Section titled “Try a Read-Only Workflow”Ask your agent:
Compare BTC perpetual contracts on Binance, Bybit, OKX, Hyperliquid, and dYdX. Show the settlement asset, quantity unit, and available size and price increments.
The agent can use trade8_get_market. Its structured response is the same reference metadata returned by the public REST endpoint.
{
"jsonrpc": "2.0",
"id": "call-trade8_get_market",
"method": "tools/call",
"params": {
"name": "trade8_get_market",
"arguments": {
"instrument": "BTC-PERP"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientInfo": {
"name": "trade8-research-agent",
"version": "1.0.0"
},
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}With account permissions, other workflows include:
- “List my open BTC positions on Binance and Bybit. Show size, margin mode, and unrealized P&L separately for each exchange.”
- “Read the next funding interval for BTC perpetuals on Hyperliquid. Show the rate as a percentage and include the settlement asset.”
- “Show the active collateral allocations through Ceffu and Copper, grouped by exchange and asset.”
Check timestamps, units, and account IDs in the results. Keep USDT and USDC balances separate unless you explicitly supply a conversion rate.
Authorize Access
Section titled “Authorize Access”Private calls require an MCP access token and the scopes below. Use the access process for your approved account; Contact Us for connection authorization. Keep REST signing secrets separate from MCP bearer tokens.
| Scope | Access |
|---|---|
market:read |
Order books and funding |
accounts:read |
Authorized accounts, balances, fees, positions, and risk |
orders:read |
Orders, fills, and lookup by client order ID |
custody:read |
Custodians, allocations, and settlements |
orders:write |
Submit and cancel orders within the authorized accounts |
Start with the smallest grant. An account_id argument selects from that grant; changing the argument cannot expand it. Use the connection’s authorization controls to change access or revoke it.
Keep OAuth tokens in the client’s credential store or a secret manager. REST signing secrets belong in the REST client; wallet keys, seed phrases, and exchange passwords should stay outside prompts and MCP arguments. Account data returned to the agent is subject to your AI provider’s handling and retention settings.
For client implementers, follow MCP authorization, including issuer validation and resource-bound tokens.
Trading With Confirmation
Section titled “Trading With Confirmation”Enable orders:write only for a workflow that needs it. Configure the host to show the exact tool arguments for approval before every trade8_create_order or trade8_cancel_order call.
Before submission, review:
- Account, contract, settlement asset, side, and base-asset quantity.
- Order type, price, time in force, and any stop or take-profit trigger.
- Allowed exchanges, slippage limit, post-only, and reduce-only settings.
- Current positions, margin headroom, and fees.
An agent can prepare a request from read-only data. Submit it after the user has approved those details. Tool annotations describe side effects; account grants and the host’s approval policy enforce access. Keep write tools out of any client that cannot enforce that policy.
Save client_order_id and idempotency_key before the call. After an uncertain result, use trade8_find_order with the saved client ID. Recover a submission with the same arguments and idempotency key; a new key can create a new action. See MCP Tool Reference for the exact request.
Order submission returns an order state. Track fills through trade8_get_order, trade8_list_fills, or the WebSocket orders channel. Use trade8_cancel_order to cancel an existing order; closing the AI conversation only ends that conversation.
The MCP tool set covers order submission and cancellation. Leverage changes, transfers, withdrawals, and collateral movements stay in their dedicated account workflows.
Choose the Right Interface
Section titled “Choose the Right Interface”| Task | Interface |
|---|---|
| Agent research, exposure reviews, and assisted order entry | MCP |
| Programmatic execution and continuous quoting | REST API |
| Continuous market data, order events, and fill recovery | WebSocket API |
Keep latency-sensitive quoting and risk limits in your execution system. Use the agent for analysis and explicit tasks, with exchange data and account limits as the source of truth.
Build a Custom Client
Section titled “Build a Custom Client”The MCP Protocol Guide covers discovery, request headers, JSON-RPC calls, responses, pagination, and error recovery. The Tool Reference includes argument and result schemas for all 19 tools.
Download the tool catalog or the read-only Node.js client. Examples use illustrative accounts, prices, and balances.