China platform setup

Connect A-share data in Trae

Trae works. Add it manually under Settings → MCP with a URL and headers — Trae HTTP configs natively include a headers field.

Setup

1Add manually (recommended)

Open Settings (top right in IDE mode, top right of the chat panel in SOLO mode) → MCP in the left nav → Add → Add manually, paste the block below and confirm:

Manual configuration
{
  "mcpServers": {
    "ashareapi": {
      "url": "https://api.ashareapi.com/mcp",
      "headers": { "Authorization": "Bearer ct-YOUR-KEY" }
    }
  }
}

For free tools only, delete the headers line. Once added, ashareapi appears in the MCP list and you can expand it to see the tool list.

2Prefer per-project config?

Create .trae/mcp.json in the project root with the same content. Then go to Settings → MCP and turn on Enable project-level MCP, confirming the dialog.

⚠️ Project-level config is not loaded by default — without that toggle, .trae/mcp.json is ignored.

3Use it in chat

Back in the chat, just ask. Trae picks the right tool and asks for confirmation before calling it.

Paid tools? Add a key

These 6 free tools need no key: quote / K-line / hot list / market overview / breadth / docs search. Financials, fund flow, dragon-tiger list, sectors, factor screening and backtests need a key (trial from ¥9.9, all 86 tools). Put it in headers:

headers
"headers": {
  "Authorization": "Bearer ct-YOUR-KEY"
}

⚠️ The name must be Authorization and the value must start with Bearer (one space after Bearer).

What to ask once it works

  • What is the price of 600667 right now?
  • Pull the last 60 daily candles for 600667
  • How is the market doing today?
  • What is the fund flow for 太极实业 (600667) today?
  • Find stocks with PE below 20 and ROE above 15
  • What did institutions buy on the dragon-tiger list today?

FAQ

Which transports does Trae support?

Three: stdio, SSE and Streamable HTTP. We use Streamable HTTP — a remote service, nothing to install locally.

Do I need NPX or UVX first?

No. NPX / UVX are for stdio-based local servers (that is what the "prefer NPX or UVX" hint refers to). Our server is remote — a URL is all you need.

No tools show up after adding it?

① Make sure the URL ends with /mcp ② wait a few seconds or refresh the MCP panel ③ the tool list is synced at save time, so re-save the config after we add new tools.

The assistant says it cannot find data.

① When the anonymous daily quota runs out you get a Chinese message 「匿名每日额度已用完(100000 条/天)」 — add a key to lift it ② stock codes need a market prefix (sh600667 / sz000001 / hk00700) ③ for paid tools check the space in Bearer inside headers.

Related

No key yet?

Try the free tools without a key; get one for all 39 tools (from ¥9.9).

Official docs:https://docs.trae.cn/ide/model-context-protocol·Last checked:2026-10-29