Golden Egg TW Holdings MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/joehwang/goldenegg-tw-holdings-mcp
cd goldenegg-tw-holdings-mcp

Then follow the repository README for any remaining dependency or build steps before continuing.

2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add golden-egg -- node "<FULL_PATH_TO_GOLDENEGG_TW_HOLDINGS_MCP>/dist/index.js"

Replace <FULL_PATH_TO_GOLDENEGG_TW_HOLDINGS_MCP>/dist/index.js with the actual folder you prepared in step 1.

README.md

MCP server for querying Taiwan stock holdings across multiple brokerages.

Golden Egg

以 MCP Plugin 方式實現台股庫存查詢功能,讓 AI Agent 能夠輕鬆調用。目前支援富邦、永豐、元富、玉山等四間證券公司。

image

前置需求

  • 在要連接的卷商申請交易憑證,查看最下方的卷商文件
  • Python 3.13 或更高版本
  • UV 套件管理器

卷商文件

安裝 UV

macOS / Linux

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows

powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

驗證卷商是否開通

驗證永豐

uv run pytest -W ignore::DeprecationWarning  -v -s  test/unit/test_shinopac.py 

驗證富邦

uv run pytest -W ignore::DeprecationWarning  -v -s  test/unit/test_fubon_unit.py 

驗證玉山證卷

uv run pytest -W ignore::DeprecationWarning  -v -s  test/unit/test_esun_unit.py 

驗證元富證卷

uv run pytest -W ignore::DeprecationWarning  -v -s  test/unit/test_masterlink_unit.py 

其他測試

  • 測試所有integration test pytest -W ignore::DeprecationWarning -v -s
  • 測試所有unit test uv run pytest -W ignore::DeprecationWarning -v -s test/unit
  • 測試所有unit test 不帶 stdout uv run pytest -W ignore::DeprecationWarning -s test/unit

專案結構

golden-egg/
├── main.py                    # 主程式入口
├── pyproject.toml             # 專案配置
├── uv.lock                    # UV 依賴鎖定檔案
├── start.sh                   # 啟動腳本
├── README.md                  # 專案說明
├── broker/                    # 券商 API 模組
│   ├── __init__.py
│   ├── base.py                # 券商基礎類別
│   ├── esun/                  # 玉山證券 API
│   │   ├── __init__.py
│   │   ├── app.py
│   │   ├── certs/             # 玉山憑證檔案
│   │   ├── client.py
│   │   └── reset.py
│   ├── fubon/                 # 富邦證券 API
│   │   ├── __init__.py
│   │   ├── app.py
│   │   ├── certs/             # 富邦憑證檔案
│   │   ├── client.py
│   │   ├── log/               # 富邦日誌
│   │   ├── ocr_demo.py
│   │   └── ocr.py
│   ├── masterlink/            # 元富證券 API
│   │   ├── __init__.py
│   │   ├── app.py
│   │   ├── certs/             # 元富憑證檔案
│   │   ├── client.py
│   │   ├── Configs/           # 元富設定檔案
│   │   └── log/               # 元富日誌
│   └── sinopac/               # 永豐證券 API
│       ├── __init__.py
│       ├── certs/             # 永豐憑證檔案
│       └── client.py
├── config/                    # 配置模組
│   ├── __init__.py
│   └── settings.py            # 全域設定
├── docs/                      # 文件目錄
│   ├── cursor_mcp_setup.md
│   ├── market_data_api_spec.md
│   └── MCP_TESTING_GUIDE.md
├── log/                       # 全域日誌目錄
├── models/                    # 資料模型
│   ├── __init__.py
│   ├── accounts.py            # 帳戶模型
│   ├── common.py              # 共用模型
│   ├── data/
│   │   └── stock_info.json    # 股票資訊資料
│   ├── holdings.py            # 持股模型
│   └── market_data.py         # 市場資料模型
├── service/                   # 服務層
│   ├── __init__.py
│   ├── holdings_service.py    # 持股服務
│   ├── mcp/
│   │   ├── __init__.py
│   │   ├── prompts.py         # MCP 提示詞
│   │   ├── resources.py       # MCP 資源
│   │   └── tools.py           # MCP 工具
│   ├── mcp_server.py         # MCP 服務器
│   └── storage_service.py     # 儲存服務
├── test/                      # 測試目錄
│   ├── conftest.py            # 測試配置
│   ├── integration/           # 整合測試
│   │   ├── __init__.py
│   │   ├── test_esun_integration.py
│   │   ├── test_fubon_integration.py
│   │   ├── test_masterlink_integration.py
│   │   └── test_sinopac_integration.py
│   ├── log/                   # 測試日誌
│   └── unit/                  # 單元測試
│       ├── __init__.py
│       ├── test_esun_unit.py
│       ├── test_fubon_unit.py
│       ├── test_masterlink_unit.py
│       └── test_shinopac.py
└── wheels/                    # WHL 檔案目錄
    └── README.md

mcp設定

OPEN AI CODEX

# ~/.codex/config.toml  
[mcp_servers.golden-egg]
command = "uv"
args = ["run", "--project", "<YOUR_PATH>/golden-egg", "python", "<YOUR_PATH>/golden-egg/main.py"]

CURSOR

# ~/.cursor/mcp.json
{
  "mcpServers": {
    "golden-egg": {
      "command": "<YOUR_PATH>/golden-egg/.venv/bin/python",
      "args": ["<YOUR_PATH>/golden-egg/main.py"],
      "disabled": false
    }
  }
}

VSCODE

#檢視>命令選擇區>add mcp server
"golden-egg": {
      "command": "<YOUR_PATH>/golden-egg/.venv/bin/python",
      "args": ["<YOUR_PATH>/golden-egg/main.py"],
      "type": "stdio"
}

授權

MIT

Tools (1)

get_holdingsRetrieve current stock holdings from connected brokerage accounts.

Configuration

claude_desktop_config.json
{"mcpServers": {"golden-egg": {"command": "/path/to/golden-egg/.venv/bin/python", "args": ["/path/to/golden-egg/main.py"]}}}

Try it

What are my current stock holdings in my Fubon account?
Show me the total value of my portfolio across all connected Taiwan brokerages.
List the stocks I own in my SinoPac account.
Check my current holdings in E.SUN and MasterLink.

Frequently Asked Questions

What are the key features of Golden Egg TW Holdings?

Supports portfolio data retrieval from Fubon, SinoPac, MasterLink, and E.SUN brokerages.. Standardized interface for AI agents to interact with brokerage accounts.. Built using Python 3.13 and managed via UV.. Includes integration and unit tests for all supported brokerages..

What can I use Golden Egg TW Holdings for?

Automated portfolio tracking for investors using multiple Taiwan-based brokerages.. AI-assisted financial analysis of personal stock holdings.. Consolidating stock data from disparate brokerage APIs into a single interface for LLMs..

How do I install Golden Egg TW Holdings?

Install Golden Egg TW Holdings by running: curl -LsSf https://astral.sh/uv/install.sh | sh

What MCP clients work with Golden Egg TW Holdings?

Golden Egg TW Holdings works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Golden Egg TW Holdings docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare