TDCC 集中保管結算所
Released已發布MCP Server for TDCC (Taiwan Depository & Clearing Corporation) — 8 AI-callable tools for Taiwan securities custody open data including shareholding distribution and fund NAV.
臺灣集中保管結算所 MCP Server — 8 個工具查詢股權分散表、庫存異動、境外基金淨值與電子投票等。
Features功能特色
- 8 specialized tools — Stock info, shareholding tiers, monthly/weekly custody changes, director holdings, offshore fund NAVs, e-voting, plus a generic query for all 100+ endpoints
- Client-side filtering — Search by stock code, name, market type
- BOM handling — Automatically strips BOM characters from API responses
- Retry with backoff — Automatic retry for transient errors
- Zero configuration — No API keys, no credentials, just install and use
- 8 個專用工具 — 證券基本資料、股權分散表、月/週集保異動、董監持股、境外基金淨值、電子投票,加上通用查詢涵蓋全部 100+ 端點
- 客戶端篩選 — 依證券代號、名稱、市場類型搜尋
- BOM 處理 — 自動移除 API 回應中的 BOM 字元
- 自動重試 — 暫時性錯誤自動退避重試
- 零設定 — 不需要 API 金鑰,安裝即可使用
Available Tools可用工具
| Tool | Description | Key Parameters |
|---|---|---|
get_securities_info |
Securities basic data (證券基本資料) | stock_code, stock_name, market |
get_shareholding_distribution |
Shareholding distribution by tier (股權分散表) | stock_code |
get_stock_monthly_changes |
Monthly custody change analysis (月分析表) | stock_code, market |
get_stock_weekly_balance |
Weekly custody balance (週餘額表) | stock_code, market |
get_director_shareholding |
Director/supervisor custody (董監持股) | stock_code |
get_offshore_fund_nav |
Offshore fund NAV (境外基金淨值) | fund_code, fund_name |
get_evoting_info |
Shareholder e-voting (股東e票通) | stock_code, meeting_type |
get_tdcc_opendata |
Generic query for any endpoint | endpoint_id, filter_field, filter_value, limit |
| 工具 | 說明 | 主要參數 |
|---|---|---|
get_securities_info |
證券基本資料查詢 | stock_code, stock_name, market |
get_shareholding_distribution |
股權分散表查詢 | stock_code |
get_stock_monthly_changes |
個別股票異動月分析 | stock_code, market |
get_stock_weekly_balance |
保管有價證券週餘額 | stock_code, market |
get_director_shareholding |
董監分戶保管查詢 | stock_code |
get_offshore_fund_nav |
境外基金淨值查詢 | fund_code, fund_name |
get_evoting_info |
股東電子投票查詢 | stock_code, meeting_type |
get_tdcc_opendata |
通用開放資料查詢 | endpoint_id, filter_field, filter_value, limit |
Contributing貢獻
See CONTRIBUTING.md for details.
詳見 CONTRIBUTING.md。
License授權
MIT License — see LICENSE for details.
MIT License — 詳見 LICENSE。
OverviewOverview
Query Taiwan's central securities depository open data through AI. Access shareholding distribution, stock custody changes, offshore fund NAVs, e-voting information, and 100+ more datasets — all through natural language conversation.
No API key required — TDCC OpenData is a free public API.
透過 AI 查詢台灣中央證券存託的開放資料。可存取股權分散表、個股集保異動、境外基金淨值、電子投票資訊及 100+ 個資料集 — 全部透過自然語言對話操作。
不需要 API 金鑰 — TDCC 開放資料是免費公開 API。
InstallInstall
From PyPI
pip install mcp-tdcc
From source
git clone https://github.com/asgard-ai-platform/mcp-tdcc.git
cd mcp-tdcc
uv venv && source .venv/bin/activate
uv pip install -e .
從 PyPI 安裝
pip install mcp-tdcc
從原始碼安裝
git clone https://github.com/asgard-ai-platform/mcp-tdcc.git
cd mcp-tdcc
uv venv && source .venv/bin/activate
uv pip install -e .
ConfigurationConfiguration
No environment variables required. TDCC OpenData is a public API.
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"tdcc": {
"command": "mcp-tdcc"
}
}
}
Claude Code
The .mcp.json file is auto-discovered when you open the project directory.
Or run directly:
claude mcp add tdcc -- python mcp_server.py
Cursor
Add to .cursor/mcp.json:
{
"mcpServers": {
"tdcc": {
"command": "mcp-tdcc"
}
}
}
不需要環境變數。TDCC 開放資料是公開 API。
Claude Desktop
加入 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"tdcc": {
"command": "mcp-tdcc"
}
}
}
Claude Code
專案目錄中的 .mcp.json 會自動被偵測。
或直接執行:
claude mcp add tdcc -- python mcp_server.py
Usage ExamplesUsage Examples
"I want to know the recent status of 2330 (TSMC)"
You: 幫我查一下 2330 台積電最近的集保狀態
AI calls:
get_securities_info(stock_code="2330")
get_shareholding_distribution(stock_code="2330")
get_stock_monthly_changes(stock_code="2330")
get_stock_weekly_balance(stock_code="2330")
Result: Returns TSMC's basic info, 17-tier shareholding distribution (retail vs institutional), monthly custody change analysis, and weekly balance trends.
"Show me the shareholding distribution of 2330"
You: 台積電的股權分散表,散戶跟大戶各佔多少?
AI calls:
get_shareholding_distribution(stock_code="2330")
Result: SUCCESS — 17 tiers from 1-999 shares to 800,001+ shares, with shareholder count and share percentage at each level.
"Search for any ETF custody data"
You: 最近 ETF 保管狀況怎樣?0050 的集保戶數有多少?
AI calls:
get_tdcc_opendata(endpoint_id="2-41", filter_field="證券代號", filter_value="0050")
Result: SUCCESS — ETF monthly analysis showing month-end custody units, change from previous month, issued units, and shareholder count.
"What are current TAIBIR rates?"
You: 現在 TAIBIR 利率是多少?
AI calls:
get_tdcc_opendata(endpoint_id="2-19", limit=5)
Result: SUCCESS — Historical TAIBIR benchmark rates across 10-day to 365-day tenors.
"Check offshore fund NAVs"
You: 幫我查一下有沒有貝萊德的境外基金淨值
AI calls:
get_offshore_fund_nav(fund_name="貝萊德")
Result: SUCCESS — Latest NAV data for matching BlackRock offshore funds registered in Taiwan.
"When is TSMC's shareholder meeting?"
You: 台積電今年股東會什麼時候?有電子投票嗎?
AI calls:
get_evoting_info(stock_code="2330", meeting_type="annual")
Result: Returns e-voting period and shareholder meeting date for TSMC.
「我想知道 2330 台積電最近的狀態」
你: 幫我查一下 2330 台積電最近的集保狀態
AI 呼叫:
get_securities_info(stock_code="2330")
get_shareholding_distribution(stock_code="2330")
get_stock_monthly_changes(stock_code="2330")
get_stock_weekly_balance(stock_code="2330")
結果: 回傳台積電基本資料、17 級距股權分散表(散戶 vs 法人)、月度集保異動分析、週餘額趨勢。
「台積電的股權分散表」
你: 台積電的股權分散表,散戶跟大戶各佔多少?
AI 呼叫:
get_shareholding_distribution(stock_code="2330")
結果: SUCCESS — 17 個級距,從 1-999 股到 800,001 股以上,含各級距股東人數與持股比例。
「查 ETF 保管資料」
你: 最近 ETF 保管狀況怎樣?0050 的集保戶數有多少?
AI 呼叫:
get_tdcc_opendata(endpoint_id="2-41", filter_field="證券代號", filter_value="0050")
結果: SUCCESS — ETF 月分析表,含月底保管單位數、增減數額、發行單位數、集保戶數。
「現在 TAIBIR 利率是多少?」
你: 現在 TAIBIR 利率是多少?
AI 呼叫:
get_tdcc_opendata(endpoint_id="2-19", limit=5)
結果: SUCCESS — TAIBIR 歷史定盤利率,涵蓋 10 天期至 365 天期。
Data SourceData Source
All data comes from TDCC OpenData API:
- 100+ endpoints covering securities, bonds, funds, structured products, futures, and e-voting
- Updated daily by Taiwan Depository & Clearing Corporation
- Free & public — no registration or API key needed
所有資料來自 TDCC 開放資料 API:
- 100+ 個端點 涵蓋證券、債券、基金、結構型商品、期信、電子投票
- 每日更新 由臺灣集中保管結算所維護
- 免費公開 — 不需要註冊或 API 金鑰
ArchitectureArchitecture
stdio (JSON-RPC 2.0)
→ mcp_server.py (entry point)
→ app.py (FastMCP singleton)
→ tools/tdcc_tools.py (@mcp.tool() — 8 tools with client-side filtering)
→ connectors/rest_client.py (GET requests + BOM stripping + retry)
→ auth/none.py (no auth)
→ config/settings.py (100+ endpoint paths)
stdio (JSON-RPC 2.0)
→ mcp_server.py (入口)
→ app.py (FastMCP 單例)
→ tools/tdcc_tools.py (@mcp.tool() — 8 個工具 + 客戶端篩選)
→ connectors/rest_client.py (GET 請求 + BOM 移除 + 重試)
→ auth/none.py (無認證)
→ config/settings.py (100+ 端點路徑)
TestingTesting
python scripts/auth/test_connection.py # Validate API connectivity
python tests/test_all_tools.py # Run all 12 E2E tests
python scripts/auth/test_connection.py # 驗證 API 連線
python tests/test_all_tools.py # 執行 12 個 E2E 測試
Part Of The Asgard EcosystemPart Of The Asgard Ecosystem
Built with the Asgard MCP Template. See the full Asgard AI Platform for 63+ MCP servers.
使用 Asgard MCP Template 建置。查看完整 Asgard AI Platform 生態系(63+ MCP 伺服器)。
Tags標籤
Part of所屬
Need more powerful finance capabilities? 需要更強大的finance能力?
Upgrade to Asgard for enterprise-grade features, SLAs, and dedicated support.
升級至 Asgard 取得企業級功能、SLA 與專屬支援。
View Asgard Products →查看 Asgard 產品 →Related MCP Servers相關 MCP 伺服器
Cnyes 鉅亨網財經
MCP Server for Cnyes financial news platform, enabling financial news search, market data access, an...
鉅亨網 Cnyes MCP Server,支援透過 AI 代理進行財經新聞搜尋、市場數據存取與投資洞察。
TPEx 櫃買中心
MCP Server for Taipei Exchange, providing OTC market data, trading information, and financial report...
台灣櫃買中心 TPEx MCP Server,為 AI 代理提供櫃買市場資料、交易資訊與財務報告。
Taiwan Company Finance 台灣公司財務資料
MCP Server for Taiwan company financial data, providing corporate financial statements, credit ratin...
台灣公司財務資料 MCP Server,為 AI 代理提供企業財務報表、信用評等與商業情報。