by twjackysu
Provides real‑time stock quotes, financial statements, ESG data, and advanced market analysis for Taiwan securities markets via a Model Context Protocol server.
What is TW Stock MCP Server about?
A comprehensive Model Context Protocol (MCP) server that aggregates data from Taiwan Stock Exchange (TWSE), Taiwan OTC (TPEx), and Taiwan Futures Exchange (TAIFEX). It delivers live quotes, historical market data, corporate financials, ESG scores, and a suite of analytical tools for investors and developers.
How to use TW Stock MCP Server?
{
"twstockmcpserver": {
"transport": "streamable_http",
"url": "https://TW-Stock-MCP-Server.fastmcp.app/mcp"
}
}
docker run -i --rm --pull=always -e MCP_STDIO=1 ghcr.io/twjackysu/twsemcpserver:latest
git clone https://github.com/twjackysu/TWStockMCPServer.git
cd TWStockMCPServer
uv sync && uv run fastmcp dev server.py
Key features of TW Stock MCP Server
Use cases of TW Stock MCP Server
FAQ from the TW Stock MCP Server
Q: Do I need an API key?
A: The open‑source server runs without keys; hosted Prefect Horizon may enforce rate limits but does not require authentication.
Q: Can I query data beyond the latest trading day?
A: Yes. The server supplements official OpenAPI endpoints with web‑scraped historical data, allowing arbitrary past‑date queries for quotes, institutional flow, and financial statements.
Q: Which markets are covered?
A: All listed and OTC Taiwanese equities, ETFs, futures, and options, plus macro‑economic indicators.
Q: How is the server deployed in production?
A: Deploy the Docker image behind a reverse proxy, configure MCP_STDIO=1 for stdio transport, or run the Python script directly in a virtual environment.
Q: Is the data real‑time?
A: Real‑time quotes are sourced from the MIS service; most other endpoints deliver end‑of‑day or intraday snapshots updated at the official release schedule.
一個全面的模型上下文協議 (MCP) 伺服器,專為台灣證券交易所 (TWSE) 數據分析設計,提供即時股票資訊、財務報表、ESG 數據和趨勢分析功能。


觀看 TWStockMCPServer 功能展示
短中長期技術面、基本面、籌碼面綜合分析
"分析台積電(2330)最近的走勢" / "鴻海(2317)適合長期投資嗎?"
外資持股、產業流向、個股進出追蹤
"外資最近在買什麼股票?" / "半導體業外資投資趨勢如何?"
重大訊息、異常成交、權證活躍度監控
"今天有什麼重大消息?" / "哪些股票交易量異常活躍?"
高殖利率篩選、除權息行事曆、配息穩定性分析
"推薦一些高殖利率股票" / "下個月有哪些公司要除權息?"
價值股/成長股篩選、ESG風險評估
"幫我找一些被低估的價值股" / "ESG表現好的公司有哪些?"
Put/Call Ratio、大額交易人未沖銷部位、三大法人期貨/選擇權部位
"台指期籌碼現在偏多還是偏空?" / "選擇權大額交易人在哪個價位布局?"
上市/上櫃三大法人買賣超、外資產業配置
"三大法人今天買超哪些股票?" / "外資在哪個產業加碼?"
獲利能力、成長性、財務結構、配息政策、公司治理五面向分析
"幫我做台積電的財報體檢" / "這家公司的財務體質健不健康?"
處置股、注意股、當沖限制、停資停券名單比對
"這檔股票買進前有沒有被列處置或注意?"
openapi.taifex.com.tw 僅提供最新一個交易日,本專案改用期交所網站下載頁面
(www.taifex.com.tw):預設查最新交易日,也可回溯查詢期貨/選擇權每日行情、三大法人部位、大額交易人部位
"幫我拉台指期最近一個月的每日OHLC" / "外資期貨部位過去三個月怎麼變化?"
財報、月營收、股利改由公開資訊觀測站(MOPS)提供(上市、上櫃、興櫃、公發公司皆可):預設最新一期, 也可查任意過去季度的綜合損益表、資產負債表、現金流量表,多個月份的月營收,多年度股利分派,以及法說會行事曆; 另有重大訊息全文、董監持股與設質、內部人每月持股異動、庫藏股買回、背書保證與資金貸與
"比較台積電過去四季的毛利率和自由現金流" / "鴻海近五年配息穩定嗎?" / "這個月有哪些公司開法說會?" / "最近有哪些公司在買庫藏股?"
集保戶股權分散表(千張大戶、散戶持股比例,可看最近 13 週的逐週趨勢),上櫃個股日K、三大法人、融資融券可回溯任意過去日期; 上市當沖統計、除權息結果、類股指數歷史
"環球晶的大戶持股比例是多少?" / "半導體類指數上個月表現如何?"
所有投信、上市與上櫃(含債券 ETF、主動式 ETF):基本資料(經理公司、追蹤指數、配息頻率、經理人、上櫃 ETF 管理費)、每日已發行單位數增減與預估淨值/折溢價排行、每月規模/受益人數/申購買回/定期定額趨勢(2007 年起)
"0050 現在溢價多少?" / "哪些 ETF 今天被大量買回?" / "00981A 這半年受益人數怎麼變化?"
國發會景氣對策信號(景氣燈號)與領先/同時/落後指標、臺灣 PMI/NMI、中央銀行每日匯率
"現在景氣燈號是什麼顏色?" / "新台幣最近一個月升還是貶?"
本專案由 Prefect Horizon 提供支援,免費託管線上 remote MCP Server:
{
"twstockmcpserver": {
"transport": "streamable_http",
"url": "https://TW-Stock-MCP-Server.fastmcp.app/mcp"
}
}
⚠️ 使用限制:為維持服務永續,此線上服務設有合理使用量上限(非無限制)。若需商業使用或較高呼叫量,強烈建議改用下方 Docker/本機方式自行架設伺服器,或使用 Prefect Horizon 的付費方案。
🙏 感謝 Prefect Horizon 支援本開源專案,讓社群能免費輕鬆試用。
{
"twstockmcpserver": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--pull=always",
"-e",
"MCP_STDIO=1",
"ghcr.io/twjackysu/twsemcpserver:latest"
]
}
}
git clone https://github.com/twjackysu/TWStockMCPServer.git
cd TWStockMCPServer
uv sync && uv run fastmcp dev server.py
| 來源 | 說明 | Tools |
|---|---|---|
| TWSE OpenAPI | 台灣證交所官方 API — 公司治理、ESG、財務比率、公告名單、權證、券商等 | 105 個 |
| TWSE Web API | 證交所網頁 API(皆預設最新交易日,可查任意過去日期)— 個股日K、月均價、估值、融資融券、上市三大法人買賣超(金額/股數)、全市場收盤行情、加權指數歷史、外資持股歷史、個股月/年成交彙總、鉅額交易明細、融券借券餘額/成交、除權除息計算結果、當日沖銷交易標的與統計、全部指數(含類股指數)收盤(皆可查最新或任意過去日期) | 19 個 |
| MIS 即時報價 | 盤中即時多股報價(上市+上櫃)、ETF 已發行單位數與預估淨值/折溢價揭露 | 2 個 |
| TPEx OpenAPI | 櫃買中心 — 上櫃日收盤(最新一日;指定日期改用網站資料)、三大法人彙總、注意/處置股、零股、指數 | 6 個 |
| TAIFEX OpenAPI | 期交所 — 選擇權分析(Delta/未平倉增減)、保證金、年月統計 | 6 個 |
| TAIFEX 網站下載 | 期交所網站資料下載頁面 — 期貨/選擇權每日行情、三大法人(期貨/選擇權分計、總表、各契約、買賣權分計)、期貨與選擇權大額交易人部位、Put/Call Ratio(預設最新交易日,可回溯查詢;openapi.taifex.com.tw 僅提供最新一日) | 10 個 |
| 公開資訊觀測站 MOPS | 綜合損益表/資產負債表/現金流量表、月營收、股利分派(皆預設最新一期,可查任意過去期間;上市櫃、興櫃、公發公司皆可)、重大訊息(含全文)、董監持股與設質、內部人持股異動、庫藏股、背書保證與資金貸與、法人說明會 | 11 個 |
| TPEx 網站 | 櫃買中心網站 API — 上櫃個股日K、三大法人買賣超、融資融券、本益比/殖利率/淨值比、外資持股排行、除權除息計算結果(預設最新交易日,可回溯任意過去日期) | 6 個 |
| 投信投顧公會 ETF 專區 | 所有投信的 ETF 基本資料(另合併證交所基金基本資料、櫃買中心 ETF 商品規格)、每月規模/淨值/受益人數/申購買回/定期定額(2007 年起) | 2 個 |
| 集保結算所開放資料 | 集保戶股權分散表(最新一週完整級距,或最近 13 週逐週趨勢與週變化;後者走集保查詢頁) | 1 個 |
| 國發會 | 景氣對策信號與景氣指標(1982 起)、臺灣採購經理人指數 PMI/NMI | 2 個 |
| 中央銀行 | 新台幣及主要貿易對手通貨對美元每日匯率(1993 起) | 1 個 |
| 衍生分析(由上述資料計算) | 還原權息日K、技術指標(MA、KD、RSI、MACD、布林通道)、估值選股 screener、同業比較(上市+上櫃) | 4 個 |
歡迎PR!
MIT授權 | 僅供參考,不構成投資建議
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by stripe
Provides SDKs and tools to integrate Stripe's billing and API services with large language models, agent frameworks, and token‑metering for AI‑powered products and businesses.
by goat-sdk
Enables AI agents to send and receive payments, purchase goods and services, execute investment strategies, tokenize assets, and obtain financial insights by leveraging blockchains, stablecoins, and wallets.
by financial-datasets
Provides access to income statements, balance sheets, cash flow statements, stock prices, market news, and cryptocurrency data through MCP tools for AI assistants.
by openaccountants
Provides open‑source, accountant‑reviewed tax guides that AI models can cite when answering tax‑related queries, ensuring answers are backed by current jurisdictional rules and credited experts.
by alpacahq
Enables large language models to trade stocks and options, retrieve real‑time and historical market data, and manage portfolios using plain English commands through a local or remote MCP server.
by stefanoamorelli
Provides an MCP server that connects AI models to SEC EDGAR filings, enabling real‑time retrieval of company filings, financial statements, and insider‑trading data with exact XBRL precision and verifiable filing references.
by imbenrabi
Provides AI assistants with direct access to Financial Modeling Prep data, including real‑time stock quotes, company fundamentals, financial statements, market indexes, news, and alternative data sets via the Model Context Protocol.
by ariadng
Enables AI LLMs to execute trades on the MetaTrader 5 platform through the Model Context Protocol.
by XeroAPI
Provides a bridge between the Model Context Protocol and Xero's API, enabling standardized access to Xero accounting and business features.