Skip to content

MCP server

Markdown

idx-mcp is a Model Context Protocol server over stdio. It gives an agent the same data as the idx CLI, as 21 tools (plus an opt-in ownership_sync): quotes, today’s session by the minute, the order book, corporate actions and insider movements (with a Stockbit login), price history, screening, company data, analysis, comparison, broker summaries, bandarmology, foreign flow, and the KSEI ownership queries.

It shares idx’s config, cache and ownership database, so idx ownership sync in a terminal also feeds the server.

Set it up in your agent →

Tools that fetch live data return:

{
"data": { "...": "the same shape as idx -o json" },
"source": "msn",
"fetched_at": "2026-10-15T03:20:11Z",
"stale": false
}

source is the provider (msn, yahoo, ipot, idx or stockbit). Results are cached on disk; stale is true when an expired cache entry was served because a fresh fetch failed. Ownership tools return their data directly, from the local database.

What idx prints as a warning in a terminal comes back in warnings, on an answer or an error, when there was any. For example, history that fell back to Yahoo because Stockbit refused your session says so, and a stale answer names the failure behind it:

{
"data": [{ "date": "2026-11-03", "close": 9875, "...": "..." }],
"source": "yahoo",
"fetched_at": "2026-11-04T03:20:11Z",
"stale": false,
"warnings": ["Stockbit rejected the session; run `idx stockbit login` again; history falls back to yahoo meanwhile"]
}

Errors come back as a tool result with isError set and the CLI’s error body, so the agent can decide whether to retry:

{"error": true, "code": "PROVIDERUNAVAILABLE", "message": "..."}
Input Limit
tickers per call (get_quotes, compare_stocks) 20, duplicates removed
get_intraday tail 400 minutes (default: the whole session)
get_orderbook depth 50 levels per side (default 10)
screen_stocks limit 200
search_investors limit 100
get_ownership_changes limit 300 per page (default 200); page with offset
concurrent tool calls 4

Ownership tools need a populated database. Either run idx ownership sync once, or start the server with --allow-sync, which adds an ownership_sync tool so the agent can download the snapshot itself (several MB).