stock-analyzer-mcp
The Stock Analyzer MCP server provides comprehensive Taiwan (TWSE/TPEx) and US stock market analysis through 87 tools across 14 categories. Here's what you can do:
Market Data & Quotes Access real-time/historical prices, market heatmaps, sector rankings, ETF holdings, exchange rates, seasonality patterns, stock comparisons, earnings calendars, and financial events for both TW and US markets.
Chip & Institutional Flow (Taiwan-specific) Track three major institutional investor flows, fund flow Sankey diagrams, margin rankings, abnormal block trades, insider sell alerts, and per-stock chip overviews.
Fundamental Analysis Retrieve financial statements, monthly revenue trends (YoY/MoM), EPS history, dividend info, and run DCF valuations with sensitivity analysis.
Technical Analysis Calculate RSI, MACD, KD, Bollinger Bands; detect 13 candlestick patterns; compute trading levels (MA support + Fibonacci); analyze stock correlations, Beta, and multi-dimensional radar scores.
Macroeconomic Insights Access US macro snapshots (yield curve, CPI, employment, Fed policy, VIX, DXY) and any FRED time series.
Sentiment Analysis Analyze per-stock and market-wide news sentiment using LLM/FinBERT, get multi-horizon price forecasts, and sentiment-driven entry strategies.
Portfolio Management View holdings, unrealized/realized P&L, performance vs benchmarks (CAGR, Sharpe, max drawdown), concentration risk, and quantitative signals. Add, update, or delete trade records and query a trade journal.
Backtesting & Quantitative Research Backtest RSI, MA crossover, breakout, and mean-reversion strategies; run parameter grid searches; compare up to 6 strategies in parallel; and run Monte Carlo simulations for factor mining and random portfolio benchmarking.
Risk Analysis Calculate portfolio VaR (historical, parametric, CVaR), assess systemic market risk, and run Markowitz mean-variance portfolio optimization.
AI-Powered Workflows
Deep-dive 5-agent debate (Bull vs Bear vs Sentiment vs Risk → Synthesizer) for a 6-level recommendation (~$0.16/call, Premium)
Daily portfolio briefings with macro context and actionable steps (~$0.04/call, Lite)
Side-by-side comparison of 2–5 investment candidates (free)
Post-trade review with pattern detection (free)
Natural language stock screening (e.g., "foreign investors buying 3 days + price above MA20")
Investment Thesis Management Create, update, invalidate, or reactivate per-stock theses tracking hypothesis, entry/target/stop-loss levels, risk conditions, and review dates.
Watchlists & Alerts Manage watchlists separately from your portfolio; set, list, and cancel price alerts.
Data Administration Trigger on-demand historical price backfills for individual stocks or batches.
Most tools are free; advanced AI workflows (research_stock_deep_dive, portfolio_daily_briefing generate mode) incur estimated LLM token costs.
Stock Analyzer MCP
📡 The Model Context Protocol server bundled with Stock Analyzer — a macOS desktop app for Taiwan + US stock market analysis.
An MCP server with deep Taiwan stock coverage (TWSE / TPEx + three major institutional flows + chip data + monthly revenue). 87 tools across 14 categories + 6 resources. Local-first — runs in-process inside the Electron app, no API costs, no cloud dependency.
Current version: MCP server 1.2.1 · Stock Analyzer app 0.47.9-beta · Updated 2026-05-27
⚠️ How this MCP server actually works
This repo contains the MCP shim source (mcp-server.js + lib/ai-tools + Dockerfile). The shim is a thin HTTP-to-stdio bridge — when an MCP client invokes a tool, the shim proxies the call to http://localhost:3000/api/*, where the Stock Analyzer desktop app's embedded Express backend does the actual work (DB query, computation, analysis).
The MCP server in this repo, run standalone (e.g. via
docker run), can advertise its 87 tools through introspection but cannot execute them. You need Stock Analyzer running on the same machine for tools to actually return data.
This split is intentional — the analysis engine + market data + license-gated features live in the closed-source desktop app; the MCP shim is open-source (MIT) so the integration surface is fully transparent.
Related MCP server: Taiwan Stock Agent
Why this repo exists
The Stock Analyzer desktop app itself is a commercial product (Lite tier free, Standard NT$1,499, Premium NT$2,999 — all one-time purchases, no subscription). This repo exists to:
Open-source the MCP shim layer under MIT so marketplaces (awesome-mcp-servers, mcpservers.org, PulseMCP, Glama) can build & verify a working image
Provide a public canonical link for MCP discovery
Host the integration guide separately from the closed app source
Make Claude Desktop / Claude Code / agentic frameworks easy to configure against the bundled MCP server
Build (Docker, for Glama / marketplaces)
docker build -t stock-analyzer-mcp .
docker run -i --rm stock-analyzer-mcp # stdio JSON-RPC on stdin/stdoutImage is ~258 MB (node:20-alpine + 2 npm deps). The build skips better-sqlite3, Electron, and other backend-only dependencies because the shim itself never imports them — all data calls go via HTTP to the locally-running Stock Analyzer app's /api/* endpoints.
What's in this MCP server
87 tools across 14 categories
Category | Tools | Examples |
market (13) | Quotes, history, heatmap, sector ranking, news, FX, seasonality, ETF holdings |
|
chips (6) | Three major institutional flows, fund flow Sankey, insider alerts, abnormal blocks, margin ranking |
|
fundamentals (6) | Financial statements, monthly revenue, dividends, EPS, DCF valuation |
|
technical (5) | RSI / MACD / KD / Bollinger / Beta / correlation / candlestick patterns |
|
macro (8) | FED policy, yield curve, inflation, employment, earnings calendar |
|
sentiment (5) | News sentiment, market sentiment, per-stock sentiment, forecasts, entry strategies |
|
portfolio (11) | Holdings, P&L, performance, concentration, signals, trade CRUD |
|
backtest (5) | Single-stock, multi-strategy, grid search, MC factor mining, random portfolio |
|
risk (3) | VaR, systemic risk, portfolio optimization |
|
ai workflow (6) | Full-stock analysis, screener, workflows, notes, + deep-dive debate + daily briefing + candidate comparison + post-trade review |
|
thesis (6) | Investment hypothesis CRUD |
|
watchlist (4) | Watchlist CRUD |
|
alert (3) | Price alerts |
|
backfill (2) | Admin data backfill |
|
Every tool carries:
annotations.readOnlyHint— whether the tool modifies state (clients auto-confirm before destructive ops)annotations.destructiveHint—delete_*/cancel_*flagged trueannotations.idempotentHint—upsert_*/update_*flagged true_meta.tw.stockanalyzer/estimated_cost_usd— worst-case LLM cost (most tools $0; deep-dive ~$0.16)
6 resources (Claude Desktop @-mentionable)
Inject context into your conversation without burning tool calls:
Resource | Content |
| Full holdings (TW + US, USD/TWD unified pricing, unrealized P&L) |
| All watchlist entries with live quotes + alert states |
| Active investment theses (hypothesis, key levels, next review dates) |
| Three major institutional flows / sector winners / systemic risk / FX |
| Latest portfolio briefing (free; doesn't auto-trigger LLM) |
| Server introspection (version, schema version, active profile, tool count) |
Profiles (filter what gets exposed)
Set SAA_MCP_PROFILE env var to gate which tools are visible to the LLM client:
Profile | Tools exposed | Use case |
| All 85 | Your personal Claude Desktop |
| 72 read-only tools | Shared / untrusted LLM clients — blocks |
Resources stay available in both profiles (they're read-only by definition).
How it compares
Server | TW coverage | US coverage | Local | License model |
Alpha Vantage MCP | ⚠️ Delayed quotes only | ✅ Full | ❌ Cloud API | Pay per call |
Financial Datasets MCP | ❌ None | ✅ Full | ❌ Cloud API | Subscription |
EODHD MCP | ⚠️ EOD only | ✅ Full | ❌ Cloud API | Subscription |
Lambda Finance | ❌ None | ✅ Full + options | ❌ Cloud | Subscription |
Stockflow (Yahoo) | ⚠️ Spotty TW data | ✅ Full | ❌ Cloud | Free (rate-limited) |
Stock Analyzer MCP | ✅ Deep TWSE + TPEx + institutional + chip | ✅ Full | ✅ Local SQLite | One-time license (Lite free) |
For non-Taiwan readers: Taiwan stock market has its own data ecosystem (TWSE, TPEx OpenAPI, three major institutional investors, monthly revenue reporting) that's nearly absent from English-speaking financial data platforms. If you want an AI agent that can answer "How are TSMC's institutional investors trading lately?" or "Find me TW small-caps with >30% YoY revenue growth", Stock Analyzer MCP is built for exactly this — deterministic TW chip/institutional/revenue tools that English-focused MCP servers generally lack.
Quickstart: Claude Desktop
1. Install Stock Analyzer
Get the free Lite tier from stockanalyzer.tw. Version 0.47.4-beta or later ships MCP server v1.2.0.
2. Configure Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"stock-analyzer": {
"command": "/Applications/Stock Analyzer.app/Contents/Resources/app.asar.unpacked/bin/saa-mcp",
"env": { "PORT": "3000" }
}
}
}Why the wrapper? Running
node mcp-server.jsdirectly hits abetter-sqlite3ABI mismatch (the binding is compiled for Electron's Node, not the system's). Thebin/saa-mcpwrapper auto-finds the SAA Electron runtime and runs the MCP server withELECTRON_RUN_AS_NODE=1. Older configs that point tonodewill need updating.
3. (Optional) Restrict to read-only mode
If the LLM client isn't fully trusted (shared Claude project, third-party agent), add:
"env": { "PORT": "3000", "SAA_MCP_PROFILE": "safe_readonly" }This blocks 15 write tools (add_trade, delete_trade, upsert_thesis, set_price_alert, etc.) but keeps all read tools + all 6 resources.
4. Fully restart Claude Desktop (cmd+Q then reopen)
5. Try it
"List all SAA stock-analyzer tools"
"Analyze 2330 — institutional flow last month + 3-month momentum + radar score + give me a buy/sell view"
"@saa://portfolio — what's my biggest concentration risk?"
"Compare 2330, 2454, and 3008 as candidates. Include their theses if they exist."
Claude will orchestrate multiple tool calls (or @-mentions for resources) and synthesize a research report.
Headline tools (2026-05-18)
🎭 research_stock_deep_dive — Premium tier
5 specialized AI agents debate in parallel:
🐂 Bull (only sees evidence supporting an upside thesis)
🐻 Bear (only sees evidence supporting a downside thesis)
📰 Sentiment (news + social signals)
🛡️ Risk (volatility, drawdown history, regime context)
🎯 Synthesizer (sees all four; produces a 6-level action:
strong_buy→avoid)
Each agent uses a distinct subset of the 87 tools. Output includes per-agent reasoning + final action + confidence score. ~$0.16/call LLM cost (Anthropic Sonnet / OpenAI).
🌅 portfolio_daily_briefing — Lite tier
Pre-market or post-market portfolio briefing. Aggregates current holdings, unrealized P&L, sector exposure, relevant macro / institutional flow into an actionable summary.
mode='get'→ reads the latest cached briefing (free, instant)mode='generate'→ runs a fresh one (~10-20s, ~$0.04/call LLM cost)
🔍 compare_investment_candidates — Lite, cost $0
Side-by-side deep analysis of 2-5 candidate stocks. Parallel fan-out of get_full_stock_analysis (fundamentals + technical + chip + institutional + levels) per candidate, plus existing thesis status. Deterministic — the agent sees raw evidence rather than an LLM-synthesized opinion, which empirically produces better reasoning.
📓 post_trade_review — Lite, cost $0
Past-N-days reflection. Aggregates analyze_trade_performance (FIFO P&L, win rate, hold time) + get_trade_journal (recent trades) + get_portfolio_signals (current state). Auto-detects observable patterns:
low_win_rate(< 40%) → systematic selection or timing problemover_trading(avg hold < 5 days) → fees eating returnslopsided_pnl(avg loss > avg win) → poor stop-loss discipline
Hands the agent objective indicators to write narrative review against.
Documentation
Full MCP usage guide (zh-TW + en):
MCP-USAGE-GUIDE.md— Claude Desktop setup, troubleshooting, conversation examplesLaunch blog post (bilingual):
docs/mcp-launch-2026-05.md— context on the 2026 MCP finance landscape + why TW coverage was the gapTool reference: bundled inside the app at Settings → 🔌 MCP / Agent
Design philosophy
Local-first: All data lives in
~/.twse-analyzer/stock_history.db(SQLite, single file). MCP server runs in-process inside the Electron app via stdio transport.BYOK LLM: SAA itself has an AI Hub that consumes the same 87 tools. Bring your own keys (Claude / GPT / Gemini / Ollama). The MCP server itself isn't tied to any LLM — it just exposes deterministic data + a few LLM-backed aggregators.
Transparent methodology: 16 bilingual methodology pages (zh-TW + en) explain every analytical tool's formula, data source, and limitations. Available at
/methodology.htmlinside the app.No active trading signals: Research output only — not order execution. Regulatory + product positioning decision.
Cost honesty: Every tool surfaces its worst-case LLM cost upfront via
_meta.tw.stockanalyzer/estimated_cost_usd. No hidden cloud-API spend.
Versioning
The MCP server uses two version numbers:
Field | Meaning | Bump on |
| SAA MCP binary version (shown at | Each SAA app release |
| Tool/resource shape version | Tool added/removed/renamed/required-changed |
Rules:
patch — additive (new tool, new resource)
minor — new required param, new enum restriction,
readOnlyHintchangemajor — rename, removal, required-keys change
Current: server 1.2.0, schema 1.2.0. Changelog inside mcp-server.js header.
License
This documentation repo is MIT licensed (see LICENSE). The Stock Analyzer app itself is closed-source commercial software.
Contact
Website: stockanalyzer.tw
Email: hello@stockanalyzer.tw
Issues: Use GitHub Issues on this repo for MCP integration questions
For app feature requests or bug reports: email above
Maintenance
Latest Blog Posts
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/kevinlin49361128-stack/stock-analyzer-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server