feat: Stockbit login for the order book, live quotes and daily history

Opt-in, with the user's own Stockbit session from a pasted
credentialStorage cookie (or IDX_STOCKBIT_REFRESH_TOKEN):

- idx stockbit login/status/logout; session file 0600, tokens never shown
- rotating refresh under a cross-process lock; one refresh+retry on 401
- stocks orderbook: depth with lots and orders, OHLC, value, foreign flow
- --provider stockbit quotes from the session API when logged in
- --history-provider stockbit, and auto under the stockbit provider for
  5d-1y daily windows
- MCP get_orderbook and stockbit_status (17 tools)

Endpoints, units and recorded responses from fzn0x/idx (MIT).
This commit is contained in:
hermes 2026-10-23 08:35:57 +00:00
commit b5ae9b98de
61 changed files with 2882 additions and 129 deletions

View file

@ -5,10 +5,10 @@ description: idx-mcp serves idx's stock and ownership data to AI agents over MCP
`idx-mcp` is a [Model Context Protocol](https://modelcontextprotocol.io)
server over stdio. It gives an agent the same data as the `idx` CLI, as
[15 tools](/mcp/tools/) (plus an opt-in `ownership_sync`): quotes, today's
session by the minute, price history, screening, company data, analysis,
comparison, broker summaries, bandarmology, foreign flow, and the KSEI
ownership queries.
[17 tools](/mcp/tools/) (plus an opt-in `ownership_sync`): quotes, today's
session by the minute, the order book (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](/start/config/#files-idx-keeps),
so `idx ownership sync` in a terminal also feeds the server.
@ -46,6 +46,7 @@ body, so the agent can decide whether to retry:
| --- | --- |
| 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` |