Retrieves historical stock price data (2019-2025) for 958 Indonesian stocks from the Dataset-Saham-IDX GitHub repository, providing comprehensive OHLCV data for technical analysis and performance tracking.
Baguskto Saham - MCP Server untuk Data Saham Indonesia
MCP Server untuk mengakses data Bursa Efek Indonesia (IDX) dengan dukungan data historis lengkap dari tahun 2019. Dibangun dengan TypeScript dan @modelcontextprotocol/sdk, server ini memungkinkan AI assistant untuk mengambil informasi saham real-time, data historis komprehensif, analisis teknikal, dan performa sektor.
v1.0.5 Features
✅ Data historis 2019-2025 (958 saham)
✅ GitHub Dataset-Saham-IDX terintegrasi
✅ Periode 2y dan 5y
✅ JSON-RPC compliant
✅ Error handling dengan fallback
Features
Market overview (IHSG, volume, top movers)
Stock info (price, ratios, market cap)
Historical data (2019-2025, OHLCV)
Sector performance
Stock search dan comparison
Technical analysis
958 saham IDX
Multi-source dengan fallback
TypeScript + Zod validation
Quick Start
Instalasi dan Penggunaan dengan npx
Cara termudah menggunakan Baguskto Saham adalah dengan npx:
Instalasi sebagai Dependency
Local Development
MCP Tools
The server provides 9 comprehensive MCP tools (fully implemented):
1. get_market_overview
Get Indonesian stock market overview including IHSG index.
Response:
2. get_stock_info
Get detailed information for a specific Indonesian stock.
3. get_historical_data
Get historical price data for a specific stock from 2019 to present.
Parameters:
ticker: Stock ticker symbol (required)period: Time period - "1d", "1w", "1m", "3m", "6m", "1y", "2y", "5y" (default: "1y")
Historical Data Coverage:
Time Range: July 2019 - Present (6+ years)
Data Points: ~1,200+ entries per stock
Stocks Covered: 958 IDX-listed stocks
Data Quality: 91%+ success rate
4. get_sector_performance
Get performance data for all IDX sectors.
5. search_stocks
Search for stocks by company name or ticker symbol from 958 available stocks.
6. get_stock_analysis
Get comprehensive technical analysis for a stock with indicators and recommendations.
Parameters:
ticker: Stock ticker symbol (required)period: Analysis period - "1m", "3m", "6m", "1y", "2y", "5y" (default: "1y")
7. compare_stocks
Compare performance of multiple stocks over a specified period.
Parameters:
tickers: Array of 2-5 stock ticker symbols (required)period: Comparison period - "1m", "3m", "6m", "1y", "2y" (default: "1y")
8. get_available_stocks
Get list of all 958 available stock tickers in the historical dataset.
Response includes:
Complete list of 958 IDX stocks
LQ45 categorization
Banking sector identification
9. get_dataset_info
Get information about the historical dataset including last update and coverage.
Response includes:
Repository information and last update
Total available stocks (958)
Cache statistics
Data coverage range (2019-2025)
Configuration
Environment Variables
Create a .env file or set environment variables:
Integrasi Claude Desktop
Tambahkan ke file konfigurasi Claude Desktop:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
Integrasi dengan Cursor IDE
Data Sources (Implemented)
Data Source Manager with Priority-based Fallback
The server uses a DataSourceManager that coordinates multiple data sources:
GitHubDatasetSource (Historical Data)
Source: wildangunawan/Dataset-Saham-IDX
Implementation:
src/data-sources/github-dataset.tsCoverage: 2019-2025 (6+ years)
Stocks: 958 IDX stocks
Priority: HIGH
Cache TTL: 24 hours
YahooFinanceSource (Real-time Data)
Implementation:
src/data-sources/yahoo-finance.tsLibrary:
yahoo-finance2Real-time stock quotes and IHSG index
Priority: HIGH
Cache TTL: 5 minutes
WebScrapingSource (Fallback)
Implementation:
src/data-sources/web-scraper.tsLibrary:
cheerio+axiosFallback when primary sources fail
Priority: MEDIUM
Performance & Reliability
Response Time: < 2 seconds for all queries
Historical Data: 1,200+ data points per stock (2019-2025)
Success Rate: 91%+ for historical data parsing
Caching Strategy:
Market overview: 1 minute
Stock info: 5 minutes
Historical data: 24 hours
Dataset info: Live fetch with caching
Error Handling: Graceful degradation with multi-source fallback
MCP Compliance: Clean JSON-RPC communication without parsing errors
Sample Queries for AI Assistants
Development
Project Structure (Current Implementation)
Troubleshooting
Common Issues
JSON parsing errors in MCP mode
# Ensure MCP mode is enabled IDX_MCP_LOG_LEVEL=error npx @baguskto/sahamHistorical data not loading
# Clear cache and retry npx @baguskto/saham clear-cache # Test GitHub connectivity npx @baguskto/saham testYahoo Finance timeouts
Increase timeout in configuration
Check internet connectivity
Use debug mode for diagnosis
Debug Mode
Version History
v1.0.5 (Latest - Production Ready)
✅ Complete GitHub Dataset Integration: Full access to 2019-2025 historical data via GitHubDatasetSource
✅ Fixed Column Mapping Bug: Resolved CSV parsing issues in csv-parser.ts (date column priority)
✅ Extended Period Support: Added 2y and 5y analysis periods to all tools
✅ JSON-RPC Compliance: Clean MCP protocol via mcp-entry.ts with stdout interception
✅ Enhanced Error Handling: Comprehensive error handling in DataSourceManager
✅ 958 Stock Coverage: Complete IDX stock universe from Dataset-Saham-IDX repository
✅ TypeScript Implementation: Full TypeScript with Zod validation and type safety
Previous Versions
v1.0.4: Basic MCP implementation with Yahoo Finance
v1.0.0-1.0.3: Initial releases and bug fixes
Contributing
Fork the repository at GitHub
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
License
MIT License - see LICENSE file for details.
Support
GitHub Issues: Report bugs
Discussions: Community discussions
Documentation: GitHub Repository
Dataset Credit: Historical data provided by Dataset-Saham-IDX repository.
Disclaimer: This server provides market data for informational purposes only. Not intended for trading or investment decisions. Always verify data from official sources.