MCP server

@tria-sdk/api-trading-mcp puts Tria's trading SDK behind the Model Context Protocol so Claude, Cursor, Continue, or any MCP-compatible agent can trade Hyperliquid + Decibel on the operator's behalf — with the same builder-fee attribution and thin-shim guarantee as the underlying SDK.

Why MCP instead of the raw SDK?

Direct SDKMCP server
You write code that calls client.placeOrder(...)You describe what you want in English; the agent picks the tool
Your code is a scriptYour "code" is a chat session that adapts mid-flow
Streams via callbacksStreams via start_stream → drain at your own pace
Best for deterministic botsBest for exploratory, multi-step, agentic flows

If you're writing a deterministic bot, use the SDK directly. If you want an LLM driving the account, use this server.

What it exposes

  • 25 trading tools in the tria_trade_* namespace — orders, positions, account, market data, risk, helpers, and streams. See Tools & resources.
  • 8 resources (tria://markets|account|positions|open-orders/{venue}) that clients like Claude Desktop and Cursor auto-include in context — the agent "just knows" your account state without spending a tool call.
  • Provisioning tools (gated) — a read-only provision_inspect always available, and a master-key-gated provision write tool that only registers when TRIA_TRADE_HL_MASTER_KEY is present.

Architecture

  AI agent (Claude Desktop / Cursor / Continue / custom)
            │  MCP over stdio (JSON-RPC 2.0)
            ▼
  @tria-sdk/api-trading-mcp   — tools + resources + stream-handle manager
            │  workspace dep
            ▼
  @tria-sdk/api-trading       — TriaClient + HlVenue + DecibelVenue
            │  signed L1 actions / Aptos txs
            ▼
       HL + Decibel venues (mainnet)

Status: stdio transport only; SSE/HTTP transport and npm publish land in v1.1. Until publish, vendor the bin from the monorepo (see Quickstart).

Telemetry

The server inherits the SDK's anonymous, never-blocking usage telemetry and adds an mcp_tool funnel (which tool, destructive vs read-only, arg-validation rejections). It's on by default and never emits keys or PII. Opt out with TRIA_TRADE_TELEMETRY=0 in the server's env block — see Telemetry & privacy.

Was this page helpful?