Stock Market Real-Time Analyzer
An MCP server that provides real-time stock market data and price comparisons from Yahoo Finance, Alpha Vantage, and Finnhub. It enables AI assistants to fetch individual quotes, compare data across multiple sources, and retrieve market metrics for various tickers.
README
📈 Stock Market Real-Time Analyzer
A comprehensive Python tool for fetching and analyzing real-time stock market data from multiple public APIs. Features include a command-line interface, web dashboards, and an MCP (Model Context Protocol) server for AI assistant integration.
✨ Features
- Multi-Source Data Fetching: Get stock data from Yahoo Finance, Alpha Vantage, and Finnhub
- Real-Time Analysis: Compare prices across different sources
- Multiple Interfaces:
- Command-line tool
- Web dashboard (Flask)
- Standalone HTML dashboard
- Streamlit dashboard
- MCP server for AI assistants (Claude, Kiro)
- Comprehensive Data: Price, change, volume, market cap, day high/low, and more
- Easy Integration: Works with Claude Desktop and other MCP-compatible clients
🚀 Quick Start
Installation
# Clone the repository
git clone https://github.com/YOUR_USERNAME/stock-market-analyzer.git
cd stock-market-analyzer
# Install dependencies
pip install -r requirements.txt
Basic Usage
Command Line:
python main.py AAPL GOOGL MSFT
Standalone Dashboard:
open standalone_dashboard.html
Web Dashboard:
python web_dashboard.py
# Open http://127.0.0.1:8080
🔑 API Keys (Optional)
Yahoo Finance works without API keys. For additional sources:
- Copy
.env.exampleto.env - Add your API keys:
- Alpha Vantage - Free tier: 25 requests/day
- Finnhub - Free tier available
cp .env.example .env
# Edit .env and add your keys
🤖 MCP Server Integration
Use this tool with AI assistants like Claude Desktop or Kiro.
Setup for Claude Desktop
- Run the setup script:
./setup_claude_desktop.sh
-
Restart Claude Desktop
-
Ask Claude: "Get the stock price for AAPL"
See CLAUDE_DESKTOP_SETUP.md for detailed instructions.
Setup for Kiro
The MCP server is pre-configured in .kiro/settings/mcp.json. Just restart Kiro and ask:
- "Get the stock price for AAPL"
- "Compare TSLA across all sources"
📊 Available Tools
Command Line
# Single stock
python main.py AAPL
# Multiple stocks
python main.py AAPL GOOGL MSFT TSLA
# Interactive mode
python main.py
MCP Server Tools
When integrated with AI assistants, you get access to:
- get_stock_quote - Get quote from specific sources
- compare_stock_sources - Compare data across all sources
- get_best_quote - Get most reliable quote
- get_multiple_quotes - Get quotes for multiple symbols
🏗️ Project Structure
.
├── analyzer.py # Core analysis logic
├── data_sources.py # API integrations
├── config.py # Configuration management
├── main.py # CLI interface
├── mcp_server.py # MCP server for AI integration
├── web_dashboard.py # Flask web server
├── dashboard.py # Streamlit dashboard
├── standalone_dashboard.html # Browser-only version
├── templates/
│ └── index.html # Web dashboard UI
├── .kiro/settings/
│ └── mcp.json # Kiro MCP configuration
└── requirements.txt # Python dependencies
📖 Documentation
- MCP Setup Guide - Detailed MCP server configuration
- Claude Desktop Setup - Claude Desktop integration
- Workflow Diagram - Complete data flow explanation
- Quick Start Guide - Getting started quickly
🔧 Requirements
- Python 3.9+
- Internet connection for API access
- Optional: API keys for Alpha Vantage and Finnhub
📦 Dependencies
requests- HTTP requestspandas- Data manipulationyfinance- Yahoo Finance APIpython-dotenv- Environment variablesflask- Web dashboard (optional)streamlit- Streamlit dashboard (optional)mcp- Model Context Protocol server
🎯 Use Cases
- Real-time stock monitoring - Track multiple stocks simultaneously
- Price comparison - Verify prices across different data sources
- AI assistant integration - Ask AI for stock data in natural language
- Data analysis - Export data for further analysis
- Portfolio tracking - Monitor your investments
🤝 Contributing
Contributions are welcome! Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
- Improve documentation
📝 License
MIT License - feel free to use this project for personal or commercial purposes.
🙏 Acknowledgments
- Yahoo Finance - Primary data source
- Alpha Vantage - Financial data API
- Finnhub - Stock market data
- Model Context Protocol - AI integration standard
📧 Contact
For questions or support, please open an issue on GitHub.
⚠️ Disclaimer
This tool is for informational purposes only. Stock market data may be delayed. Always verify information before making investment decisions. Not financial advice.
Made with ❤️ for stock market enthusiasts and AI developers
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。