shioaji-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
shioaji-mcp
永豐金證券 Shioaji API 的唯讀 MCP 伺服器。讓 Claude Code 等 MCP client 查詢行情與帳務資料。不提供任何下單工具,無法下單、改單或刪單。
需求
Python 3.12 以上
永豐金證券帳戶,並已在 API 管理頁面申請 API Key
Related MCP server: Webull MCP Server
安裝
git clone https://github.com/xianyuntang/shioaji-mcp.git
cd shioaji-mcp
uv sync在專案根目錄建立 .env(已列入 .gitignore):
SJ_API_KEY=你的_api_key
SJ_SEC_KEY=你的_secret_key
SJ_PRODUCTION=false
# 選填,只有 ca_status 會用到
SJ_CA_PATH=/絕對路徑/Sinopac.pfx
SJ_CA_PASSWD=憑證密碼加入 Claude Code:
claude mcp add shioaji -- uv --directory /path/to/shioaji-mcp run --env-file .env main.py其他 MCP client(JSON 設定):
{
"mcpServers": {
"shioaji": {
"command": "uv",
"args": ["--directory", "/path/to/shioaji-mcp", "run", "--env-file", ".env", "main.py"]
}
}
}環境變數
變數 | 必填 | 預設 | 說明 |
| 是 | — | 永豐 API 管理頁面取得的 API Key |
| 是 | — | 與 |
| 否 |
| 設 |
| 否 | — | 憑證檔( |
| 否 | — | 憑證密碼(通常是身分證字號) |
憑證只用來讓 ca_status 回報到期時間。查詢功能不需要憑證,憑證啟用失敗也不影響查詢。
第一次呼叫工具時才登入,之後整個程序共用同一個 session。
工具
商品與行情
工具 | 說明 |
| 商品資料(參考價、漲跌停、當沖、資券資訊) |
| 最新快照,一次最多 500 檔 |
| 指定日期區間的 1 分 K |
| 單日逐筆成交(全部、最後 N 筆或時間區間) |
| 排行:漲跌幅、漲跌價、振幅、成交量、成交金額、成交筆數 |
| 資券餘額 |
| 借券賣出餘額 |
| 處置股 |
| 注意股 |
| API 連線數與每日流量額度 |
帳務
工具 | 說明 |
| 證券/期貨帳戶 |
| 交割銀行帳戶餘額 |
| 交割款(T、T+1、T+2) |
| 證券交易額度、融資融券額度 |
| 期權權益數、保證金、風險指標 |
| 未實現損益與持倉明細 |
| 已實現損益 |
| 今日委託與成交 |
| 憑證啟用結果與到期時間 |
商品代碼格式:股票 2330、期貨近月連續 TXFR1、選擇權 TXO31200G6、指數 IX0001(加權指數)。
行情查詢會計入 Shioaji 每日流量額度,不要用來輪詢即時報價。
免責聲明
非官方專案,與永豐金證券無關。依現狀提供,不負任何擔保,使用風險自負。
授權
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only market charts, OHLC, backtests and a view of your connected broker accounts
Read-only market research: index funds, event cards, CLOB data, fund analytics. No orders.
Read-only access to your MetaTrader 4 and 5 accounts for AI agents: balances, open positions, trade history with win rate, live quotes, symbol specs and candles. It cannot place, modify or close orders.
Read-only access to your Skipo account: balances, deposits, withdrawals, orders, ledger and prices.
Related MCP Servers
FlicenseNot gradedqualityDmaintenanceRead-only MCP server that lets a verified client connect their own AI to their trading account to read account data without order execution.-- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to read Webull account balances, positions, orders, stock quotes, historical bars, and US option market data, with live equity trading available only as an explicitly enabled opt-in.MIT
- FlicenseNot gradedqualityBmaintenanceEnables MCP clients to securely access read-only Psagot Trade account and market information through authenticated HTTP endpoints. It exposes only read-only tools, with no trade-submission capabilities.-
- AlicenseBqualityCmaintenanceEnables read-only access to Questrade accounts, portfolios, market data, transactions, technical analysis, and order history through MCP.11MIT