How baguskto/saham-mcp works
Baguskto Saham is an MCP server that exposes Indonesian stock-market data and analysis to AI clients. The main workflow is a client tool request handled by the MCP server, which uses cache and data sources to produce a response. Historical data has a distinct fetch, parse, and local-cache path; other documented capabilities include market overview, stock information, sector performance, search, comparison, and technical analysis. The README documents these tools and source priorities, but excerpts omit much of their handler wiring, so uncertain links are left out.
Main entry points: index.ts MCP server · base.ts Source manager · historical-data-service.ts Historical data service · yahoo-finance.ts Yahoo Finance
Components 19
MCP Access
- CLI entry
src/cli.ts - MCP server
src/server/index.ts
Stock Tools
- Stock tool handlers
src/server/index.ts - Technical analysis
src/services/technical-analysis.ts - Response cache
src/cache/index.ts
Data Sources
- Source manager
src/data-sources/base.ts - Source initialization
src/data-sources/index.ts - Yahoo Finance
src/data-sources/yahoo-finance.ts - Web fallback
src/data-sources/web-scraper.ts - GitHub dataset source
src/data-sources/github-dataset.ts
Historical Data
- Historical data service
src/services/historical-data-service.ts - GitHub API client
src/utils/github-api.ts - CSV parser
src/services/csv-parser.ts - Historical JSON
data/historical/BBCA.json - Stock metadata
data/metadata/BBCA.json
Other components
- AI client
- Yahoo Finance service
- Market websites
- Dataset-Saham-IDX
Connections 18
- AI client → MCP server: requests tools
- CLI entry → MCP server: starts
- MCP server → AI client: returns results
- MCP server → Stock tool handlers: dispatches tools
- MCP server → Response cache: reads and writes
- MCP server → Source manager: requests market data
- MCP server → Technical analysis: uses analysis
- Source initialization → Source manager: registers sources
- Source manager → GitHub dataset source: dispatches historical
- Source manager → Yahoo Finance: dispatches live data
- Source manager → Web fallback: fallback dispatch
- Yahoo Finance → Yahoo Finance service: fetches quotes
- Web fallback → Market websites: scrapes data
- Historical data service → GitHub API client: requests dataset data
- Historical data service → CSV parser: parses CSV
- Historical data service → Historical JSON: reads and writes
- Historical data service → Stock metadata: reads and writes
- GitHub API client → Dataset-Saham-IDX: fetches files