Skip to main content
Glama

Yahoo Finance MCP Server

by leo-ye0
  • Apple

Yahoo Finance MCP Server

A comprehensive financial data analysis server built with the Model Context Protocol (MCP), providing extensive Yahoo Finance data through a clean and efficient interface. This server offers real-time market data, portfolio management, and economic indicators.

🚀 Features

Stock & Crypto Information

  • Real-time price data
  • Historical prices with customizable intervals
  • Market capitalization
  • Trading volume
  • 52-week highs and lows
  • Sector and industry classification (stocks)
  • Cryptocurrency support (BTC-USD, ETH-USD, etc.)

Market Data

  • Stock news and updates
  • Analyst recommendations
  • Options data and chains
  • Stock actions (dividends, splits)

Economic Indicators

  • Major Indices
    • S&P 500
    • Dow Jones
    • NASDAQ
    • Russell 2000
  • Market Metrics
    • Treasury Yields (2Y, 5Y, 10Y, 30Y)
    • Volatility Indices (VIX, VXN)
    • Commodities (Gold, Oil, Silver)
    • Forex Rates (EUR/USD, GBP/USD, USD/JPY)

🛠️ Installation

  1. Ensure you have Python 3.11.5 or later installed
  2. Clone the repository:
git clone https://github.com/leo-ye0/yahoo-finance-mcp.git cd yahoo-finance-mcp
  1. Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows, use: .venv\Scripts\activate
  1. Install the package and dependencies:
pip install -e .

🚀 Usage

Starting the Server

python src/yahoo_finance_mcp/server.py

Example Usage

# Get stock/crypto information await get_stock_info("AAPL") # For stocks await get_stock_info("BTC-USD") # For cryptocurrencies # Portfolio Analysis await analyze_portfolio( symbols=["AAPL", "MSFT", "GOOGL"], weights=[0.4, 0.3, 0.3] ) # Get economic indicators await get_economic_indicators() # Get comprehensive market data # Get market summary await get_market_summary() # Quick overview of major indices

📊 Available Tools

Tool NameDescription
get_stock_infoGet comprehensive stock/crypto information
get_historical_pricesGet historical price data with customizable periods
get_financial_statementsGet income statement, balance sheet, and cash flow data
get_stock_newsGet latest news articles for a stock
get_analyst_recommendationsGet analyst recommendations and recent changes
get_options_dataGet options data including calls and puts
compare_stocksCompare multiple stocks across various metrics
get_market_summaryGet quick overview of major market indices
get_holder_infoGet information about major holders, institutional investors, and insider trades
get_earnings_infoGet earnings dates, estimates, history, and trends
get_dividend_infoGet dividend rates, yield, history, and next payment date
get_balance_sheet_analysisGet detailed balance sheet analysis with key ratios and trends
get_cash_flow_analysisGet comprehensive cash flow analysis and metrics
get_financial_ratiosGet key financial ratios across multiple categories

🔧 Dependencies

  • Python >=3.11.5
  • yfinance >=0.2.18
  • pandas >=1.5.0
  • numpy >=1.21.0
  • pydantic >=2.0.0
  • fastmcp >=2.10.5
  • mcp >=0.1.0

🤖 Claude Integration

Setup with Claude Desktop

  1. Open Claude's config:
# On MacOS code ~/Library/Application\ Support/Claude/claude_desktop_config.json
  1. Add this to your config:
{ "mcpServers": { "yfinance": { "command": "uv path like /Users/xxxxx/anaconda3/bin/uv", "args": [ "--directory", "PATH/TO/FOLDER/yahoo-finance-mcp", "run", "server.py" ] } } }

Example Prompts

Once connected, you can ask Claude things like:

  • "What's the current price and info for AAPL?"
  • "Get historical prices for MSFT over the last 6 months"
  • "Show me the latest financial statements for GOOGL"
  • "What's the latest news about NVDA?"
  • "Get analyst recommendations for AMZN"
  • "Show me options data for TSLA"
  • "Compare the market cap and PE ratios of AAPL, MSFT, and GOOGL"
  • "What's the current market summary for major indices?"
  • "Who are the major institutional holders of AAPL?"
  • "Show me recent insider transactions for MSFT"
  • "When is the next earnings date for AAPL?"
  • "What's the dividend history and yield for MSFT?"
  • "Analyze AAPL's balance sheet metrics and trends"
  • "Show me GOOGL's cash flow analysis"
  • "What are the key financial ratios for NVDA?"

Example Outputs

Ask for permission:
When is the next earnings date for Amazon(permission)? What Claude returns:
When is the next earnings date for Amazon? Who are the major institutional holders of AAPL?

Show me GOOGL's cash flow analysis

-
security - not tested
F
license - not found
-
quality - not tested

A comprehensive financial data analysis server providing Yahoo Finance data for stocks, cryptocurrencies, technical analysis, portfolio management, and economic indicators through a clean interface.

  1. 🚀 Features
    1. Stock & Crypto Information
    2. Market Data
    3. Economic Indicators
  2. 🛠️ Installation
    1. 🚀 Usage
      1. Starting the Server
      2. Example Usage
    2. 📊 Available Tools
      1. 🔧 Dependencies
        1. 🤖 Claude Integration
          1. Setup with Claude Desktop
          2. Example Prompts
          3. Example Outputs

        Related MCP Servers

        • -
          security
          A
          license
          -
          quality
          A Model Context Protocol server providing real-time stock data and options analysis through Yahoo Finance, enabling LLMs to access market data, analyze stocks, and evaluate options strategies.
          Last updated -
          20
          Python
          MIT License
        • -
          security
          A
          license
          -
          quality
          Provides real-time financial data from Yahoo Finance to Large Language Models through the Model Context Protocol, enabling AI models to access stock prices, historical data, and company information.
          Last updated -
          Python
          MIT License
        • A
          security
          A
          license
          A
          quality
          A Model Context Protocol server providing comprehensive financial data from Yahoo Finance, allowing users to retrieve detailed stock information, financial statements, options data, and market news.
          Last updated -
          34
          Python
          MIT License
          • Apple

        View all related MCP servers

        MCP directory API

        We provide all the information about MCP servers via our MCP API.

        curl -X GET 'https://glama.ai/api/mcp/v1/servers/leo-ye0/mcp-finance-data'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server