feat: Integrate TWSE market data tools via MCP bridge#110
Open
JasonWang1124 wants to merge 6 commits intoTraderAlice:masterfrom
Open
feat: Integrate TWSE market data tools via MCP bridge#110JasonWang1124 wants to merge 6 commits intoTraderAlice:masterfrom
JasonWang1124 wants to merge 6 commits intoTraderAlice:masterfrom
Conversation
Add 29 Taiwan Stock Exchange tools covering company fundamentals, trading data, market indices, foreign investment, ESG, warrants, and more. Tools connect to a local TWSEMCPServer instance via MCP HTTP transport, with lazy-connect and opt-in config gating. Closes TraderAlice#109 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add twstockGetStockRealtimeQuote for live intraday data via TWSE matching system API. Updates get_stock_daily_trading description to clarify it only updates after market close. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add KlineChart component using lightweight-charts (TradingView) that renders candlestick charts with MA5/MA20/MA60 and volume histogram. ChatMessage detects ```kline code blocks and renders them inline. Supports both daily (YYYY-MM-DD) and intraday (ISO datetime) data. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add twstockGetStockKlineData for historical OHLCV chart data - Fix inherited CLAUDECODE env var causing nested session crash - Update daily trading description to reference realtime alternative Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add 7 Fugle tools for intraday candles (1/3/5/10/15/30/60 min), real-time quotes, tick-by-tick trades, price-volume distribution, historical candles (D/W/M), and historical stats. Connects to local Fugle MCP server via HTTP for fast response (~100-400ms). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fugleCheckVolumeSpikes scans multiple stocks in one call, comparing latest candle volume against previous average. Can be scheduled via cron for continuous intraday monitoring during market hours. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #109
Adds 29 Taiwan Stock Exchange (TWSE) tools to OpenAlice, bridging the TWSEMCPServer into the existing tool system via MCP HTTP transport.
src/domain/twstock/client.ts— MCP client with lazy-connect (connects on first tool call)src/domain/twstock/config.ts— Config reader fordata/config/twstock.json(gitignored)src/tool/twstock.ts— 29 tool definitions using existing Zod + factory patternsrc/main.ts— Conditional registration + shutdown hook.gitignore— Addservices/for local MCP server clonesTools added
Design choices
mcpUrl→ zero tools registered, zero impactdata/config/twstock.jsonequity.ts,market.ts, etc.main.tstouched (3 imports + 6 lines registration + 1 line shutdown)Setup
Test plan
npx tsc --noEmit)twstockGetCompanyProfileand returns formatted TSMC data🤖 Generated with Claude Code