Financial Data MCP Server
Enables automated sending of financial analysis reports via email with chart attachments through Gmail's SMTP server.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Financial Data MCP Serveranalyze my tech portfolio and show buy/sell signals"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Financial Data MCP Server
A comprehensive Model Context Protocol (MCP) server for financial data analysis, portfolio management, and automated trading recommendations.
Features
📊 Real-time Stock Data - Uses free yfinance (Yahoo Finance) API - no API keys required
💼 Portfolio Management - Track multiple portfolios with automated analysis
📈 Technical Analysis - EMA-based trend detection and MACD charts
🎯 Trading Signals - Automated buy/sell recommendations with confidence levels
📧 Email Reports - Automated batch analysis reports with chart attachments
📉 Performance Tracking - Daily monitoring of recommendation performance
🤖 MCP Integration - Full integration with Claude Code and other MCP clients
Related MCP server: Stock Market Analysis MCP Server
Architecture
Core Components
financial_mcp_server.py - Main MCP server
Provides MCP tools and resources for financial analysis
Integrates with Claude Code
Real-time stock data via yfinance
batch_fin_mcp_server.py - Batch analysis engine
Analyzes all portfolios at once
Generates comprehensive reports and charts
Implements 4 trading scenarios based on EMA analysis
email_report_script.py - Email automation
Sends analysis results via email
Attaches charts and detailed reports
Saves buy recommendations for tracking
daily_tracking_script.py - Performance tracking
Monitors buy recommendation performance
Creates tracking charts
Generates daily performance reports
Installation
1. Clone the repository
git clone https://github.com/j1c4b/finance_mcp_server.git
cd finance_mcp_server2. Create and activate virtual environment
python3 -m venv mcp_fin_server_venv
source mcp_fin_server_venv/bin/activate # On Windows: mcp_fin_server_venv\Scripts\activate3. Install dependencies
pip install -r clean_requirements.txtConfiguration
Portfolio Setup
Edit portfolio.json to add your portfolios:
{
"tech_stocks": {
"portfolio": "Technology Giants",
"stock_list": ["AAPL", "GOOGL", "MSFT", "AMZN", "META"]
},
"dividend_portfolio": {
"portfolio": "Dividend Champions",
"stock_list": ["JNJ", "PG", "KO", "PEP", "MMM"]
}
}Email Configuration (Optional)
For email reports, create email_config.json:
{
"smtp_server": "smtp.gmail.com",
"smtp_port": 587,
"sender_email": "your_email@gmail.com",
"sender_password": "your_app_password",
"recipient_emails": ["recipient@example.com"],
"subject_prefix": "📊 Financial Analysis Report",
"max_attachment_size_mb": 25
}Usage
Running the MCP Server
source mcp_fin_server_venv/bin/activate
python3 financial_mcp_server.pyBatch Analysis
Analyze all portfolios and generate reports:
python3 batch_fin_mcp_server.pyResults are saved to batch_financial_charts/
Send Email Reports
python3 email_report_script.pyTrack Recommendations
python3 daily_tracking_script.pyResults are saved to tracking_charts/
MCP Tools
The server provides these tools for Claude Code integration:
load_portfolio- Load portfolio data from portfolio.jsonanalyze_portfolio- Detailed analysis of specific portfolioportfolio_performance- Performance metrics over timeget_stock_info- Comprehensive stock informationget_earnings_calendar- Upcoming earnings announcementsget_analyst_changes- Recent analyst upgrades/downgradesgenerate_macd_chart- MACD technical analysis chartsget_market_overview- Major market indices status
Trading Scenarios
The batch analyzer identifies 4 key trading scenarios:
Scenario A: Price >10% above 50 EMA → SELL signal
Scenario B: Price above 50 EMA, touched recently → BUY signal
Scenario C: Price >5% below 50 EMA, decreasing 3+ days, above 200 EMA → BUY signal
Scenario D: Price below 50 EMA, touched 200 EMA recently → BUY signal
Technical Analysis
Trend Detection: Golden Cross / Death Cross analysis
EMAs: 50-day and 200-day exponential moving averages
MACD: Moving Average Convergence Divergence charts
Volume Analysis: Trading volume patterns
Confidence Scores: Each recommendation includes confidence level
Project Structure
finance_mcp_server/
├── financial_mcp_server.py # Main MCP server
├── batch_fin_mcp_server.py # Batch analysis engine
├── email_report_script.py # Email automation
├── daily_tracking_script.py # Performance tracking
├── portfolio.json # Portfolio configuration
├── requirements.txt # Python dependencies
├── clean_requirements.txt # Cleaned dependencies
├── CLAUDE.md # AI assistant guidance
├── mcp-http-bridge/ # HTTP bridge for MCP
├── batch_financial_charts/ # Generated analysis charts
└── tracking_charts/ # Performance tracking chartsRequirements
Python 3.8+
yfinance (free Yahoo Finance API)
pandas, numpy, matplotlib
MCP SDK (mcp>=1.0.0)
Disclaimer
⚠️ This software is for informational purposes only. It does not constitute financial advice. Always do your own research before making investment decisions.
License
MIT License - See LICENSE file for details
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For issues and questions, please open an issue on GitHub.
This server cannot be deployed
Maintenance
Related MCP Connectors
Real-time stock quotes and technical signals: RSI, MACD, SMA crossovers via Yahoo Finance.
Analyze stocks with summaries, price targets, and analyst recommendations. Track SEC filings, divi…
Live market data, financial analysis, and portfolio research tools across 10,000+ tickers.
Backtest strategies and analyze portfolios on any ticker: CAGR, drawdown, Sharpe, from real data.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides stock market data and trading capabilities using the yfinance library37MIT
- FlicenseNot gradedqualityFmaintenanceEnables comprehensive stock market analysis with portfolio management, technical indicators, dividend tracking, sector analysis, risk metrics, and price alerts. Provides real-time stock data, trend analysis, and investment insights through natural language interactions.-
- AlicenseAqualityDmaintenanceProvides comprehensive financial analysis and real-time market data including stock information, options chains, technical indicators, financial statements, earnings calendars, and market sentiment indicators through integration with yfinance and other financial APIs.14MIT
- FlicenseNot gradedqualityDmaintenanceProvides real-time stock data, historical analysis, and stock comparisons using the Yahoo Finance API.-