MCP ExplorerExplorer

Mcp Yahoo Finance

@philwegdataon 10 months ago
2 MIT
FreeCommunity
AI Systems
MCP_yahoo_finance provides detailed stock data and financial KPIs from Yahoo Finance.

Overview

What is Mcp Yahoo Finance

MCP_yahoo_finance is a Model Context Protocol (MCP) server that provides comprehensive stock market data and financial KPIs sourced from Yahoo Finance, enabling users to perform detailed financial analysis using the yfinance library.

Use cases

Use cases for MCP_yahoo_finance include evaluating company performance, conducting market research, analyzing investment opportunities, and providing insights for financial decision-making.

How to use

To use MCP_yahoo_finance, clone the repository from GitHub, install the required dependencies using pip, and set up the MCP server by following the installation instructions provided in the README.

Key features

Key features of MCP_yahoo_finance include company information, valuation metrics, profitability analysis, growth metrics, financial health indicators, dividend and returns data, trading data, and analyst data.

Where to use

MCP_yahoo_finance can be used in various fields such as finance, investment analysis, stock trading, and academic research, where detailed financial data and analysis are required.

Content

Yahoo Finance MCP Server 📈

A Model Context Protocol (MCP) server that provides detailed stock market data and financial KPIs from Yahoo Finance. This server offers financial analysis capabilities through the amazing yfinance library!

Features

🏢 Company Information

  • Company overview, sector, industry details
  • Business summaries and key company metrics
  • Employee count and geographic information

💰 Valuation Metrics

  • Market capitalization and enterprise value
  • Price ratios (P/E, P/B, P/S, PEG)
  • Enterprise ratios (EV/Revenue, EV/EBITDA)

📈 Profitability Analysis

  • Revenue and earnings metrics
  • Profit margins (gross, operating, net, EBITDA)
  • Return metrics (ROE, ROA)
  • Per-share calculations (EPS, revenue per share)

🚀 Growth Metrics

  • Historical growth rates (revenue, earnings)
  • Quarterly growth analysis
  • Future growth estimates

💎 Financial Health

  • Liquidity ratios (current, quick)
  • Debt analysis (debt-to-equity, total debt)
  • Cash flow metrics
  • Working capital analysis

💸 Dividend & Returns

  • Dividend yield and payout ratios
  • Share buyback information
  • Shareholder return metrics

📊 Trading Data

  • Current price and trading ranges
  • Volume analysis
  • Technical indicators (Beta, moving averages)
  • 52-week highs and lows

🎯 Analyst Data

  • Price targets and recommendations
  • Analyst consensus data
  • Earnings estimates

Installation

Prerequisites

  • Python 3.8+
  • MCP-compatible client (Claude Desktop, etc.)

Setup

  1. Clone the repository:

    git clone https://github.com/yourusername/enhanced-finance-mcp-server.git
    cd enhanced-finance-mcp-server
    
  2. Install dependencies:

    pip install yfinance mcp
    
  3. Install the MCP server:

    mcp install MCP_finance_agent.py
    

Configuration for Claude Desktop

Add the following to your Claude Desktop MCP configuration file:

Windows: %APPDATA%/Claude/claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "enhanced-finance": {
      "command": "python",
      "args": [
        "path/to/your/MCP_finance_agent.py"
      ]
    }
  }
}

Available Functions

Function Description
get_market_cap(ticker) Get market capitalization for a stock
get_company_overview(ticker) Company basic information and business summary
get_valuation_metrics(ticker) All valuation ratios and multiples
get_financial_health(ticker) Balance sheet and liquidity metrics
get_profitability_metrics(ticker) Profitability and efficiency ratios
get_growth_metrics(ticker) Growth rates and estimates
get_dividend_metrics(ticker) Dividend and shareholder return data
get_trading_metrics(ticker) Price and volume data
get_analyst_data(ticker) Analyst recommendations and targets
get_complete_stock_analysis(ticker) Comprehensive analysis with all KPIs
list_available_kpis() List all available metrics and functions

Usage Examples

Basic Market Cap Query

What's the market cap of Apple?

Uses: get_market_cap("AAPL")

Company Analysis

Give me an overview of Microsoft's business

Uses: get_company_overview("MSFT")

Valuation Analysis

What are Tesla's valuation metrics?

Uses: get_valuation_metrics("TSLA")

Comprehensive Analysis

Provide a complete financial analysis of Google

Uses: get_complete_stock_analysis("GOOGL")

Compare Multiple Stocks

Compare the profitability metrics of Apple, Microsoft, and Google

Uses: Multiple get_profitability_metrics() calls

Supported Stock Symbols

The server works with any valid stock ticker symbol available on Yahoo Finance, including:

  • US Stocks: AAPL, MSFT, GOOGL, TSLA, AMZN, etc.
  • International Stocks: Use appropriate suffixes (e.g., SAP.DE for German stocks)
  • ETFs: SPY, QQQ, VTI, etc.
  • Indices: ^GSPC (S&P 500), ^IXIC (NASDAQ), etc.

Output Format

All functions return well-formatted text with:

  • Clear section headers and visual separators
  • Properly formatted numbers (currency, percentages)
  • Organized categorical data
  • Error handling for missing data

Example output:

Valuation Metrics for AAPL:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Market Cap: $2,876,542,000,000.00
Enterprise Value: $2,865,234,000,000.00

Price Ratios:
  • P/E Ratio (TTM): 28.45
  • Forward P/E: 24.12
  • P/B Ratio: 45.23
  ...

Error Handling

The server includes robust error handling for:

  • Invalid ticker symbols
  • Missing data points
  • API connectivity issues
  • Malformed requests

Dependencies

  • yfinance: Yahoo Finance access
  • mcp: Model Context Protocol framework
  • logging: Built-in Python logging

Disclaimer

This tool is for informational purposes only and should not be considered as financial advice. Always consult with qualified financial professionals before making investment decisions.

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers