Golden Egg TW Holdings MCP
Click on "Install 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., "@Golden Egg TW Holdings MCPshow my current stock holdings across all my linked brokerages"
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.
Golden Egg
Golden Egg 是台股券商庫存查詢命令列工具,可查詢並整合富邦、永豐、玉山、台新證券 Nova API 的持股資料。

重要前提
執行本專案前,必須先到各券商完成 API 申請流程。通常包含:
申請或啟用證券 API 服務
簽署 API 使用風險聲明書或同意書
申請並下載交易憑證
取得 API Key、API Secret、登入帳號密碼或券商設定檔
等待券商完成開通;部分券商簽署後不是立即生效
沒有完成券商端 API 開通時,程式可以安裝,但無法成功登入券商 API。
Related MCP server: Fund Dashboard MCP Server
支援券商
券商 | broker code | SDK | 登入方式 |
富邦證券 |
|
| API Key + 憑證 |
永豐證券 |
|
| API Key + API Secret + 憑證 |
玉山證券 |
|
|
|
台新證券 Nova API |
|
| 帳密 + 憑證 |
各券商申請流程與設定欄位請看 券商設定文件。
環境需求
macOS ARM64
Python 3.13 或更高版本
uv
各券商 API 權限與憑證
本地 SDK wheel 檔案放在
wheels/
目前 *.whl 被 .gitignore 忽略。clone 專案後,請依 券商設定文件 下載需要的 SDK wheel 到 wheels/。
安裝 uv
macOS / Linux:
curl -LsSf https://astral.sh/uv/install.sh | shWindows:
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"安裝依賴
uv sync可選:安裝成全域命令。
uv tool install --editable .安裝後可直接使用:
golden-egg --help確認台新 SDK 已安裝到目前 uv 環境:
uv run python -c "from taishin_sdk import TaishinSDK; print(TaishinSDK)"設定檔模式
本專案透過根目錄 .env-debug 決定要讀正式設定還是測試設定。
EGG_DEBUG=true讀取規則:
| 讀取檔案 |
|
|
|
|
如果你明明改了 .env 但程式沒有吃到,多半是因為 EGG_DEBUG=true,程式正在讀 .env.test。
基本使用
列出支援券商:
golden-egg brokers查詢全部券商持股:
golden-egg holdings查詢單一券商:
golden-egg holdings --broker fubon查詢多個券商:
golden-egg holdings --broker fubon,esun強制重新呼叫券商 API:
golden-egg holdings --broker tssco --force-refresh輸出原始 JSON:
golden-egg holdings --broker fubon --raw永豐交易紀錄
查詢今日實際成交;--symbols 可省略,省略時列出今日全部股票成交:
golden-egg transactions today \
--symbols 2330,2317查詢區間內已完成的現股買賣配對:
golden-egg transactions realized \
--broker sinopac \
--symbols 2330,2317 \
--begin-date 2026-01-01 \
--end-date 2026-07-27兩個命令預設輸出表格。加入 --json 可輸出 JSON;加入 --account-id 可指定永豐證券帳戶,省略時使用 Shioaji 的預設股票帳戶。
Python 程式可直接使用同一服務:
from service.transaction_service import TransactionService
service = TransactionService()
today = service.get_today(broker="sinopac", symbols="2330,2317")
realized = service.get_realized(
broker="sinopac",
symbols="2330,2317",
begin_date="2026-01-01",
end_date="2026-07-27",
)限制:
交易紀錄目前只支援永豐;
today預設使用sinopac,realized仍須明確指定--broker sinopac。today使用order_deal_records(),只顯示今日實際成交;永豐模擬環境不提供此資料。realized使用區間損益與 detail,只支援可可靠配對方向的現股Cash;其他交易條件會排除並顯示警告。尚未賣出的歷史買進不會出現在
realized。本工具不持久化成交紀錄,因此無法在日後回補過去未保存的逐筆成交。
歷史資料可顯示買進端費稅與整筆淨損益,但永豐回應未拆分賣出端手續費與交易稅。
尚未安裝全域命令時,也可以用:
uv run python main.py holdings --broker all測試
日常測試:
uv run pytest -q單元測試:
uv run pytest -q test/unit單一券商整合測試:
uv run pytest -W ignore::DeprecationWarning -v -s test/integration/test_fubon_integration.py
uv run pytest -W ignore::DeprecationWarning -v -s test/integration/test_tssco_integration.py
uv run pytest -W ignore::DeprecationWarning -v -s test/integration/test_sinopac_integration.py
uv run pytest -W ignore::DeprecationWarning -v -s test/integration/test_esun_integration.py整合測試會連真實券商 API。若券商端暫時錯誤、rate limit 或尚未開通,測試可能 skip 或失敗。
文件
安全注意事項
不要 commit
.env或.env.test不要 commit
.p12、.pfx、config.ini不要把 API key、API secret、憑證密碼貼到 issue 或 PR
wheels/*.whl目前不進 git,請在本機自行準備
授權
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceProvides access to real-time stock prices, financial statements, news, and options data via the Model Context Protocol. It enables AI assistants to retrieve comprehensive market data, including historical prices and analyst recommendations, through a standardized interface.691MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to manage and analyze personal investment portfolios, including fund and stock holdings, net value tracking, XIRR calculations, penetration analysis, and backtesting.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceProvides access to SEC EDGAR 13F institutional holdings, Form 4 insider trading, and smart money convergence signals for AI agents via the Model Context Protocol.752MIT
- AlicenseAqualityCmaintenanceEnables AI agents to read Robinhood Chain stock-token positions, quote swaps, and execute swaps through the Model Context Protocol, bridging on-chain assets that Robinhood's own off-chain MCP cannot reach.4MIT
Related MCP Connectors
Read-only China A-share data for AI agents: market, limit-up, capital flow and disclosures.
Connect AI agents to bank accounts, transactions, balances, and investments.
Real SEC, 13F, insider, congress & macro data your AI agent can cite. Hosted MCP, 24 tools.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/joehwang/goldenegg-tw-holdings-cli'
If you have feedback or need assistance with the MCP directory API, please join our Discord server