tw-stock-mcp
An MCP server for Taiwan stock market data (TWSE and TPEx) that lets AI agents search securities and retrieve read-only quotes, history, fundamentals, ownership, trading flows, events, indices, market summaries, movers, and screens.
Search securities by code or Traditional Chinese name, with market and type filters.
Get a one-call stock overview: quote, 1-month summary, fundamentals, profile, institutional and margin data, foreign ownership, and events.
Compare 2–10 stocks side by side with returns, valuation, revenue, margins, ownership, and high/low/median summaries.
Fetch near-realtime quotes for up to 50 stocks/ETFs, including OHLC, bid/ask, ETF NAV/premium, and ETN indicative value.
Retrieve price history bars (day/week/month/year) with summaries, moving averages, RSI, MACD, KD, and Bollinger Bands.
Get fundamentals: P/E, dividend yield, P/B, monthly revenue, income statement, optional balance sheet, dividends, and company profile.
Inspect ownership: TDCC shareholder tiers and foreign ownership/limits.
Analyze institutional trading (三大法人), margin/short/SBL balances, day trading, and market-wide rankings.
Get market events: holidays, ex-dividend/rights, disposition, attention notices, and halts.
Access realtime and historical TAIEX/TPEx indices, market overview, top movers, and a multi-filter stock screener.
Use ready-made prompts/resources for stock briefs, market briefs, comparisons, holidays, and the security directory.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tw-stock-mcp show me the latest quote and fundamentals for 台積電 (2330)"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
tw-stock-mcp
An MCP server for Taiwan stock market data (TWSE 上市 / TPEx 上櫃), built for AI agents.
Zero runtime dependencies. The MCP protocol layer is hand-written; nothing but this package is installed on your machine.
Agent-friendly. JSON output with schemas, loose symbol input (
2330,2330.TW,台積電), automatic market detection, and errors that tell the agent what to do next.Read-only. Every tool only reads public exchange data.
Companion to tw-stock-cli.
Install
Requires Node.js 22 or later. Pin a version so an upstream change can never reach you silently.
Claude Code
claude mcp add tw-stock -- npx -y npm:tw-stock-mcp@0.3.1Codex CLI
codex mcp add tw-stock -- npx -y npm:tw-stock-mcp@0.3.1VS Code
code --add-mcp '{"name":"tw-stock","command":"npx","args":["-y","npm:tw-stock-mcp@0.3.1"]}'Claude Desktop, Cursor and other clients — add to the client's MCP config (claude_desktop_config.json, ~/.cursor/mcp.json, …):
{
"mcpServers": {
"tw-stock": {
"command": "npx",
"args": ["-y", "npm:tw-stock-mcp@0.3.1"]
}
}
}Troubleshooting: npx hangs
If the first start never finishes, npm probably cannot reach registry.npmjs.org. Some ISP DNS resolvers (for example HiNet's defaults) return a wrong address for it, so connections time out instead of failing. On macOS, dscacheutil -q host -a name registry.npmjs.org should show 104.16.x.x. If it does not, switch your network's DNS to a public resolver such as 1.1.1.1 or 8.8.8.8.
Related MCP server: Taiwan Stock Real-Time Analysis MCP Server
Tools
One stock
Tool | What it does |
| Everything in one call: quote, 1-month price summary, fundamentals, company profile (industry, listing date, capital), latest institutional and margin trading, foreign ownership against its ceiling, upcoming events. |
| 2–10 stocks side by side: close, 1M/3M/1Y price return, P/E, P/B, yield, revenue YoY, margins and foreign ownership, with the highest, lowest and median per metric. Costs the same however many stocks you compare. |
| Find securities by code or name fragment. Excludes warrants and convertible bonds unless asked. |
| Near-realtime quotes for up to 50 stocks/ETFs: price, change, OHLC, limits, volume, 5-level bid/ask, status. ETFs add estimated NAV, premium/discount and previous NAV; ETNs add the issuer's estimated indicative value (指標價值) and premium. |
| Daily/weekly bars for up to a year, monthly/yearly bars for up to 10 years (from exchange statistics), with a summary, and moving averages and RSI, MACD, KD and Bollinger Bands on windows up to a year. |
| P/E, dividend yield, P/B; latest monthly revenue with MoM/YoY; latest income statement with EPS and margins. Optional ( |
| Shareholder distribution by holding tier (集保股權分散, latest week) with large and small holder shares; foreign ownership against its ceiling (外資持股). |
| 三大法人 net buy/sell per stock, or the market summary with top net buyers and sellers. With |
| 融資融券 per stock: margin and short buys, sells, balances, limits, 券資比 and 融資使用率; or the market totals (融資金額) with the largest balance changes. Optional ( |
| 當沖 per stock: day-traded shares, buy/sell amounts and share of volume; or each exchange's totals with the most day-traded stocks. |
| Ex-dividend dates, disposition stocks (處置), attention notices (注意), trading halts, market holidays. |
Whole market
Tool | What it does |
| Realtime TAIEX, TPEx index and FRMSA, with an optional intraday series. |
| Daily TAIEX or TPEx index bars for up to a year, with the same summary, moving averages and indicators as |
| End-of-day brief: key and sector indices, breadth, turnover, institutional net flows. |
| Top gainers, losers, volume or turnover across both exchanges. |
| Filter every stock by price, change, volume, turnover, P/E, yield, P/B, revenue growth, industry, and the day's 三大法人 net buying (foreign, trust, dealer, total) or 融資/融券 balance change. |
Conventions:
Prices and amounts in TWD (the exchanges' thousands-of-TWD figures are converted); dates and times in Asia/Taipei.
get_quotereports volume in lots (1 lot = 1,000 shares); every end-of-day tool reports shares. TPEx lots are converted so both exchanges match.End-of-day tools default to the latest trading day with published data and say which date they used.
Unresolvable inputs come back in
unresolvedwith suggestions instead of failing the whole call.Slow multi-request calls (long history windows, multi-day institutional totals and streaks) send progress notifications when the client asks for them.
Prompts and resources
Prompts
stock_brief,market_close_briefandcompare_stocksare ready-made workflows; clients show them as slash commands.Resources
tw-stock://calendar/holidays(market holidays) andtw-stock://securities(security directory, also/tseand/otc) are read-only JSON to attach as context.
Options
HTTP mode. tw-stock-mcp --http [port] serves Streamable HTTP at http://127.0.0.1:8886/mcp; stdio stays the default. --host changes the address, and a non-loopback address requires TW_STOCK_MCP_TOKEN, which clients send as Authorization: Bearer <token>. Browser origins other than localhost are rejected unless allowed with --allow-origin.
npx -y npm:tw-stock-mcp@0.3.1 --http
claude mcp add --transport http tw-stock http://127.0.0.1:8886/mcpDisk cache. Set TW_STOCK_MCP_CACHE_DIR to keep past data that cannot change on disk across sessions: months of history that have ended, and institutional trading and daily quotes for days before today in Taipei. Margin, securities lending and day trading reports can be restated after the day, so they are kept only once they are 14 days old. Today's data, errors and empty answers are never cached. TW_STOCK_MCP_CACHE_MAX_MB caps its size (default 512); the least recently used files go first. Delete the directory to clear it.
Data sources
Realtime quotes and indices: TWSE MIS (
mis.twse.com.tw)End-of-day prices, history, index history, multi-year statistics, institutional, margin, day trading and securities lending, foreign ownership, ex-dividend history:
www.twse.com.tw,www.tpex.org.twETF estimated NAV and ETN indicative value: the TWSE MIS ETF and ETN disclosure feeds (TWSE and TPEx)
Fundamentals (including balance sheets, dividend resolutions and company profiles) and events: TWSE / TPEx OpenAPI (
openapi.twse.com.tw,www.tpex.org.tw/openapi)Security directory and shareholder distribution: TDCC open data (
openapi.tdcc.com.tw)
Responses are cached in memory (5 minutes to 6 hours depending on how often the source changes). Requests to each exchange host are queued (at most 2 at a time, 200 ms apart), and multi-month history is fetched one page at a time to avoid bursts against the exchanges.
For information only; not investment advice.
Development
Uses Node.js from .nvmrc (nvm use) and pnpm 12. pnpm switches to the exact version pinned with a sha512 hash in packageManager.
pnpm install
pnpm test
pnpm build
node build/index.js --helpTry a local build in Claude Code:
claude mcp add tw-stock-dev -- node "$PWD/build/index.js"Contract tests
pnpm test:live calls every exchange endpoint once and checks the fields the parsers read (files in tests/live/). The scheduled Contract workflow runs it on weekdays after the close; pnpm test stays offline. After a format change, node scripts/refresh-fixtures.mjs <name> --grep 2330 prints a trimmed live sample for updating fixtures (--list shows the names).
Supply-chain policy
No runtime dependencies. Dev tools are pinned to exact versions with a committed
pnpm-lock.yaml.pnpm-workspace.yamlblocks dependency install scripts, refuses versions younger than 7 days, fails on trust downgrades (trustPolicy: no-downgrade) and blocks git/tarball transitive dependencies.GitHub Actions are pinned to commit SHAs, and workflows get read-only permissions by default.
Releases are published from CI with npm trusted publishing and provenance, so no npm token is stored anywhere.
The published package contains only
build/(seefilesinpackage.json).
Releasing
Bump
versioninpackage.jsonand commit.Tag and push:
git tag v0.1.1 && git push origin v0.1.1.The
Releaseworkflow checks the tag matchespackage.json, tests, and publishes to npm with provenance.
The workflow uses npm trusted publishing, configured on npmjs.com under the package's Settings → Trusted Publisher (GitHub Actions, workflow release.yml, with npm publish allowed). The very first version has to be published manually (pnpm publish --access public), because the trusted publisher is configured on an existing package.
License
MIT
Available Tools
16 toolscompare_stocksCompare Taiwan stocks side by sideARead-onlyIdempotent
Compare 2-10 Taiwan stocks side by side in one call, mixing TWSE (上市) and TPEx (上櫃) freely: latest close, 1M / 3M / 1Y price return, P/E, P/B, dividend yield, latest monthly revenue YoY, gross / operating / net margin from the latest quarterly report, and foreign ownership %. Use this instead of calling get_stock_overview or get_fundamentals once per stock: it reads full-market snapshots, so its cost does not grow with the number of stocks, and summary already gives the highest, lowest and median of every metric, so no arithmetic is needed. Returns are price returns between end-of-day closes, not adjusted for dividends, stock dividends or splits. Each starts at the last trading day on or before the same date 1, 3 or 12 months before the latest close; as_of gives the dates every source covers, per market. Margins are year to date through margins_period, as Taiwan income statements are cumulative. Prices are TWD. Accepts codes ("2330", "6488.TWO") or exact names ("台積電"). Inputs that cannot be resolved are listed in unresolved with suggestions. A missing value is null with the reason in notes; a source that failed is named in warnings and the rest is still returned. End-of-day data only: use get_quote for intraday prices, get_stock_overview for one stock in depth.
Inputs: symbols (required), market. Returns: as_of, notes, stocks, summary, +2 more
get_day_tradingGet day trading (當沖)ARead-onlyIdempotent
Day trading (現股當沖) for TWSE and TPEx stocks and ETFs on one trading day: shares day-traded, day-trade buy and sell amounts, and day trading's share of the stock's total volume (當沖比例). With symbols: per-stock figures. Without symbols: each exchange's totals with their published share of market volume and turnover, plus the most day-traded stocks and ETFs ranked by rank_by. Share counts are in shares and amounts in TWD. volume_percent = volume / total_volume x 100, where total_volume is each exchange's end-of-day total (odd-lot trades included), the same figure get_market_movers and screen_stocks report. Ranking by "percent" only considers stocks that traded at least 1,000,000 shares. sell_first_suspended marks stocks where sell-first day trading is suspended (e.g. the 5 trading days before a book closure). Securities not eligible for day trading (e.g. 全額交割 stocks) are listed in unresolved. Brokers can correct a day's figures until two trading days later (T+2), when the exchanges publish the final numbers. Without date, uses the most recent trading day with published data; the exchanges publish it in the evening, Taipei time. One day per call: for a trend, call once per date.
Inputs: date, limit, market, rank_by, +1 more. Returns: date, unit, notes, stocks, +4 more
get_fundamentalsGet company fundamentalsARead-onlyIdempotent
Latest fundamentals for Taiwan-listed companies (TWSE and TPEx): valuation (P/E, dividend yield, P/B), the latest monthly revenue with MoM/YoY growth, and the latest quarterly income statement with EPS and margins. All amounts are TWD (converted from the exchanges' thousands). The income statement is year-to-date (cumulative from January through the reported quarter), as filed in Taiwan. P/E uses the latest four quarters of EPS, which can lag the income statement (see earnings_period); dividend yield uses the latest annual dividend (see dividend_year and dividend_per_share). Yields above 20% are flagged in warnings because they usually reflect a one-off distribution. Optional sections via include: "balance_sheet" (latest quarter's assets, liabilities, equity, debt ratio, current ratio, ROE and ROA, both year-to-date and annualised), "dividends" (recent dividend resolutions with cash and stock per share, and ex-dividend days since January of last year) and "profile" (company profile: industry, listing and founding dates, paid-in capital in TWD, chairman, general manager, website, full and English names; no business description is published). They are left out unless asked for. Only the latest month of revenue is published; there is no revenue history. ETFs and some securities have no fundamentals; such inputs are listed in unresolved. Sources: TWSE / TPEx OpenAPI, refreshed daily (valuation, profile) to monthly/quarterly (revenue, financials); ex-dividend days from the TWSE / TPEx websites.
Inputs: symbols (required), market, include. Returns: warnings, companies, unresolved
get_historyGet price historyARead-onlyIdempotent
OHLCV history for one Taiwan stock or ETF (TWSE or TPEx), with a summary, optional moving averages and optional technical indicators (RSI, MACD, KD, Bollinger Bands). Choose a window with range (1m, 3m, 6m, 1y, 3y, 5y, 10y back from today) or start/end dates. Day and week bars cover at most 366 days; month and year bars cover up to 10 years back from today. Bars default to daily for windows up to about 3 months, weekly up to a year and monthly beyond; pass interval to override. Up to 366 days, bars aggregate daily data, and moving averages and indicators are computed on daily data (week/month/year bars carry the value at their end_date). Over 366 days (basis "monthly_statistics" or "yearly_statistics"), bars come from the exchanges' monthly or yearly statistics at about one request per year: whole calendar periods with high, low, average_price, volume, turnover and trades but no open; month bars have no close, year bars carry each year's last close. Moving averages and indicators are not available there. summary gives the change from reference_close (the close of the last trading day before the window, as "how did it do this month" means), high/low with dates and volume totals. Units are normalised across both exchanges: prices in TWD, volume in shares, turnover in TWD. Dates are Asia/Taipei. Data is end-of-day and updates after the close (about 14:30 Taipei); use get_quote for intraday prices.
Inputs: symbol (required), end, range, start, +4 more. Returns: end, bars, code, name, +6 more
get_index_historyGet market index historyARead-onlyIdempotent
Daily OHLC history of a Taiwan headline index: TAIEX (發行量加權股價指數, TWSE) or TPEX (櫃買指數, TPEx), with the same summary, moving averages and technical indicators (RSI, MACD, KD, Bollinger Bands) as get_history. Choose a window with range (1m, 3m, 6m, 1y back from today) or start/end dates (max 366 days; one request per month, so split longer periods into several calls). Bars default to daily for windows up to about 3 months and weekly beyond that; pass interval for week, month or year bars aggregated from daily data. Values are index points. The index pages publish no volume or turnover; use get_market_overview for a day's market turnover. Data is end-of-day and updates after the close (about 14:30 Taipei); use get_market_index for live values and FRMSA.
Inputs: end, index, range, start, +3 more. Returns: end, bars, name, index, +5 more
get_institutional_tradingGet institutional investor trading (三大法人)ARead-onlyIdempotent
Net buying/selling by Taiwan's three institutional investor groups (三大法人): foreign investors (外資), investment trusts (投信) and dealers (自營商), for TWSE and TPEx. Covers one trading day by default. For a period, set start (e.g. the 1st of the month for "this month", the Monday for "this week") or days (number of trading days, e.g. 5 for "recently"), up to 23 trading days; figures then become totals over the period, with a daily breakdown per stock. With symbols: per-stock net shares for each group. Without symbols: the TWSE market-wide buy/sell totals in TWD plus the top net buyers and sellers (stocks and ETFs, both markets) ranked by rank_by. All per-stock figures are in shares (positive = net buy); total_net = foreign_net + trust_net + dealer_net. Rankings are by shares, so low-priced stocks rank higher than their TWD value suggests. With symbols and streak: true, each stock also gets streaks: for foreign, trust, dealer and total, the current run of consecutive trading days of net buying or net selling that ends on end_date (「外資連買 N 天」), with its net shares. Weekends and holidays do not break a streak; a day with zero net (no institutional trades) does. The lookback is 20 trading days, so a streak that reaches it has at_least true ("≥ 20 days"). It costs up to 19 more end-of-day requests per exchange, shared by all symbols and stopping as soon as every streak has ended. Without date, the period ends on the most recent trading day with published data; exchanges publish after the close, around 15:00-16:30 Taipei.
Inputs: date, days, limit, start, +4 more. Returns: date, unit, notes, stocks, +8 more
get_margin_tradingGet margin trading and short selling (融資融券)ARead-onlyIdempotent
Margin trading (融資) and short selling (融券) for TWSE and TPEx stocks and ETFs: buys, sells, redemptions, balances and limits for each side, 資券互抵 (offset), 券資比 (short/margin ratio) and 融資使用率 (margin utilisation). Covers one trading day by default. For a period, set start (e.g. the 1st of the month for "this month") or days (number of trading days, e.g. 5 for "recently"), up to 23 trading days; buys, sells, redemptions and offsets become totals, previous_balance is from the first day, balance and limit from the last, and each stock gets a daily series. With symbols: per-stock figures. Without symbols: market-wide totals per exchange, including 融資金額 (margin loan amount, TWD), plus the stocks and ETFs with the largest balance increases and decreases ranked by rank_by. Share counts are in shares (the exchanges' lots x 1000) and amounts in TWD. The latest day's balance is provisional: the exchanges finalise it as the next day's previous_balance. Rankings are by shares, so low-priced stocks rank higher than their TWD value suggests. Optional include: ["sbl"] adds 借券賣出 (short sales of borrowed shares, SBL) next to 融券 for each stock and market: sold, returned, adjustment, balance and the next day's SBL sell limit, plus total_short_balance (融券 + 借券賣出) so short interest is complete. rank_by "sbl" ranks by the 借券賣出 balance change and implies the include. It costs one more request per exchange per day. Without date, the period ends on the most recent trading day with published data; the exchanges publish in the evening, around 21:00 Taipei, later than prices and institutional trading.
Inputs: date, days, limit, start, +4 more. Returns: date, unit, notes, stocks, +8 more
get_market_eventsGet market and corporate eventsARead-onlyIdempotent
Upcoming and recent events on TWSE and TPEx: market holidays (休市), ex-dividend / ex-rights dates (除權息) with cash dividend per share, disposition stocks under restricted trading (處置股), attention notices for unusual trading (注意股), and trading halts (暫停交易). Filter by symbols, kinds and a date window; events whose period overlaps the window are included. Default window: 14 days ago to 45 days ahead; giving only start or end keeps the other default. Each exchange dataset covers only a limited period, reported in coverage per kind and market: attention notices are for the latest trading day only, dispositions are recent announcements, ex-dividend schedules run a few weeks ahead, and holidays cover only the calendar year TWSE currently publishes. No event outside a dataset's from/to range means no data, not that nothing happened.
Inputs: end, kinds, limit, start, +2 more. Returns: end, start, total, events, +4 more
get_market_indexGet realtime Taiwan market indicesARead-only
Near-realtime values of Taiwan's headline indices: TAIEX (發行量加權股價指數, TWSE), TPEX (櫃買指數) and FRMSA (寶島股價指數). Returns value, previous close, change, change percent and the day's open/high/low. Set intraday for a sampled minute-by-minute series of TAIEX and TPEX for the current or last session. Outside trading hours (09:00-13:30 Taipei) it returns the last session with status "previous_session". For daily TAIEX or TPEX history over a date range, use get_index_history.
Inputs: points, indices, intraday. Returns: indices, retrieved_at
get_market_moversGet top gainers, losers and most tradedARead-onlyIdempotent
End-of-day ranking of Taiwan stocks and ETFs across TWSE and TPEx: top gainers, losers, or most traded by volume (shares) or turnover (TWD). Defaults to common stocks and ETFs; illiquid names can dominate gainer/loser lists, so set min_turnover (TWD) such as 100000000 to focus on actively traded names. Without date, uses the most recent trading day with published data (published around 14:30-15:00 Taipei). For intraday prices use get_quote.
Inputs: date, limit, types, market, +2 more. Returns: date, notes, movers, sort_by, +1 more
get_market_overviewGet end-of-day TWSE market overviewARead-onlyIdempotent
One-call end-of-day brief of the Taiwan Stock Exchange (TWSE) for a trading day: TAIEX (加權指數) and key indices, sector indices (類指數) ranked by change, market breadth (advancers/decliners, limit up/down), turnover, and institutional investors' net buy/sell in TWD. Use get_market_index for intraday index values (including the TPEx index) and get_market_movers for the stocks behind the moves. Without date, uses the most recent trading day with published data.
Inputs: date, sectors. Returns: date, notes, breadth, sectors, +3 more
get_ownershipGet ownership structureARead-onlyIdempotent
Ownership structure of Taiwan-listed stocks and ETFs (TWSE and TPEx), up to 20 per call. shareholder_distribution is the TDCC 集保戶股權分散表: holders, shares and percent of TDCC custody shares in each of 15 holding tiers (1-999 shares up to over 1,000,000 shares), plus over_1000_lots (千張大戶), over_400_lots (400張大戶) and up_to_50_lots (50 lots or fewer, usually read as retail); 1 lot = 1,000 shares. TDCC publishes only the latest weekly snapshot (see coverage), so week-over-week changes are not available here. foreign_ownership (外資及陸資持股) is the latest trading day's shares held by foreign and mainland investors, as a percent of issued shares, with the legal ceiling and the room left under it. TPEx publishes it for stocks only, not ETFs. For daily foreign buying and selling use get_institutional_trading. All quantities are shares. If one source is unavailable the other part is still returned and warnings says why. Sources: TDCC open data (weekly), TWSE / TPEx foreign ownership reports (daily).
Inputs: symbols (required), market. Returns: stocks, coverage, warnings, unresolved
get_quoteGet realtime Taiwan stock quotesARead-only
Near-realtime quotes for Taiwan stocks and ETFs from TWSE MIS, covering both TWSE (上市) and TPEx (上櫃). Accepts codes ("2330", "2330.TW", "6488.TWO") or exact Traditional Chinese names ("台積電"); the market is detected automatically. Prices are TWD. volume is the day's accumulated volume in lots (1 lot = 1,000 shares), or shares when odd_lot is true, for the regular session only: end-of-day tools such as get_history report the exchange's daily total, which also includes odd-lot, after-hours fixed-price and other trades, so it is usually a few percent higher. price is null when there has been no trade yet; check status and the best bid/ask instead. Inputs that cannot be resolved are listed in unresolved with suggestions rather than failing the whole call. Outside trading hours (09:00-13:30 Asia/Taipei, weekdays) the last session's values are returned with status "previous_session". ETF quotes (TWSE and TPEx) also carry nav: the issuer's estimated NAV (預估淨值), premium_percent of price against it (positive = premium, negative = discount) and the previous business day's NAV. The estimate comes from the TWSE MIS ETF disclosure feed, which issuers update during the session on their own schedule (the exchange's page refreshes every 15 seconds) and leave at their last value after the close, so check nav.date and nav.time. For ETFs whose underlying trades outside Taiwan hours (underlying_zone not "domestic"), the estimate may not move during the Taiwan session. ETN quotes (codes 020xxx, e.g. 020020 or 02001L) carry indicative_value instead: the issuer's estimated indicative value (預估指標價值), premium_percent of price against it and the previous business day's value, from the TWSE MIS ETN disclosure feed, with the same timing caveats.
Inputs: symbols (required), market, odd_lot. Returns: quotes, warnings, unresolved, retrieved_at
get_stock_overviewGet a one-call stock overviewARead-only
Everything about one Taiwan stock in a single call: a short company profile (industry, listing date, paid-in capital), the latest quote, a rolling 1-month price summary, fundamentals (valuation, monthly revenue, latest income statement), the latest day of institutional trading (三大法人), the latest margin balances (融資 / 融券) with their day change, foreign ownership against its legal ceiling, and events from 14 days ago to 45 days ahead (ex-dividend, disposition, attention, halts; attention notices only exist for the latest trading day, see events_coverage). Each part states its own date: margin data is published around 21:00 Taipei, so during the trading day it is usually one trading day behind the quote. Use this first when asked about a specific stock; call the individual tools only for more detail (e.g. get_history for a longer window). Sections that fail to load are null and explained in warnings; the rest are still returned.
Inputs: symbol (required), market. Returns: code, name, quote, events, +9 more
screen_stocksScreen Taiwan stocksARead-onlyIdempotent
Filter all TWSE and TPEx stocks by end-of-day price, change, volume and turnover, and by valuation (P/E, dividend yield, P/B) and monthly revenue growth. Every filter is an optional min_/max_ bound, e.g. {"min_dividend_yield": 5, "max_pe_ratio": 15, "min_turnover": 100000000}. Rows missing a filtered metric are excluded. Defaults to common stocks only; results are sorted by sort_by (default turnover, descending). Price filters use the latest (or given) trading day; fundamental filters always use the latest published snapshot, so date cannot be combined with them. Flow metrics use the same trading day as prices, so they work with date: foreign_net, trust_net, dealer_net and institutional_net are 外資 / 投信 / 自營商 / 三大法人 net buys in shares (negative = net sell; a stock no institution traded counts as 0), and margin_change / short_change are the day's 融資 / 融券 balance changes in shares (stocks not eligible for margin trading have none). For example {"sort_by": "trust_net"} lists the stocks investment trusts bought most, {"sort_by": "foreign_net", "order": "asc"} those foreign investors sold most, {"min_foreign_net": 1, "min_trust_net": 1} those both bought, and {"sort_by": "margin_change"} those whose margin balance grew most. Flows are in shares, so low-priced stocks rank higher than their TWD value suggests. Without date, a flow metric moves the default day back to the latest one whose flows are published (institutional around 15:00-16:30, margin around 21:00 Taipei). industry keeps only the given exchange industries (exact Chinese names such as "半導體業", from the companies' current profiles).
Inputs: date, limit, order, types, +31 more. Returns: date, notes, filters, matched, +1 more
search_securitySearch Taiwan securitiesARead-onlyIdempotent
Find Taiwan-listed securities (TWSE 上市 = "tse", TPEx 上櫃 = "otc") by code or name. Use this to turn a company name such as "台積電" or a partial code such as "233" into a security code before calling other tools. Matches code or Traditional Chinese name; exact matches rank first, then prefix, then substring, with stocks before ETFs. By default searches stock, etf, preferred, etn, other; warrants and convertible bonds (95% of all listings) are excluded unless requested via types.
Inputs: query (required), limit, types, market. Returns: query, results, truncated, total_matches
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Tools mostly target clearly distinct datasets (quotes, history, fundamentals, institutional, margin, day trading, indices, events, ownership, screening). There is intentional overlap between get_stock_overview, compare_stocks, get_quote and get_fundamentals, but the descriptions explicitly guide when to use the aggregate versus the detail tools, keeping misselection low.
All 16 tools follow a consistent snake_case verb_noun pattern: get_*, compare_stocks, screen_stocks, search_security. No mixed conventions or vague names.
16 tools is slightly above the typical 3–15 well-scoped band, but each tool maps to a distinct data domain and no tool appears redundant. The count is reasonable for a comprehensive Taiwan stock data server.
The surface covers quotes, historical OHLCV, fundamentals, screening, market movers, institutional/margin/day trading, indices, events, ownership and security search. Minor gaps exist (e.g. dedicated dividend/corporate-action history or ETF composition), but most workflows are handled via overview, fundamentals and events.
Maintenance
Related MCP Connectors
Unofficial. TWSE & TAIFEX open data for AI: stock, ETF & futures snapshots, quotes, 270+ datasets.
Taiwan data for AI agents: THSR/TRA timetables, TWSE/TPEx stocks, invoice lottery, garbage, outages
Global prices, fundamentals and holdings data for stocks, ETFs and funds, built for AI agents.
Taiwan stock data in English: TWSE/TPEx quotes, institutional flows, filings, revenue, dividends.
Related MCP Servers
- AlicenseCqualityDmaintenanceProvides comprehensive Taiwan stock market data and analysis through MCP tools. Enables querying real-time stock prices, historical data, company information, technical analysis, and market overviews for TWSE and TPEx listed companies.816MIT
- -licenseNot gradedqualityNot gradedmaintenanceProvides real-time stock quotes, technical analysis, and intelligent trading recommendations specifically for the Taiwan stock market. Supports single and multiple stock queries, comparative analysis, and investment decision support through natural language interactions.-
- AlicenseBqualityDmaintenanceProvides real-time access to Taiwan Stock Exchange market data, financial reports, and trading analytics. It enables users to query stock prices, market indices, and corporate profitability metrics through natural language.227MIT
- FlicenseNot gradedqualityDmaintenanceProvides Taiwan stock market data through FinMind v4 API, including daily OHLCV, monthly revenue, institutional investors, margin trading, dividends, and financial statements. Enables MCP clients like ChatGPT or Codex to query Taiwan financial datasets via simple tools.-