Indonesian stock market (IDX / IHSG) analysis for people and AI agents.
One binary: a CLI that prints tables, a JSON mode for scripts, and an MCP server for agents.
idx stocks quote BBCA,BBRI,TLKM
╭────────┬──────────────────────────────┬───────┬──────┬─────────┬───────┬───────┬───────┬───────────────┬─────────┬───────┬────────╮
│ Symbol ┆ Name ┆ Price ┆ Chg ┆ Chg % ┆ Open ┆ High ┆ Low ┆ Volume ┆ Mkt Cap ┆ P/E ┆ Div % │
╞════════╪══════════════════════════════╪═══════╪══════╪═════════╪═══════╪═══════╪═══════╪═══════════════╪═════════╪═══════╪════════╡
│ BBCA ┆ PT Bank Central Asia Tbk ┆ 5,175 ┆ -900 ┆ -14.81% ┆ 5,825 ┆ 5,825 ┆ 5,175 ┆ 1,241,098,200 ┆ 635.7T ┆ 10.96 ┆ 6.27% │
│ BBRI ┆ PT Bank Rakyat Indonesia (P… ┆ 2,640 ┆ -460 ┆ -14.84% ┆ 2,640 ┆ 2,890 ┆ 2,640 ┆ 1,193,916,400 ┆ 397.8T ┆ 6.49 ┆ 13.48% │
│ TLKM ┆ Perusahaan Perseroan (Perse… ┆ 1,900 ┆ -330 ┆ -14.80% ┆ 1,900 ┆ 1,985 ┆ 1,900 ┆ 963,614,200 ┆ 187.3T ┆ 10.98 ┆ 10.01% │
╰────────┴──────────────────────────────┴───────┴──────┴─────────┴───────┴───────┴───────┴───────────────┴─────────┴───────┴────────╯
Last trade 2026-10-16 16:14 WIB · market closed · delayed data
idx -o json stocks quote BBCA | jq '.data[0] | {price, change_pct, pe_trailing, dividend_yield_pct}'
{ "price": 5175.0, "change_pct": -14.814815, "pe_trailing": 10.963983, "dividend_yield_pct": 6.27 }
- Free data, no keys. Yahoo Finance and MSN Money for prices and
fundamentals, the exchange's own idx.co.id summaries for foreign flow,
member activity, indices and the corporate-action calendar, IDX's monthly
KSEI register for ownership, Indo Premier's broker summary for who bought
and sold (read as bandarmology by
idx bandar) and for foreign flow in rupiah (stocks foreign --source ipot), its corporate-action pages, Kontan and CNBC Indonesia feeds for news. Every source sits behind aProvidertrait, so one breaking does not take the tool down, andautofills gaps in one source's fundamentals from the other. - Built for agents.
-o jsonemits a stable, schema-documented envelope (idx schema quotes),-o jsonlone record per line. Exit codes mean something, and-reads tickers from stdin so commands chain.idx mcpexposes every command as a typed MCP tool that returns the very same JSON. - Works offline. Responses are cached with per-endpoint TTLs;
--offlineserves the cache instead of failing when the network is gone. - Ownership, not just prices. KSEI's monthly register of holders above 1 %
is imported into local SQLite with normalised entity names, so "who owns
more than 1 % of BBCA" and "what did this fund change last month" are one
command each. The monthly IDX files are mirrored to GitHub, so neither you
nor the web terminal imports anything by hand:
idx ownership syncinstalls every month in one download. - Single static binary. Rust, no runtime, Linux / macOS / Windows.
Install
The package is called ihsg-cli; the command it installs is idx
(npm also adds ihsg-cli as an alias).
cargo install --locked ihsg-cli # crates.io, builds from source (Rust 1.89+)
npm install -g ihsg-cli # npm
npx ihsg-cli stocks quote BBCA # npm, no install
curl -fsSL https://raw.githubusercontent.com/fzn0x/idx/main/install.sh | sh # Linux, macOS
nix profile install github:fzn0x/idx # Nix (Linux; Apple silicon macOS untested), with shell completions
nix run github:fzn0x/idx -- stocks quote BBCA # Nix, no install
npm installs a small launcher; the first idx command downloads the
prebuilt binary for your platform from the matching GitHub release and checks
it against the release's SHA256SUMS (so does install.sh). The binary is
stored next to the launcher, or in a per-user cache when the global npm
folder is not writable. npm install -g github:fzn0x/idx installs the same
launcher from this repository's main; npm 12 only installs from git with
--allow-git=all.
Windows without npm: download idx-<version>-x86_64-pc-windows-msvc.zip from
the releases page. Static Linux
binaries are musl builds and run on any distribution. The development version installs
with cargo install --git https://github.com/fzn0x/idx.
Nix builds idx from source on your machine (there is no binary cache), so the
first nix profile install or nix run takes several minutes. The bare
github:fzn0x/idx ref follows main; add a release tag to pin one, as in
github:fzn0x/idx/v0.8.2 (the first release with the flake). For MCP clients,
install once and register $HOME/.nix-profile/bin/idx, written as an absolute
path, with the argument mcp: idx mcp setup prints the binary's resolved
/nix/store path, which an upgrade followed by garbage collection removes.
nix run github:fzn0x/idx#mcp starts the same server without installing, for
trying it from a terminal; do not make it a client's server command, because a
cold start (the first run, or the first after main moves) builds idx before
the server answers, which takes longer than clients wait. overlays.default
adds pkgs.idx for NixOS and home-manager configurations, and nix develop in
a clone gives the toolchain from rust-toolchain.toml plus Node for web/. On
NixOS, point idx stockbit login at a browser with
IDX_BROWSER=$(command -v chromium), or sign in with
idx stockbit login --page in any browser; idx switches to the page by itself
when it finds no Chromium-family browser.
Shell completions:
idx completions bash > ~/.local/share/bash-completion/completions/idx
idx completions zsh > ~/.zfunc/_idx
idx completions fish > ~/.config/fish/completions/idx.fish
idx completions powershell | Out-String | Invoke-Expression
Commands
| command | what it does |
|---|---|
stocks quote <SYMBOLS> |
Delayed quote for one or many tickers (BBCA,BBRI or BBCA BBRI; .JK optional; - reads them from stdin; another Yahoo Finance market by its suffix, e.g. D05.SI) |
stocks history <SYMBOL> [--period 1y] [--interval 1d] [--limit 30] |
OHLCV candles with a summary line. Periods 1d 5d 1mo 3mo 6mo 1y 2y 5y 10y ytd max, intervals 1m 2m 5m 15m 30m 1h 1d 1wk 1mo (1m covers at most 5d, 2m at most 1mo) |
stocks intraday <SYMBOL> [--interval 1m] [--limit 15] |
The latest session by the minute (today's while the market trades, otherwise the last one): OHLCV bars, the quote with its previous close and change, and a summary of the bars with VWAP computed by idx. Yahoo's chart, no login, about 10 minutes behind the market; works for IHSG (^JKSE) too. --provider stockbit makes the bars realtime |
stocks profile <SYMBOL> |
Sector, industry, description, size, headquarters, management |
stocks financials <SYMBOL> [--period annual|quarterly|ttm] [--statement income,balance,cash] |
Income statement, balance sheet, cash flow; --statement (comma-separated or repeated, all by default) picks the tables shown |
stocks earnings <SYMBOL> [--annual|--quarterly] [--reported|--estimates] |
Quarterly EPS vs estimates with surprise, yearly and quarterly revenue/earnings, analyst consensus for this and next quarter and fiscal year, next earnings date; the flags keep only those rows in every format (--history/--forecast are aliases) |
stocks dividends <SYMBOL> |
Every cash dividend (ex-date, split-adjusted amount) and split; yearly totals, TTM total and yield, payout streak |
stocks returns <SYMBOLS> [--benchmark ^JKSE] |
1w/1m/3m/6m/YTD/1y/3y/5y returns, CAGR, volatility, max drawdown, best/worst day, 52-week position, and excess over IHSG |
stocks rotation <SYMBOLS> [--benchmark ^JKSE] [--interval 1wk|1d] [--window 14] [--tail 10] (alias rrg) |
Relative rotation graph: each ticker's RS-Ratio, RS-Momentum and quadrant (leading, weakening, lagging, improving) against IHSG, with its recent path. An open approximation of the JdK formulas; see Relative rotation |
stocks brief <SYMBOL> |
One page: quote, verdict, signal, returns vs IHSG, dividends, top holders, headlines, with plain-language key points |
stocks fundamental <SYMBOL> |
P/E, P/B, PEG, EV/EBITDA, ROE, ROA, margins, leverage, growth, dividend, analyst targets, plus a plain-language verdict that lists every rule it applied (negative equity counts against a company; multiples that mix USD statements with an IDR price are marked and not scored) |
stocks growth <SYMBOL> |
Growth lens: latest-quarter revenue and earnings growth, forward EPS against trailing, and revenue and net income across the annual statements (CAGR, how often revenue grew, a turn from profit to loss); every rule with its points, every skipped rule with the reason |
stocks valuation <SYMBOL> |
Valuation lens: P/E, PEG, P/B, P/S, EV/EBITDA, dividend yield and the analyst target (3 or more analysts), each scored; multiples that mix USD statements with an IDR price are shown, not scored |
stocks risk <SYMBOL> |
Risk lens: negative equity, debt/equity, current ratio, losses, and beta, volatility and largest fall against IHSG over a year of daily closes (computed by idx, not the source's beta). stocks fundamental <SYMBOL> --lens growth|valuation|risk gives the same three readings |
stocks technical <SYMBOL> [--period 1y] |
RSI, MACD, SMA/EMA 20/50/200, Bollinger, ATR, volume, support/resistance, trend, buy/sell/neutral signal with reasons |
stocks compare <SYMBOLS> |
Side-by-side fundamentals for two or more tickers |
stocks screen [--preset P] [-f "pe<15,roe>15,sector=financial"] [--sort KEY] [--asc|--desc] [--returns] |
Screener over ~950 IDX tickers: one batch quote for valuation/size/dividend keys and range (position in the 52-week range), one request for MSN's whole-market list for the return keys ret1w ret1m ret3m ret6m retytd ret1y, per-company fundamentals for the rest (capped, largest first). Presets defined by idx: top-performers, worst-performers, high-dividend, low-pe, 52w-high, 52w-low, high-volume, large-cap. A P/B over statements in another currency than the price (USD reporters such as BSSR) is marked with *, and pb and ps filters and sorts read such P/B and P/S as missing |
stocks news [SYMBOL] [--company-only] [--source kontan|cnbcindonesia|all] |
Headlines from Kontan and CNBC Indonesia RSS. With a ticker, the company's headlines come first, then market context fills the limit |
stocks sentiment <SYMBOL> |
Aggregate lexicon sentiment over the matching headlines, with counts, terms and the strongest headlines |
stocks insights <SYMBOL> [--all] |
MSN Money's rule-based statements (about 30, in Valuation, Earnings, Growth, Performance, Health), each rated good, bad, neutral or not rated against the peers, the industry, the company's own history or the price, with the peer tickers |
stocks actions <SYMBOL> [--since D] |
Corporate actions from IPOT, upcoming ones included: cash and stock dividends, splits, bonus shares, rights issues (amount, ratio old:new, cum, ex, recording and payment dates, status, announcement), shareholders' meetings (RUPS: time, venue, agenda), listed warrants and rights |
stocks foreign <SYMBOL> [--days 20 | --from D --to D] [--source idx|ipot] |
Foreign buying and selling per session, totals and the net-buy/net-sell streak: from idx.co.id by default (shares on the regular board, as IDX publishes them, net and net × close), or from IPOT with --source ipot (rupiah across all boards, value traded and foreign share; works where idx.co.id refuses the connection) |
stocks list [--board B] [--search S] |
Listed stocks from idx.co.id with listing board, listing date and shares; the bundled universe stands in offline |
ownership import --latest|--all [--family composition]|--file F|--url U |
Import KSEI's monthly ">1 % holders" register (XLSX or PDF) into local SQLite. --latest/--all read idx.co.id and fall back to the CI-maintained GitHub mirror. --family composition, or a ZIP/TXT given to --file/--url, imports KSEI's composition archive into its own tables |
ownership sync [--force] · ownership status |
Install the prebuilt SQLite snapshot CI builds from the mirrored files (one download, SHA-256 checked), then any newer month; a database holding months the snapshot lacks is kept unless --force (a .bak copy is kept). status shows the local database, the mirror and what sync would do |
ownership ticker <SYMBOL> [--as-of D] |
Holders above 1 % of a ticker (a holder's accounts summed; controller/affiliate flag from the 30 Oct 2026 register) |
ownership entity "<NAME>" [--as-of D] [--exact] |
Every position of a person or institution, spelling variants grouped (--exact: one holder by its key) |
ownership search "<NAME>" [--limit N] [--as-of D] |
Find holders by name in every imported month: every spelling KSEI printed, words in any order, with the key for entity --exact |
ownership cross-holders [--min-issuers N] [--type T] [--origin foreign|local] |
Holders ranked by the number of issuers they own more than 1 % of, with every position |
ownership concentration [SYMBOLS] [--by hhi|top1|top3] [--ascending] |
Issuers ranked by disclosed ownership concentration: HHI over the listed holders, largest and top-3 stakes, undisclosed percent, controller stake |
ownership graph <ROOT> [--depth N] [--min-pct P] [--max-nodes N] [--dot] |
Holder-issuer network around a ticker or holder, as a table, JSON or Graphviz DOT |
ownership resolve candidates|merge|map|list|undo |
Suggest, merge and split holder spellings KSEI printed differently between months (rules stored in the local database, undoable) |
broker <SYMBOLS> [--date D | --from D --to D] [--investor all|foreign|domestic] [--board all|regular|cash|negotiated] [--source auto|ipot|stockbit] |
Broker summary: which brokers bought and sold a ticker, ranked by lots, with broker name, class (local, foreign, BUMN), lots, value and average price, plus total value and foreign net (for one investor side, what it bought and sold). IPOT publishes the top 10 per side; once idx stockbit login has stored a working session, auto (the default) lists every broker from Stockbit instead, and JSON says how many brokers each side had and whether its list is complete. Latest session with trades by default; -o csv gives one row per broker |
bandar detect <SYMBOLS> [--period 1d|1w|1m|3m] [--top 1|3|5|10] [--daily] [--source auto|ipot|stockbit] |
Bandarmology: are the top brokers accumulating or distributing? The top 1/3/5/10 buyers against as many sellers (bandar value and volume), net as a share of the value traded, the phase against the price move, the top buyers' average against the price, foreign flow; --daily adds the bandar movement session by session. Reads Stockbit once idx stockbit login has stored a working session (auto, the default), IPOT otherwise. See Bandarmology |
bandar screen [--preset P] [-f FILTER] [--period P] [--scan N] [--source auto|ipot|stockbit] |
Bandarmology screener over the 100 most traded stocks by value: presets big-accumulation, accumulation, distribution, big-distribution, quiet-accumulation, quiet-distribution, foreign-accumulation, below-bandar, or filters on acc, net, fnet, fpct, gain, chg, turnover, conc, signal, phase |
bandar broker <CODE> [--period P] [--scan N | --symbols S] [--source auto|ipot|stockbit] |
Broker activity: where one broker (e.g. YP) sits among the buyers or sellers of the 100 most traded stocks, with rank, lots, value, average, share of the stock's value and net. From Stockbit every broker shows; from IPOT only its top 10 per side, with net where both sides are visible |
market overview [--top 10] |
IHSG, breadth, turnover, gainers, losers, most traded, heavyweights from one pass over the universe |
market foreign [--date D] [--top 10] [--sort value|shares] [--source idx|ipot] |
Top foreign net buying and net selling across every stock for one session (idx.co.id, in shares), with the market's foreign totals; --source ipot ranks the 100 most traded stocks (not every stock) by each one's foreign net in rupiah from IPOT's broker summaries, for the latest session IPOT has published, with the market's value traded and foreign buying, selling and net from IPOT's market statistics (its own shape, idx.market.foreign.value.v1) |
market brokers [--date D] [--top 20] [--sort value|volume|frequency] [--source auto|idx|ipot] |
Every exchange member's trading for one session, ranked, with each member's share of all members' value: from idx.co.id, or from IPOT when idx.co.id refuses, cannot be reached, fails or has not published the session yet and IPOT holds that session (auto, the default), or with --source ipot (its latest session), which adds each member's class and net to the table, and its value bought and sold to -o json, csv and jsonl |
market indices [CODE...] [--date D] |
Every IDX index (IHSG, LQ45, IDX30, sector and thematic) for one session: close, change, range, constituents, value, market cap |
market calendar [--from D --to D | --date D] [--symbol S] [--type T] |
The exchange calendar: dividend and rights dates (cum, ex, recording, payment), RUPS, public exposes, listings; bonds and buyback reports with --type all. Default: the next 14 days |
market holidays [--year Y | --all] [--upcoming] |
Trading holidays (Kalender Libur Bursa, bundled), the year's trading days, whether today is a trading day and the next one |
market astro [--date D] [--days N] [--natal launch|base|none] [--backtest [--period P]] |
Traditional astrology for IHSG, computed offline: the Sun, Moon and planets (sign, degree, speed, retrograde) at 16:00 WIB, Moon phase, Mercury retrograde, Javanese weton, Chinese shio, phases, stations and ingresses ahead, aspects to IHSG's chart; --backtest tests them on IHSG's daily returns. See Astrology |
market members [--search S] |
Exchange members (broker codes) with names and licences |
ownership changes --from D --to D [--symbol S] [--min-change PP] [--limit N --offset N] |
New holders, exits and position changes between two months, paged, with a summary (counts, foreign vs local net, by investor type, issuer flow, top moves) over every match |
ownership foreign [SYMBOL] [--from D --to D] |
Disclosed foreign (KSEI A) vs local stake: one issuer month by month, or every issuer's change between two months |
ownership composition <SYMBOL> [--as-of D] |
KSEI's monthly "Kepemilikan Efek" archive: local vs foreign shares in nine investor types, as a percent of the scripless shares, with the scripless share of listed shares and the trend over imported months. Downloads the newest month on first use |
ownership institutions <SYMBOL> |
Institutional and fund holders from MSN Money (live, no import): shares, % of shares outstanding, the change since each holder's last report and a new/buyer/seller/exited/unchanged signal, with institutional, fund and free-float percentages and counts per list. See docs/ownership.md |
stockbit login [--page [--port N]] | status | logout |
Opt-in: store your own Stockbit session, signed in in a browser idx opens or, over SSH and for Google sign-in, through a page on 127.0.0.1 for your own browser (idx never sees the password; every session is checked before it is stored); check when its tokens expire; delete it. See docs/stockbit.md |
stockbit orderbook <SYMBOL> |
The live depth ladder and session foreign flow (your Stockbit session) |
stockbit actions <SYMBOL> [--kind K] [--from D --to D] · stockbit calendar [--from D --to D | --days N] [--kind K] |
Corporate actions from your Stockbit session, one structured row each: a stock's whole history (dividends since 2009 for BBCA, splits, bonus, rights, warrants, RUPS, public exposes, tender offers), or the market's calendar with rights, tender and IPO offers still open |
stockbit movements [SYMBOL] [--from D --to D] [--holder ID] [--action A] [--source idx|ksei] [--pages N] |
Insider and 5 % holder movements from your Stockbit session: IDX insider disclosures (with the trade price) and KSEI's 5 % holder changes (Stockbit's estimated price kept apart), shares exact and signed |
watch [add|rm|list|clear|returns] |
Plain-text watchlist next to the config; idx watch quotes it |
ownership releases|discover [--family F --limit N]|path |
Imported months, files published on idx.co.id and ksei.co.id (families above1, above5, investor-type, classification, composition, all, each marked importable), database path |
mcp [--http ADDR --token T] · mcp setup <client> |
MCP server over stdio or streamable HTTP, and the registration recipe for 25 agent harnesses. 48 tools: idx_brief, idx_market, idx_quote, idx_history, idx_intraday, idx_profile, idx_financials, idx_earnings, idx_dividends, idx_returns, idx_rotation, idx_fundamental, idx_technical, idx_compare, idx_screen, idx_news, idx_sentiment, idx_insights, idx_corporate_actions, idx_foreign, idx_instruments, idx_market_foreign, idx_market_brokers, idx_indices, idx_calendar, idx_holidays, idx_astro, idx_members, idx_broker, idx_bandar, idx_bandar_screen, idx_bandar_broker, idx_ownership_ticker, idx_ownership_entity, idx_ownership_changes, idx_ownership_foreign, idx_ownership_releases, idx_ownership_search, idx_ownership_rankings, idx_ownership_graph, idx_ownership_composition, idx_ownership_snapshot, idx_ownership_institutions, idx_orderbook, idx_stockbit_status, idx_stockbit_login, idx_stockbit_actions, idx_stockbit_movements |
schema [name] |
JSON Schema for every payload (quotes, history, intraday, profile, fundamentals, growth, valuation, risk, compare, financials, earnings, dividends, returns, rotation, market, brief, technical, screen, news, sentiment, insights, actions, foreign, foreign-value, instruments, market-foreign, market-brokers, indices, calendar, holidays, astro, members, broker, bandar, bandar-screen, bandar-broker, ownership-*, stockbit-*, watchlist, error, ...) |
config init|set|get|path |
Config file management |
cache stats|clear|path |
Response cache management |
completions <shell> |
bash, zsh, fish, powershell, elvish |
version |
Version, build and default paths |
Global flags work anywhere on the line:
| flag | env | meaning |
|---|---|---|
-o, --output table|json|jsonl|csv|auto |
IDX_OUTPUT |
Output format: tables for people, the JSON envelope for programs, one JSON record per line (jsonl), CSV rows of the payload's main list for spreadsheets; auto is a table on a terminal and the JSON envelope when piped (opt-in: the default stays table) |
--provider auto|yahoo|msn|stockbit |
IDX_PROVIDER |
Data source (auto tries Yahoo, then MSN, and merges fundamentals; stockbit is opt-in realtime from your own session, see docs/stockbit.md) |
--history-provider auto|yahoo|stockbit |
IDX_HISTORY_PROVIDER |
Where candles come from; auto follows --provider (Yahoo for msn; under stockbit, Stockbit where its bars match the request and Yahoo otherwise or when Stockbit fails). See docs/configuration.md |
--offline |
IDX_OFFLINE=1 |
Never touch the network |
--no-cache |
IDX_NO_CACHE=1 |
Ignore cached responses |
--timeout SECS |
IDX_TIMEOUT_SECS |
Per-request timeout (default 15) |
--no-color |
NO_COLOR |
Plain tables |
-v, -vv, -vvv |
IDX_LOG |
Diagnostics on stderr, including every URL requested |
-q, --quiet |
IDX_QUIET=1 |
stderr carries errors only: no warnings, notes or loading line. stdout is unchanged and -o json keeps warnings in the envelope |
IDX_EXCHANGE=SI |
Yahoo Finance suffix a bare ticker gets in stocks quote, history, profile, financials, earnings, dividends, returns, rotation, fundamental, technical, compare and watch (default JK, IDX). An explicit suffix (D05.SI) always works there; every other command reads IDX tickers only |
|
IDX_PROGRESS=never|always |
The loading line on stderr (⠹ 6s · waiting on investasi.kontan.co.id 6s) shows on a terminal only; never hides it, always forces it |
For scripts and agents
idx -o json stocks history TLKM --period 1y --interval 1wk \
| jq '.data.summary.change_pct'
idx -o jsonl market holidays --year 2026 | jq -r .date # one record per line
idx -o jsonl stocks screen -f 'pe<10,roe>15' -n 5 | idx stocks compare -
echo BBCA BBRI | idx stocks quote - # tickers from stdin
idx -q -o csv stocks quote BBCA BBRI > quotes.csv # stderr: errors only
- stdout carries exactly one JSON document (
-o json) or one JSON record per line (-o jsonl); everything else goes to stderr. Errors are one JSON line on stderr in both modes. -o auto(orIDX_OUTPUT=auto) prints a table on a terminal and the JSON envelope when stdout is piped or captured.-in a ticker list (stocks quote|returns|rotation|compare,broker,bandar,watch add|rm) reads tickers from stdin: plain text (spaces, commas or lines,#comments) or idx's own-o json/-o jsonloutput.- The envelope records
provider,fetched_at,cached,stale,stale_reason(offlineorfetch_failed, only when stale) andwarnings. - Fields the source did not return are
null. Nothing is estimated. - Quotes carry
behind_session:truewhen the last trade is dated before the latest IDX session that has ended (a suspended stock, one that did not trade, or a source that lags the close), using the bundled holiday calendar. - Exit codes:
0ok ·2usage ·3network/provider (JSON codeblockedwhen the source's bot protection, Cloudflare, refused the request) ·4not found ·5offline cache miss ·6config.
Full field reference: docs/json-output.md. Configuration and cache: docs/configuration.md. Calling idx from an agent (rules, exit codes, recipes, an agent-led install): docs/agent-guide.md.
MCP server
idx mcp serves the Model Context Protocol over stdio, which is what every
local agent launches. idx mcp --http serves the same tools over streamable
HTTP for products that only connect to a URL. idx mcp setup <client> prints
the exact command or config snippet for your agent with the absolute path of
the binary filled in, because GUI apps rarely inherit your shell PATH:
idx mcp setup --list # every supported client
idx mcp setup codex # prints: codex mcp add idx -- /abs/path/idx mcp
idx mcp setup muse # prints the settings.json block Meta's Muse Code expects
| agent | register idx |
|---|---|
| Claude Code | claude mcp add --scope user idx -- idx mcp |
| Claude Desktop | claude_desktop_config.json → "mcpServers": {"idx": {"command": "idx", "args": ["mcp"]}} |
| OpenAI Codex (CLI, IDE extension, app) | codex mcp add idx -- idx mcp, or [mcp_servers.idx] with command/args in ~/.codex/config.toml |
| Meta Muse Code | ~/.config/muse/settings.json: {"schema_version": 1, "mcp_servers": {"idx": {"transport": "stdio", "command": "idx", "args": ["mcp"], "mode": "optional"}}} |
| Google Antigravity (IDE, CLI) | ~/.gemini/config/mcp_config.json → mcpServers.idx with an absolute command and no type field |
| Gemini CLI | gemini mcp add -s user idx idx mcp |
| GitHub Copilot CLI | copilot mcp add idx -- idx mcp |
| VS Code (Copilot agent mode) | code --add-mcp '{"name":"idx","command":"idx","args":["mcp"]}', or .vscode/mcp.json → servers.idx with "type": "stdio" |
| Cursor · Windsurf · JetBrains · Warp · Trae · Augment | paste {"mcpServers": {"idx": {"command": "idx", "args": ["mcp"]}}} into the MCP settings (file paths in idx mcp setup) |
| Kiro (IDE and CLI, formerly Amazon Q Developer CLI) | ~/.kiro/settings/mcp.json, or kiro-cli mcp add --name idx --command idx --args mcp |
| Zed | settings.json → "context_servers": {"idx": {"command": "idx", "args": ["mcp"], "env": {}}} |
| Cline · Roo Code · Kilo Code | MCP Servers → Configure → mcpServers.idx with "type": "stdio" |
| Continue | ~/.continue/mcpServers/idx.yaml (idx mcp setup continue prints it) |
| OpenCode | opencode.json → "mcp": {"idx": {"type": "local", "command": ["idx", "mcp"], "enabled": true}} |
| Goose | goose configure → Add Extension → Command-line Extension → idx mcp |
| Factory Droid | droid mcp add idx "idx mcp" |
| Mistral Vibe | ~/.vibe/config.toml → [[mcp_servers]] with name = "idx", transport = "stdio", command, args |
| Qwen Code | qwen mcp add idx idx mcp |
| Crush | crush.json → "mcp": {"idx": {"type": "stdio", "command": "idx", "args": ["mcp"]}} |
| ChatGPT · Claude.ai · Perplexity · Devin · Manus | remote only: idx mcp --http 127.0.0.1:8765 --token T --allowed-host '*' behind an HTTPS tunnel, then add https://<host>/mcp as a connector with header Authorization: Bearer T |
A bare idx in the table assumes the binary is on PATH; idx mcp setup
substitutes the absolute path, and --npx swaps in npx -y ihsg-mcp: the
npm package ihsg-mcp runs idx mcp without installing
idx, fetching the release binary on first start and checking it against the
release's SHA256SUMS (cmd /c npx -y ihsg-mcp on Windows; from this
repository npx -y github:fzn0x/idx mcp still works). Each entry's remote
(HTTP) form and the config file locations are in docs/mcp.md.
claude mcp add --scope user idx -- npx -y ihsg-mcp # no idx install needed (Node 18+)
npx -y ihsg-mcp setup cursor # any client's recipe, in the npx form
The server lists 48 tools with typed input schemas kept to the subset every
harness accepts (no nullable type arrays, no format or default keywords)
and one-paragraph descriptions. idx_brief is the one-call starting point;
idx_fundamental takes an optional lens (growth, valuation or risk)
for the focused readings of stocks growth|valuation|risk;
each tool returns the same envelope as -o json, so an agent that learned the
CLI already knows the tools. Failures come back as tool errors carrying
{error: {code, message}, exit_code}.
Relative rotation
idx stocks rotation (alias rrg, MCP idx_rotation) places each ticker on
a relative rotation graph against a benchmark, IHSG (^JKSE) by default:
idx stocks rotation BBCA BBRI BMRI TLKM ASII
idx stocks rotation BBCA TLKM --benchmark ^JKLQ45 --tail 5
idx stocks rotation BBCA TLKM --interval 1d --window 20
idx -o json stocks rotation BBCA GOTO | jq '.data.rows[] | {symbol, quadrant}'
idx stocks rotation - < watchlist.txt
The x axis is RS-Ratio (is the stock beating the benchmark?), the y axis RS-Momentum (is that getting stronger?), both centred on 100. The quadrants: leading (both at or above 100), weakening (ratio above, momentum below), lagging (both below), improving (ratio below, momentum above). Stocks usually rotate clockwise through them. Each row carries its latest point, the change over the tail, and the tail itself (the recent path, oldest first); the table adds the four quadrants laid out as the graph draws them.
idx computes it from five years of daily closes (the history stocks returns reads, so the two share the cache), on the dates the stock and the
benchmark both have:
- RS = 100 x close / benchmark close
- RS-Ratio = 100 + (RS - mean) / standard deviation over the last
--windowbars - RS-Momentum = 100 + the same z-score of RS-Ratio's rate of change
The original JdK RS-Ratio and RS-Momentum (RRG Research, shown by StockCharts
and Optuma) are proprietary, so this is an open approximation and says so
(method.approximation, method.formula in the JSON): its values will not
match those charts. The axes are in standard deviations, not percent. Weekly
bars (--interval 1wk, the default) are each week's last session, and the
current week counts with its latest one. Defaults: window 14, tail 10. A
first point needs 2 x window bars and a full tail 2 x window + tail - 1 (37
weeks by default); a shorter history (a new listing) leaves the row's values
null with a warning, never a fill. Yahoo has no history for the IDX sector
indices, so a sector graph is not possible yet; index codes that do have one
(^JKLQ45, ^JKII) work as symbols or as the benchmark. The web terminal
does not draw the graph yet: it runs in the CLI and the MCP server. Not
investment advice.