Skip to main content
Glama
Yahoo Finance MCP Server

Yahoo Finance MCP Server

Yahoo Finance MCP Server

An MCP (Model Context Protocol) server that provides access to Yahoo Finance data using the yfinance Python package. This server enables AI assistants to fetch real-time stock quotes, historical data, financial statements, analyst recommendations, earnings information, options chains, and news.

Built following MCP best practices with proper tool naming, response format options, character limits, and comprehensive error handling.

Features

This MCP server provides 10 comprehensive tools:

Stock Information

  • yfinance_get_stock_info: Get comprehensive stock information (price, market cap, PE ratio, sector, etc.)

  • yfinance_get_stock_history: Retrieve historical price data with customizable periods and intervals

  • yfinance_get_multiple_quotes: Get current quotes for multiple stocks simultaneously

  • yfinance_search_stocks: Search and validate stock tickers

Financial Analysis

  • yfinance_get_stock_financials: Access financial statements (income statement, balance sheet, cash flow)

  • yfinance_get_earnings_dates: Get earnings calendar with historical and upcoming dates, EPS estimates

  • yfinance_get_options_chain: Retrieve options data (calls/puts) with choice of expiration dates

Market Intelligence

  • yfinance_get_stock_recommendations: Get analyst recommendations and rating changes

  • yfinance_get_stock_news: Fetch recent news articles related to stocks

Key Features

  • ✅ Dual response formats: JSON (structured) and Markdown (human-readable)

  • ✅ Character limits: Automatic truncation at 25,000 characters with clear guidance

  • ✅ Tool annotations: All tools properly annotated with readOnlyHint and openWorldHint

  • ✅ Comprehensive error handling: Actionable error messages that guide next steps

  • ✅ MCP naming conventions: All tools prefixed with yfinance_ to prevent conflicts

Related MCP server: StockQuotes MCP

Installation

Prerequisites

  • Python 3.10 or higher

  • uv (Python package manager)

Setup

  1. Clone or navigate to this directory:

cd yfinance-mcp
  1. Install dependencies with uv:

uv sync

Configuration

To use this MCP server with Claude Desktop or other MCP clients, add it to your MCP settings configuration file.

Claude Code

First, install Claude Code:

npm install -g @anthropic-ai/claude-code

Use the following command to add the yfinance MCP server to your local environment. This assumes uvx is in your $PATH; if not, provide the full path to uvx.

claude mcp add yfinance -- uvx --from git+https://github.com/mobatmedia/yfinance-mcp yfinance-mcp

This command will install the MCP server in your current project. If you want to install it globally, run the command with -s user flag.

To start Claude Code, run claude in your terminal.

You can also run claude mcp add-from-claude-desktop if the MCP server is installed already for Claude Desktop.

Claude Desktop

  1. Follow the Claude Desktop MCP installation instructions to complete the initial installation and find your configuration file.

  2. Use the following example as reference to add the yfinance MCP server.

    • Find your path to uvx by running which uvx in your terminal.

    • Replace <your_home_directory> with your home directory path.

Configuration file locations:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Linux: ~/.config/Claude/claude_desktop_config.json

{
    "mcpServers": {
        "yfinance": {
            "command": "<path_to_your_uvx_install>/uvx",
            "args": [
                "--from",
                "git+https://github.com/mobatmedia/yfinance-mcp",
                "yfinance-mcp"
            ],
            "env": {
                "HOME": "<your_home_directory>"
            }
        }
    }
}

Transport Configuration

By default, STDIO transport is used.

To configure SSE or Streamable HTTP, set the MCP_TRANSPORT environment variable.

Example:

MCP_TRANSPORT=streamable-http uv run entrypoint.py

Usage

Running the Server Standalone

You can test the server by running it directly:

uv run yfinance-mcp

Example Queries (via Claude Desktop)

Once configured with Claude Desktop, you can ask questions like:

Stock Information:

  • "What's the current stock price of Apple?"

  • "Show me comprehensive info for TSLA in JSON format"

  • "Compare quotes for AAPL, MSFT, and GOOGL"

  • "What sector and industry is Microsoft in?" (uses fields parameter)

  • "Just show me the price and PE ratio for NVDA" (uses fields parameter)

  • "Get just the basic valuation metrics for AAPL" (uses fields parameter)

Historical Data:

  • "Show me Tesla's price history over the past 6 months"

  • "Get AAPL historical data for the past year with weekly intervals"

  • "Show me just the last week of trading data for GOOGL"

  • "What were the last 30 days of price data for MSFT?" (uses limit parameter)

  • "Give me a summary of AAPL's price performance over the last year" (uses summary parameter)

  • "What's the high, low, and average price for TSLA this year?" (uses summary parameter)

Financial Statements:

  • "Get Microsoft's income statement"

  • "Show me Apple's balance sheet in JSON format"

  • "What's Google's cash flow statement?"

  • "What's Tesla's total revenue for the most recent quarter?" (quarterly by default, uses fields and limit parameters)

  • "Show me just the revenue and net income for AAPL over the last 2 quarters" (uses fields and limit parameters)

  • "Get the key profitability metrics from MSFT's latest income statement" (uses fields and limit parameters)

  • "Show me AAPL's annual revenue for the past 3 years" (uses period='annual' parameter)

Earnings & Options:

  • "When is Apple's next earnings call?"

  • "Show me the earnings history for MSFT"

  • "What expiration dates does SPY have for options?" (uses fields=["expiration_dates"])

  • "What are the 3 closest option expiration dates around December 15 for AAPL?" (uses target_date="2024-12-15", limit=3, fields=["expiration_dates"])

  • "Show me options expiring around 30 days from now for SPY" (uses dte=30)

  • "Get 3 monthly expiration dates near 30 days out for TSLA" (uses dte=30, limit=3, fields=["expiration_dates"])

  • "Get the options chain for TSLA"

  • "Show me the SPY options chain for weekly expiration" (uses dte=7, shows actual option contracts)

  • "Get AAPL call options expiring in about 30 days" (uses dte=30, option_type="calls")

  • "Show me options for the 2 closest expirations around January 15" (uses target_date="2025-01-15", limit=2)

  • "Get highly liquid call options for SPY expiring next week" (uses dte=7, min_volume, min_open_interest)

  • "Show me protective put options for AAPL with monthly expiration" (uses dte=30, option_type="puts", in_the_money=True)

  • "What are the next 3 upcoming earnings dates for GOOGL?" (uses future_only and limit parameters)

  • "Show me just the last 4 earnings reports for NVDA" (uses limit parameter)

  • "When are the next earnings calls for TSLA?" (uses future_only parameter)

Market Intelligence:

  • "What are the latest analyst recommendations for Google?"

  • "Show me recent news about Amazon stock"

  • "Get the top 5 news articles for NVDA"

  • "What are the 5 most recent analyst ratings for AAPL?" (uses limit parameter)

  • "Show me the last 10 analyst recommendations for MSFT" (uses limit parameter)

Available Tools

1. yfinance_get_stock_info

Get comprehensive information about a stock.

Parameters:

  • ticker (string): Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'GOOGL')

  • fields (list of strings, optional): Specific fields to return. Available fields: name, price, currency, market_cap, pe_ratio, forward_pe, dividend_yield, 52_week_high, 52_week_low, avg_volume, sector, industry, description. Uses case-insensitive partial matching (default: None, returns all fields)

  • response_format (string, optional): 'json' or 'markdown' (default: 'markdown')

Returns:

  • Stock name, current price, market cap, PE ratios, dividend yield, 52-week high/low, sector, industry, description (all fields or filtered subset)

Example:

yfinance_get_stock_info("AAPL", "json")
yfinance_get_stock_info("TSLA", fields=["price", "market_cap", "pe_ratio"])
yfinance_get_stock_info("MSFT", fields=["sector", "industry"])

2. yfinance_get_stock_history

Get historical price data for a stock.

Parameters:

  • ticker (string): Stock ticker symbol

  • period (string, optional): Time period - 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max (default: '1mo')

  • interval (string, optional): Data interval - 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo (default: '1d')

  • limit (int, optional): Maximum number of most recent data points to return (default: None, returns all)

  • summary (bool, optional): If True, return summary statistics instead of all data points - includes high, low, avg close, total volume, start/end dates (default: False)

  • response_format (string, optional): 'json' or 'markdown' (default: 'markdown')

Returns:

  • Historical data with dates, open, high, low, close, and volume (or summary statistics if summary=True)

Example:

yfinance_get_stock_history("AAPL", "1y", "1d", "json")
yfinance_get_stock_history("AAPL", "1y", "1d", limit=30)  # Last 30 days only
yfinance_get_stock_history("AAPL", "1y", "1d", summary=True)  # Just summary

3. yfinance_get_stock_financials

Get financial statements for a stock.

Parameters:

  • ticker (string): Stock ticker symbol

  • statement_type (string, optional): 'income', 'balance', or 'cashflow' (default: 'income')

  • period (string, optional): 'quarterly' for quarterly reports, 'annual' for yearly reports (default: 'quarterly')

  • limit (int, optional): Maximum number of most recent periods to return (default: 4)

  • fields (list of strings, optional): Specific financial fields to return. Uses case-insensitive partial matching. Example fields: 'revenue', 'net income', 'total assets', 'cash', etc. (default: None, returns all fields)

  • response_format (string, optional): 'json' or 'markdown' (default: 'markdown')

Returns:

  • Financial statement data organized by date (quarterly or annual, all fields or filtered subset)

  • Note: Returns quarterly data by default. Most recent 4 quarters unless limit is changed.

Example:

yfinance_get_stock_financials("AAPL", "income", "json")
yfinance_get_stock_financials("AAPL", "income", period="quarterly", limit=2)  # Last 2 quarters
yfinance_get_stock_financials("AAPL", "income", period="annual", limit=3)  # Last 3 years
yfinance_get_stock_financials("AAPL", "income", fields=["revenue", "net income"])

4. yfinance_get_stock_recommendations

Get analyst recommendations for a stock.

Parameters:

  • ticker (string): Stock ticker symbol

  • limit (int, optional): Maximum number of most recent recommendations to return (default: 20)

  • response_format (string, optional): 'json' or 'markdown' (default: 'markdown')

Returns:

  • Analyst recommendations history with firm names, grades, and actions

Example:

yfinance_get_stock_recommendations("AAPL", "json")
yfinance_get_stock_recommendations("AAPL", limit=10)  # Last 10 recommendations only

5. yfinance_get_stock_news

Get recent news articles related to a stock.

Parameters:

  • ticker (string): Stock ticker symbol

  • limit (int, optional): Maximum number of news items (default: 10, max: 50)

  • response_format (string, optional): 'json' or 'markdown' (default: 'markdown')

Returns:

  • Recent news articles with title, publisher, link, and publication date

Example:

yfinance_get_stock_news("TSLA", 5, "markdown")

6. yfinance_get_multiple_quotes

Get current quotes for multiple stocks at once.

Parameters:

  • tickers (list of strings): List of stock ticker symbols (max 20)

  • response_format (string, optional): 'json' or 'markdown' (default: 'markdown')

Returns:

  • Current quotes for all requested tickers including price, change, and volume

Example:

yfinance_get_multiple_quotes(["AAPL", "MSFT", "GOOGL"], "json")

7. yfinance_search_stocks

Search for stocks by company name or ticker symbol.

Parameters:

  • query (string): Search query (company name or ticker)

  • response_format (string, optional): 'json' or 'markdown' (default: 'markdown')

Returns:

  • Stock information if found, including ticker, name, exchange, and type

Example:

yfinance_search_stocks("AAPL", "json")

8. yfinance_get_earnings_dates

Get earnings calendar information with historical and upcoming dates.

Parameters:

  • ticker (string): Stock ticker symbol

  • limit (int, optional): Maximum number of earnings dates to return (default: 12)

  • future_only (bool, optional): If True, return only future/upcoming earnings dates (default: False)

  • response_format (string, optional): 'json' or 'markdown' (default: 'markdown')

Returns:

  • Next earnings date

  • Historical earnings with EPS estimates, reported EPS, and surprise percentages (or future only if future_only=True)

Example:

yfinance_get_earnings_dates("AAPL", "json")
yfinance_get_earnings_dates("AAPL", limit=4)  # Last 4 earnings dates only
yfinance_get_earnings_dates("AAPL", future_only=True)  # Only upcoming earnings

9. yfinance_get_options_chain

Get options chain data (calls and/or puts) with advanced filtering capabilities.

Parameters:

  • ticker (string): Stock ticker symbol

  • expiration_date (string, optional): Expiration date in 'YYYY-MM-DD' format. If None, uses nearest expiration (default: None)

  • dte (int, optional): Days to expiration - finds expiration closest to N days out. Mutually exclusive with target_date (default: None)

  • target_date (string, optional): Target date in 'YYYY-MM-DD' format to find closest expiration(s) to. Mutually exclusive with dte (default: None)

  • limit (int, optional): Number of closest expirations to return (works with dte or target_date). 1=single closest, 2=two closest, 3+=N closest (default: 1)

  • option_type (string, optional): Type of options - 'calls', 'puts', or 'both' (default: 'calls')

  • strikes_near_price (int, optional): Number of strikes to show above and below current price. None = all strikes (default: 10)

  • in_the_money (boolean, optional): Filter by ITM status - True for ITM only, False for OTM only, None for all (default: None)

  • min_volume (int, optional): Minimum trading volume filter (default: None)

  • min_open_interest (int, optional): Minimum open interest filter (default: None)

  • strike_min (float, optional): Minimum strike price filter (default: None)

  • strike_max (float, optional): Maximum strike price filter (default: None)

  • fields (list of strings, optional): Which fields/data to return. Special values: ["expiration_dates"] or ["expirations"] returns only dates without contract data (default: None, returns full contract data)

  • summary (boolean, optional): If True, return aggregate statistics instead of individual contracts. Includes total volume/OI, strike ranges, avg IV, most active strikes, put/call ratios. Use for market analysis and activity overview (default: False)

  • response_format (string, optional): 'json' or 'markdown' (default: 'markdown')

Returns:

  • If fields=["expiration_dates"]: List of selected expiration dates (filtered by dte/target_date/limit if specified)

  • If summary=True: Aggregate statistics including total volume, open interest, strike ranges, average implied volatility, most active strikes, and put/call ratios

  • If limit=1: Single expiration with contract data (backward compatible format)

  • If limit>1: Array of expirations, each with contract data

  • Otherwise: Current stock price, filters applied, and for each option: contract symbol, strike, last price, bid, ask, change, percent change, volume, open interest, implied volatility, in the money status, last trade date, contract size, currency

Examples:

Getting Expiration Dates Only:

# Fast query: just get available expiration dates without contract data
yfinance_get_options_chain("SPY", fields=["expiration_dates"])

# Get 3 closest expirations to 30 days from now (dates only)
yfinance_get_options_chain("SPY", dte=30, limit=3, fields=["expiration_dates"])

# Get 2 closest expirations around December 15 (dates only)
yfinance_get_options_chain("AAPL", target_date="2024-12-15", limit=2, fields=["expiration_dates"])

Getting Aggregate Statistics (Summary):

# Get aggregate statistics for weekly options on SPY
yfinance_get_options_chain("SPY", dte=7, summary=True, option_type="both")
# Returns: total volume/OI for calls and puts, strike ranges, avg IV,
# most active strikes, put/call ratios (volume and OI)

# Check options activity for monthly AAPL options (calls only)
yfinance_get_options_chain("AAPL", dte=30, summary=True, option_type="calls")

# Analyze market sentiment for TSLA using put/call ratios
yfinance_get_options_chain("TSLA", dte=7, summary=True, option_type="both")
# Look at put/call ratios: >1 suggests bearish sentiment, <1 suggests bullish

# Compare activity across multiple expirations
yfinance_get_options_chain("SPY", dte=30, limit=3, summary=True, option_type="both")

Basic Usage:

# Quick check: calls near current price for nearest expiration
yfinance_get_options_chain("TSLA")

# Get nearest expiration, but show more strikes (20 above and below current price)
yfinance_get_options_chain("TSLA", strikes_near_price=20)

# See all available strikes for nearest expiration
yfinance_get_options_chain("AAPL", strikes_near_price=None)

Using DTE (Days to Expiration):

# Weekly options (~7 days out)
yfinance_get_options_chain("SPY", dte=7)

# Monthly options (~30 days out)
yfinance_get_options_chain("AAPL", dte=30)

# Quarterly options (~90 days out)
yfinance_get_options_chain("MSFT", dte=90)

# LEAPS (~365 days out, longer-term options)
yfinance_get_options_chain("GOOGL", dte=365)

Using Target Date and Multiple Expirations:

# Get options for expiration closest to December 15, 2024
yfinance_get_options_chain("AAPL", target_date="2024-12-15")

# Get 3 closest expirations around December 15 (full contract data for all 3)
yfinance_get_options_chain("AAPL", target_date="2024-12-15", limit=3)

# Get 3 monthly expirations around 30 days out
yfinance_get_options_chain("SPY", dte=30, limit=3)

# Get 2 closest expirations to 60 days out, calls and puts
yfinance_get_options_chain("TSLA", dte=60, limit=2, option_type="both")

Common Trading Scenarios:

# Near-the-money calls and puts (5 strikes each side) for 30-day expiration
yfinance_get_options_chain("NVDA", dte=30, option_type="both", strikes_near_price=5)

# Out-of-the-money calls only (above current price) for weekly expiration
yfinance_get_options_chain("TSLA", dte=7, in_the_money=False, strikes_near_price=10)

# In-the-money puts (protective puts) for monthly expiration
yfinance_get_options_chain("AAPL", dte=30, option_type="puts", in_the_money=True, strikes_near_price=10)

# Near-the-money calls with tight spread (very liquid only)
yfinance_get_options_chain("SPY", dte=7, strikes_near_price=5, min_volume=1000, min_open_interest=5000)

Filtering by Liquidity:

# Only show highly liquid calls (high volume and open interest)
yfinance_get_options_chain("SPY", min_volume=500, min_open_interest=1000)

# Active calls for weekly expiration
yfinance_get_options_chain("QQQ", dte=7, min_volume=100)

# Liquid monthly puts
yfinance_get_options_chain("AAPL", dte=30, option_type="puts", min_volume=50, min_open_interest=500)

Specific Date and Strike Range:

# Specific expiration date with strike range
yfinance_get_options_chain("AAPL", expiration_date="2024-12-20", strike_min=150, strike_max=200)

# Puts in specific range for earnings play
yfinance_get_options_chain("TSLA", expiration_date="2024-01-19", option_type="puts", strike_min=200, strike_max=250)

# Both calls and puts for specific date, near the money
yfinance_get_options_chain("MSFT", expiration_date="2024-12-20", option_type="both", strikes_near_price=8)

Filtering Tips:

  • Default changed to 'calls' to reduce response size and match common usage

  • Use strikes_near_price=10 (default) to get ~20 contracts centered around current price

  • Use strikes_near_price=None to see all available strikes (may hit character limit for large chains)

  • Use dte for more intuitive expiration selection (e.g., dte=30 for monthly options)

  • strikes_near_price and in_the_money work together:

    • strikes_near_price=10, in_the_money=False → 10 nearest OTM strikes

    • strikes_near_price=10, in_the_money=True → 10 nearest ITM strikes

    • strikes_near_price=5 → Very near-the-money options (5 ITM + 5 OTM)

  • Use min_volume and min_open_interest to filter for liquid options

  • Use strike_min and strike_max for custom price ranges (overrides strikes_near_price)

Query Interpretation Guidelines:

  • "Show me [ticker] options chain" → Use default parameters (calls, 10 strikes, nearest expiration)

  • "Show me weekly/monthly options" → Add dte=7 or dte=30 to specify expiration timeframe

  • "What options are available?" → Exploratory query; use option_type="both" to show calls and puts

  • "Get highly liquid options" → Add min_volume and min_open_interest filters

  • Don't add unsolicited filters unless the query specifically mentions liquidity, volume, or specific strikes


Response Formats

All tools support two response formats:

JSON Format (response_format="json")

  • Machine-readable structured data

  • Includes all available fields and metadata

  • Suitable for programmatic processing

  • Use when LLMs need to process data further

Markdown Format (response_format="markdown")

  • Human-readable formatted text

  • Uses headers, lists, and formatting for clarity

  • Converts timestamps to readable format

  • Default format for most queries

Data Limits and Truncation

  • Character limit: 25,000 characters per response

  • Automatic truncation: Responses exceeding the limit are truncated with a clear warning

  • Guidance provided: Truncation messages suggest using filters or pagination

  • Tool-specific limits:

    • News: Max 50 items

    • Multiple quotes: Max 20 tickers

Data Source

This server uses the yfinance Python library, which fetches data from Yahoo Finance. Please note:

  • Data is provided for informational purposes only

  • Real-time quotes may be delayed

  • Historical data availability varies by ticker and exchange

  • Yahoo Finance terms of service apply

Troubleshooting

Common Issues

  1. No data returned: Some tickers may not be available or may be delisted. Verify the ticker symbol is correct.

  2. Rate limiting: Yahoo Finance may rate-limit requests. If you encounter errors, try reducing the frequency of requests.

  3. Connection errors: Ensure you have an active internet connection and that Yahoo Finance is accessible.

  4. Truncated responses: If responses are truncated:

    • Use shorter time periods for historical data

    • Reduce limit for news queries

    • Use larger intervals for historical data (e.g., '1wk' instead of '1d')

  5. Options data not available: Not all stocks have options. Verify the ticker supports options trading.

Development

Running Locally

# Sync dependencies
uv sync

# Run the server
uv run yfinance-mcp
{
  "mcpServers": {
    "yfinance": {
      "command": "/your/path/.cargo/bin/uv",
      "args": [
        "run",
        "--with",
        "/your/path/yfinance-mcp",
        "yfinance-mcp"
      ],
      "env": {
        "HOME": "/Users/yourusername"
      }
    }
  }
}

Debugging

For debugging and testing, we recommend using the MCP Inspector:

npx @modelcontextprotocol/inspector uv --directory /path/to/yfinance-mcp run yfinance-mcp

This will launch a browser interface where you can interact with your MCP server directly and see input/output for each tool.

Code Formatting

This project uses Black for code formatting:

uv run black src/

Project Structure

yfinance-mcp/
├── src/
│   └── yfinance_mcp/
│       ├── __init__.py
│       └── server.py             # Main server implementation
├── entrypoint.py                 # Entry point for transport config
├── .python-version               # Python version specification
├── .gitignore
├── pyproject.toml                # Project configuration
└── README.md                     # This file

MCP Best Practices Implemented

This server follows official MCP best practices:

  1. ✅ Tool naming: All tools prefixed with yfinance_ to prevent conflicts

  2. ✅ Response formats: Dual format support (JSON and Markdown)

  3. ✅ Character limits: 25,000 character limit with truncation

  4. ✅ Tool annotations: All tools annotated with behavior hints

  5. ✅ Error handling: Actionable error messages with guidance

  6. ✅ Comprehensive documentation: Detailed docstrings and examples

  7. ✅ Type safety: Full type hints throughout

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

Project Status

This project is considered feature-complete at version 0.1.0. There is no active roadmap for additional features. Bug fixes and compatibility updates may be accepted, but no major new functionality is planned.

Disclaimer

This software is for informational purposes only. It is not financial advice. The authors and contributors are not responsible for any financial decisions made based on data provided by this tool.

Available Tools

9 tools
yfinance_get_earnings_datesA
Read-only

Get earnings calendar information including historical and upcoming earnings dates with estimates.

Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'GOOGL') limit: Maximum number of earnings dates to return (default: 12) future_only: If True, return only upcoming earnings dates (default: False) response_format: Output format - 'json' or 'markdown' (default: 'markdown')

Returns: Formatted string containing earnings information including: - Earnings dates (historical and/or upcoming) - EPS estimates - Reported EPS (for historical dates) - Surprise percentage (actual vs estimate)

Example: yfinance_get_earnings_dates("AAPL", "json") yfinance_get_earnings_dates("AAPL", limit=4) # Last 4 quarters yfinance_get_earnings_dates("AAPL", future_only=True) # Only upcoming

Inputs: ticker (required), limit, future_only, response_format. Returns: result

yfinance_get_multiple_quotesA
Read-only

Get current quotes for multiple stocks at once in a single request.

Args: tickers: List of stock ticker symbols (e.g., ['AAPL', 'MSFT', 'GOOGL']) response_format: Output format - 'json' or 'markdown' (default: 'markdown')

Returns: Formatted string containing current quotes for all requested tickers including: - Company name - Current price - Currency - Price change and percent change - Trading volume

Example: yfinance_get_multiple_quotes(["AAPL", "MSFT", "GOOGL"], "json")

Inputs: tickers (required), response_format. Returns: result

yfinance_get_options_chainA
Read-only

Get options chain data for a stock. Returns call options near current price for the nearest expiration by default.

Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'GOOGL') expiration_date: Optional expiration date in 'YYYY-MM-DD' format (default: nearest) dte: Optional days to expiration - USE THIS for time-based queries: - 7 for "weekly options" - 30 for "monthly options" - 90 for "quarterly options" - 365 for "LEAPS" or "long-term options" MUTUALLY EXCLUSIVE with target_date - cannot use both (default: None, uses nearest expiration) target_date: Optional target date in 'YYYY-MM-DD' format to find closest expiration(s). USE THIS when query mentions a specific date like "around Dec 15" or "near January" MUTUALLY EXCLUSIVE with dte - cannot use both (default: None) limit: Number of closest expirations to return (works with dte or target_date). - 1 = single closest expiration (default) - 2 = two closest (one before, one after if possible) - 3+ = N closest expirations around the target EFFICIENCY: Always use limit parameter to get multiple expirations in ONE call, rather than making multiple separate calls with different dte values. (default: 1) option_type: 'calls', 'puts', or 'both' - Use 'both' when query mentions "what's available" or exploratory requests - Default: 'calls' strikes_near_price: Number of strikes above/below current price, or None for all (default: 10) in_the_money: True for ITM, False for OTM, None for both (default: None) min_volume: Minimum volume filter - ONLY use if query mentions "liquid" or "active" (default: None) min_open_interest: Minimum open interest filter - ONLY use if query mentions "liquid" or "active" (default: None) strike_min: Minimum strike price (default: None) strike_max: Maximum strike price (default: None) fields: Which fields/data to return. Special values: - ["expiration_dates"] or ["expirations"] = return only dates without contract data - None (default) = return full contract data Use for queries like "what expiration dates does [ticker] have?" summary: If True, return aggregate statistics instead of individual contracts. Returns: total volume, open interest, strike ranges, avg IV, most active strikes, put/call ratios. Use this for queries asking for "summary", "activity", "overview", or "sentiment" - NOT for queries asking for specific contracts/strikes. Works seamlessly with limit parameter to analyze multiple expirations. (default: False) response_format: 'json' or 'markdown' (default: 'markdown')

Query interpretation: - "weekly options" → dte=7 - "monthly options" → dte=30 - "around Dec 15" or "near December 20" → target_date="2024-12-15", target_date="2024-12-20" - "3 expirations around..." → limit=3 with dte or target_date - For multiple time periods (weekly, monthly, quarterly): Use dte with limit, NOT separate calls Example: "compare weekly, monthly, quarterly" → dte=30, limit=3 (gets ~weekly, ~monthly, ~next monthly in ONE call) - "what options are available" → option_type="both" - "what expiration dates" or "what dates are available" → fields=["expiration_dates"] - "activity summary", "options activity", "market sentiment", or any query with "summary" → summary=True - "liquid/active options" (without "summary") → add min_volume and min_open_interest (NOT summary=True) - Don't add filters unless specifically requested

Returns: Options chain data with contract details, prices, volume, open interest, and implied volatility. If fields=["expiration_dates"], returns only the list of expiration dates. If summary=True, returns aggregate statistics for market analysis. If limit > 1, returns data for multiple expirations.

Examples: yfinance_get_options_chain("SPY", fields=["expiration_dates"]) # Just get available expiration dates yfinance_get_options_chain("SPY", dte=7) # Weekly options (closest to 7 days) yfinance_get_options_chain("SPY", dte=7, summary=True) # Weekly options activity summary yfinance_get_options_chain("SPY", dte=30, limit=3) # Get 3 expirations around 30 days (detailed contracts) yfinance_get_options_chain("TSLA", dte=30, limit=3, summary=True, option_type="both") # Compare activity across 3 expirations yfinance_get_options_chain("AAPL", dte=30, limit=3, fields=["expiration_dates"]) # Get 3 expiration dates around 30 days yfinance_get_options_chain("AAPL", target_date="2024-12-15", limit=2) # 2 closest expirations to Dec 15 (detailed) yfinance_get_options_chain("TSLA", dte=7, min_volume=1000) # Liquid weekly options

Inputs: ticker (required), dte, limit, fields, +11 more. Returns: result

yfinance_get_stock_financialsA
Read-only

Get financial statements for a stock (income statement, balance sheet, or cash flow statement).

Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'GOOGL') statement_type: Type of financial statement - 'income', 'balance', or 'cashflow' (default: 'income') period: Period type - 'quarterly' for quarterly reports, 'annual' for yearly reports (default: 'quarterly') limit: Maximum number of periods to return (default: 4) fields: List of specific line items to include. If None, returns all fields (default: None) response_format: Output format - 'json' or 'markdown' (default: 'markdown')

Returns: Formatted string containing the requested financial statement organized by date. Returns quarterly data by default (most recent 4 quarters). Use period='annual' to get annual/yearly financial statements instead. When fields is specified, only those line items are included.

Example: yfinance_get_stock_financials("AAPL", "income", "json") yfinance_get_stock_financials("AAPL", "income", period="annual", limit=3) # Last 3 years yfinance_get_stock_financials("AAPL", "income", limit=2, fields=["Total Revenue", "Net Income"])

Inputs: ticker (required), limit, fields, period, +2 more. Returns: result

yfinance_get_stock_historyA
Read-only

Get historical price data for a stock with customizable time period and interval.

Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'GOOGL') period: Time period - valid values: 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max (default: '1mo') interval: Data interval - valid values: 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo (default: '1d') limit: Maximum number of most recent data points to return (default: None, returns all) summary: If True, return summary statistics instead of all data points (default: False) response_format: Output format - 'json' or 'markdown' (default: 'markdown')

Returns: Formatted string with historical price data or summary statistics. When summary=True, returns: high, low, avg close, total volume, start/end dates. When limit is set, returns only the N most recent data points.

Example: yfinance_get_stock_history("AAPL", "1y", "1d", "json") yfinance_get_stock_history("AAPL", "1y", "1d", limit=30) # Last 30 days yfinance_get_stock_history("AAPL", "1y", "1d", summary=True) # Just summary

Inputs: ticker (required), limit, period, summary, +2 more. Returns: result

yfinance_get_stock_infoA
Read-only

Get comprehensive information about a stock including price, market cap, ratios, and company details.

Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'GOOGL') fields: Optional list of field names to include (case-insensitive partial matching). Available fields: name, price, currency, market_cap, pe_ratio, forward_pe, dividend_yield, 52_week_high, 52_week_low, avg_volume, sector, industry, description (default: None, returns all fields) response_format: Output format - 'json' for structured data, 'markdown' for human-readable (default: 'markdown')

Returns: Formatted string containing stock information including: - Current price and currency - Market capitalization - PE ratios (trailing and forward) - Dividend yield - 52-week high/low - Average volume - Sector and industry - Company description

Example: yfinance_get_stock_info("AAPL", "json") yfinance_get_stock_info("TSLA", ["price", "market_cap", "pe_ratio"], "markdown") yfinance_get_stock_info("MSFT", fields=["sector", "industry"])

Inputs: ticker (required), fields, response_format. Returns: result

yfinance_get_stock_newsA
Read-only

Get recent news articles related to a stock.

Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'GOOGL') limit: Maximum number of news items to return (default: 10, max: 50) response_format: Output format - 'json' or 'markdown' (default: 'markdown')

Returns: Formatted string containing recent news articles with: - Article title - Article description/summary - Publisher name - Publication date and time - Article link - Content type - Thumbnail image URL

Example: yfinance_get_stock_news("TSLA", 5, "markdown")

Inputs: ticker (required), limit, response_format. Returns: result

yfinance_get_stock_recommendationsA
Read-only

Get analyst recommendations and rating changes for a stock.

Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'GOOGL') limit: Maximum number of most recent recommendations to return (default: 20) response_format: Output format - 'json' or 'markdown' (default: 'markdown')

Returns: Formatted string containing analyst recommendations history including: - Date of recommendation - Firm name - Rating change (to grade, from grade) - Action taken

Example: yfinance_get_stock_recommendations("AAPL", "json") yfinance_get_stock_recommendations("AAPL", limit=10) # Only 10 most recent

Inputs: ticker (required), limit, response_format. Returns: result

yfinance_search_stocksA
Read-only

Search for stocks by company name or ticker symbol to verify ticker validity.

Args: query: Search query (company name or ticker symbol) response_format: Output format - 'json' or 'markdown' (default: 'markdown')

Returns: Formatted string containing search results with: - Whether stock was found - Ticker symbol - Company name - Exchange - Security type

Example: yfinance_search_stocks("AAPL", "json") yfinance_search_stocks("Apple", "markdown")

Note: yfinance has limited search capabilities. This tool validates if a ticker exists.

Inputs: query (required), response_format. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 9 tools

    Disambiguation4/5

    Each tool maps to a distinct data product (quotes, profile, history, financials, recommendations, news, search, earnings, options), so misselection is unlikely. The only mild overlap is current price data appearing in both yfinance_get_multiple_quotes and yfinance_get_stock_info, but the multi-ticker vs single-ticker comprehensive profile distinction is clear enough.

    Naming Consistency5/5

    All nine tools follow a uniform `yfinance_verb_noun` snake_case pattern (get_stock_info, get_stock_history, search_stocks, etc.). The shared prefix and consistent verb choice make the set highly predictable.

    Tool Count5/5

    Nine tools is well within the sweet spot and each one covers a genuinely different facet of equity research. No tool feels redundant or like a thin wrapper that could be folded into another.

    Completeness4/5

    Coverage is broad for the stated domain: quotes, fundamentals, statements, analyst ratings, news, search, earnings calendar, and options. Minor gaps exist for dividends/splits, institutional holders, and market-wide movers/trending, but core agent workflows are fully supported.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides comprehensive financial data from Yahoo Finance, enabling retrieval of stock prices, company information, financial statements, options data, analyst recommendations, and market news through natural language queries.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides real-time stock quotes, historical data, and stock search via Yahoo Finance, enabling AI assistants to access and analyze financial market data.
      24 npm
      19
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to perform live stock and portfolio research using Yahoo Finance data, including quotes, fundamentals, price history, news, portfolio analysis, and ticker comparisons.
      -