adekoyadapo/stock-mcp
If you are the rightful owner of stock-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Stock Trading MCP Server provides daily stock trading analysis using real-time data from Yahoo Finance, integrated with Claude Desktop for informed trading decisions.
Stock Trading MCP Server
A Model Context Protocol (MCP) server that provides daily stock trading analysis with technical indicators. This server integrates with Claude Desktop to help you make informed trading decisions using real-time data from Yahoo Finance.
Status: ✅ Fully working! The Yahoo Finance API integration has been fixed and tested.
Features
- Real-time Stock Data: Fetch current prices, volumes, market caps, and more
- Technical Indicators: Calculate RSI, MACD, Moving Averages (SMA/EMA), Bollinger Bands
- Smart Buy/Sell Signals: Automated analysis combining multiple indicators
- Daily Review: Comprehensive analysis of multiple stocks at once
- Stock Comparison: Side-by-side comparison of different stocks
- Default Tech Stocks: Pre-configured list of major tech stocks (AAPL, MSFT, GOOGL, etc.)
Technical Indicators Included
- RSI (Relative Strength Index): Identifies overbought/oversold conditions
- MACD: Shows momentum and trend direction
- Moving Averages: SMA 20, 50, 200 and EMA 12, 26
- Bollinger Bands: Volatility and price extremes
- 52-Week High/Low: Context for current price position
- Golden/Death Cross: Long-term trend indicators
Installation
Prerequisites
- Node.js 18 or higher
- Claude Desktop app
Setup
- Clone or navigate to this repository:
cd stock-mcp
- Install dependencies:
npm install
- Build the TypeScript code:
npm run build
Configure Claude Desktop
Add this server to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Add the following to your config:
{
"mcpServers": {
"stock-trading": {
"command": "node",
"args": [
"/Users/ade/Documents/github/stock-mcp/build/index.js"
]
}
}
}
Replace /Users/ade/Documents/github/stock-mcp with the actual path to this directory.
- Restart Claude Desktop
Available Tools
1. analyze_stock
Analyze a single stock with full technical analysis and buy/sell signals.
Parameters:
symbol(required): Stock ticker symbol (e.g., "AAPL", "MSFT")
Example usage in Claude:
Can you analyze AAPL stock for me?
2. daily_review
Run a comprehensive daily review of multiple stocks.
Parameters:
symbols(optional): Array of stock symbols. If not provided, uses default tech stocks.
Example usage in Claude:
Run a daily review of the default tech stocks
or
Run a daily review of AAPL, TSLA, and NVDA
3. get_stock_quote
Get current price and basic information for a stock.
Parameters:
symbol(required): Stock ticker symbol
Example usage in Claude:
What's the current price of MSFT?
4. compare_stocks
Compare multiple stocks side-by-side.
Parameters:
symbols(required): Array of stock symbols to compare
Example usage in Claude:
Compare AAPL, MSFT, and GOOGL
Default Tech Stocks
The server comes pre-configured with these major tech stocks:
- AAPL (Apple)
- MSFT (Microsoft)
- GOOGL (Google)
- AMZN (Amazon)
- META (Meta)
- NVDA (NVIDIA)
- TSLA (Tesla)
- AMD (AMD)
- NFLX (Netflix)
- INTC (Intel)
You can analyze any other stock by providing its ticker symbol.
Signal Interpretation
The analysis provides one of five signals:
- STRONG_BUY: Multiple bullish indicators aligned
- BUY: Moderately bullish indicators
- HOLD: Mixed or neutral indicators
- SELL: Moderately bearish indicators
- STRONG_SELL: Multiple bearish indicators aligned
Signal Criteria
The server analyzes:
- RSI levels (oversold < 30, overbought > 70)
- MACD momentum (bullish/bearish crossovers)
- Price vs Moving Averages (trend confirmation)
- Golden/Death Cross patterns (long-term trends)
- Bollinger Bands (volatility extremes)
- Distance from 52-week high/low
Example Conversations with Claude
Daily Morning Review:
Good morning! Can you run my daily stock review?
Specific Stock Analysis:
I'm thinking about buying Tesla. What do the technical indicators say?
Adding Custom Stocks:
Can you analyze these semiconductor stocks: NVDA, AMD, and INTC?
Quick Price Check:
What's Amazon trading at right now?
Development
Watch Mode
For development, you can run TypeScript in watch mode:
npm run watch
Rebuild
After making changes:
npm run build
Then restart Claude Desktop to pick up the changes.
Data Source
This server uses Yahoo Finance API via the yahoo-finance2 package. The data is free and doesn't require an API key, but usage should be respectful and in line with Yahoo's terms of service.
Technical Indicator Calculations
Technical indicators are calculated using the technicalindicators library with the following parameters:
- RSI: 14-period
- MACD: Fast 12, Slow 26, Signal 9
- SMA: 20, 50, and 200 periods
- EMA: 12 and 26 periods
- Bollinger Bands: 20-period, 2 standard deviations
Historical Data: The server fetches 1 year of historical data (~250 trading days) to ensure sufficient data points for all indicators, especially the 200-day moving average.
Limitations
- Requires at least 200 trading days of historical data for full analysis (automatically fetched)
- Data is delayed by a few minutes (not real-time tick data)
- Not financial advice - for informational purposes only
- Market hours: best data during trading hours (9:30 AM - 4:00 PM ET)
Troubleshooting
Server not appearing in Claude Desktop
- Check that the path in
claude_desktop_config.jsonis correct - Ensure you've run
npm run build - Check Claude Desktop logs for errors
- Restart Claude Desktop
"Insufficient data" errors
Some stocks (especially newer ones or those with low trading volume) may not have 200 days of historical data. Try a more established stock.
Rate limiting
If you get rate limit errors, wait a few minutes before trying again. The Yahoo Finance API has usage limits.
License
MIT
Disclaimer
This tool is for informational and educational purposes only. It does not constitute financial advice. Always do your own research and consult with a qualified financial advisor before making investment decisions. Past performance does not guarantee future results.