Skip to main content
Glama
Yahoo Finance MCP Server

Yahoo Finance MCP Server

by laxmimerit

Yahoo Finance MCP Server

A Model Context Protocol (MCP) server that provides access to Yahoo Finance data. This server enables AI assistants to fetch real-time stock prices, financial statements, news, options data, and more through a standardized interface.

PIP: https://pypi.org/project/yahoo-finance-mcp-server/

Features

  • Historical Stock Prices: Get historical price data with customizable periods and intervals

  • Stock Information: Access comprehensive stock data including financials, metrics, and company info

  • Financial Statements: Retrieve income statements, balance sheets, and cash flow statements

  • News: Fetch latest news articles for any ticker

  • Options Data: Get option chains, expiration dates, and options analytics

  • Holder Information: Access institutional, mutual fund, and insider holder data

  • Analyst Recommendations: Get analyst ratings, upgrades, and downgrades

  • Corporate Actions: Track dividends and stock splits

Related MCP server: Finance MCP Server

Installation

The easiest way to use this MCP server is with uvx, which runs it directly without installation:

uvx yahoo-finance-mcp-server

Using uv

Install the package using uv:

uv pip install yahoo-finance-mcp-server

Using pip

pip install yahoo-finance-mcp-server

From Source

git clone https://github.com/laxmimerit/yahoo-finance-mcp-server.git
cd yahoo-finance-mcp-server
uv pip install -e .

Configuration

Claude Desktop Configuration

Add this to your Claude Desktop configuration file:

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

{
  "mcpServers": {
    "yahoo-finance": {
      "command": "uvx",
      "args": ["yahoo-finance-mcp-server"]
    }
  }
}

Using uv:

{
  "mcpServers": {
    "yahoo-finance": {
      "command": "uv",
      "args": ["run", "yahoo-finance-mcp-server"]
    }
  }
}

Using Python directly:

{
  "mcpServers": {
    "yahoo-finance": {
      "command": "python",
      "args": ["-m", "yahoo_finance_mcp_server.server"]
    }
  }
}

Other MCP Clients

For other MCP clients that support stdio transport, you can run:

yahoo-finance-mcp-server

Or with uvx:

uvx yahoo-finance-mcp-server

Available Tools

1. get_historical_stock_prices

Get historical stock prices for a ticker symbol.

Parameters:

  • ticker (str): Stock ticker symbol (e.g., "AAPL")

  • period (str, optional): Valid periods: 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max. Default: "1mo"

  • interval (str, optional): Valid intervals: 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo. Default: "1d"

Example:

Get historical prices for Apple stock over the last year

2. get_stock_info

Get comprehensive stock information including price, company details, financial metrics, and more.

Parameters:

  • ticker (str): Stock ticker symbol (e.g., "TSLA")

Example:

Get detailed information about Tesla stock

3. get_yahoo_finance_news

Get latest news articles for a ticker symbol.

Parameters:

  • ticker (str): Stock ticker symbol (e.g., "GOOGL")

Example:

Get recent news about Google

4. get_stock_actions

Get dividend and stock split history.

Parameters:

  • ticker (str): Stock ticker symbol (e.g., "MSFT")

Example:

Get dividend history for Microsoft

5. get_financial_statement

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

Parameters:

  • ticker (str): Stock ticker symbol (e.g., "AMZN")

  • financial_type (str): One of: income_stmt, quarterly_income_stmt, balance_sheet, quarterly_balance_sheet, cashflow, quarterly_cashflow

Example:

Get Amazon's quarterly income statement

6. get_holder_info

Get holder and ownership information.

Parameters:

  • ticker (str): Stock ticker symbol (e.g., "NVDA")

  • holder_type (str): One of: major_holders, institutional_holders, mutualfund_holders, insider_transactions, insider_purchases, insider_roster_holders

Example:

Get institutional holders of NVIDIA

7. get_option_expiration_dates

Get available options expiration dates for a ticker.

Parameters:

  • ticker (str): Stock ticker symbol (e.g., "SPY")

Example:

Get option expiration dates for SPY

8. get_option_chain

Get option chain data for calls or puts.

Parameters:

  • ticker (str): Stock ticker symbol (e.g., "AAPL")

  • expiration_date (str): Expiration date in YYYY-MM-DD format

  • option_type (str): Either "calls" or "puts"

Example:

Get Apple call options expiring on 2024-12-20

9. get_recommendations

Get analyst recommendations and upgrades/downgrades.

Parameters:

  • ticker (str): Stock ticker symbol (e.g., "META")

  • recommendation_type (str): Either "recommendations" or "upgrades_downgrades"

  • months_back (int, optional): Number of months to look back. Default: 12

Example:

Get recent analyst upgrades for Meta

Usage Examples

Once configured with Claude Desktop or another MCP client, you can ask questions like:

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

  • "Show me Tesla's quarterly revenue for the last year"

  • "Get the latest news about Microsoft"

  • "What are the dividend payments for Coca-Cola?"

  • "Show me the institutional holders of NVIDIA"

  • "Get Amazon's balance sheet"

  • "What options are available for SPY?"

  • "Show me recent analyst upgrades for Google"

Development

Setup Development Environment

# Clone the repository
git clone https://github.com/laxmimerit/yahoo-finance-mcp-server.git
cd yahoo-finance-mcp-server

# Install with development dependencies
uv pip install -e ".[dev]"

Running Tests

pytest

Code Formatting

black src/
ruff check src/

Technical Details

  • Protocol: Model Context Protocol (MCP)

  • Transport: stdio

  • Data Source: Yahoo Finance via yfinance library

  • Response Format: JSON

Requirements

  • Python 3.10 or higher

  • Dependencies:

    • fastmcp >= 0.3.0

    • yfinance >= 0.2.40

    • pandas >= 2.0.0

Limitations

  • Data is provided by Yahoo Finance and subject to their terms of service

  • Real-time data may have delays depending on your subscription level

  • Some data may not be available for all ticker symbols

  • Intraday data is limited to the last 60 days

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

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

Disclaimer

This software is for informational purposes only. It should not be considered financial advice. Always do your own research before making investment decisions.

Support

If you encounter any issues or have questions:

Acknowledgments

Available Tools

9 tools
get_financial_statementA

Get financial statement for a given ticker symbol from yahoo finance. You can choose from the following financial statement types: income_stmt, quarterly_income_stmt, balance_sheet, quarterly_balance_sheet, cashflow, quarterly_cashflow.

Args: ticker: str The ticker symbol of the stock to get financial statement for, e.g. "AAPL" financial_type: str The type of financial statement to get. You can choose from the following financial statement types: income_stmt, quarterly_income_stmt, balance_sheet, quarterly_balance_sheet, cashflow, quarterly_cashflow.

Inputs: ticker (required), financial_type (required). Returns: result

get_historical_stock_pricesA

Get historical stock prices for a given ticker symbol from yahoo finance. Include the following information: Date, Open, High, Low, Close, Volume, Adj Close. Args: ticker: str The ticker symbol of the stock to get historical prices for, e.g. "AAPL" period : str Valid periods: 1d,5d,1mo,3mo,6mo,1y,2y,5y,10y,ytd,max Either Use period parameter or use start and end Default is "1mo" interval : str Valid intervals: 1m,2m,5m,15m,30m,60m,90m,1h,1d,5d,1wk,1mo,3mo Intraday data cannot extend last 60 days Default is "1d"

Inputs: ticker (required), period, interval. Returns: result

get_holder_infoA

Get holder information for a given ticker symbol from yahoo finance. You can choose from the following holder types: major_holders, institutional_holders, mutualfund_holders, insider_transactions, insider_purchases, insider_roster_holders.

Args: ticker: str The ticker symbol of the stock to get holder information for, e.g. "AAPL" holder_type: str The type of holder information to get. You can choose from the following holder types: major_holders, institutional_holders, mutualfund_holders, insider_transactions, insider_purchases, insider_roster_holders.

Inputs: ticker (required), holder_type (required). Returns: result

get_option_chainA

Fetch the option chain for a given ticker symbol, expiration date, and option type.

Args: ticker: str The ticker symbol of the stock to get option chain for, e.g. "AAPL" expiration_date: str The expiration date for the options chain (format: 'YYYY-MM-DD') option_type: str The type of option to fetch ('calls' or 'puts')

Inputs: ticker (required), option_type (required), expiration_date (required). Returns: result

get_option_expiration_datesA

Fetch the available options expiration dates for a given ticker symbol.

Args: ticker: str The ticker symbol of the stock to get option expiration dates for, e.g. "AAPL"

Inputs: ticker (required). Returns: result

get_recommendationsA

Get recommendations or upgrades/downgrades for a given ticker symbol from yahoo finance. You can also specify the number of months back to get upgrades/downgrades for, default is 12.

Args: ticker: str The ticker symbol of the stock to get recommendations for, e.g. "AAPL" recommendation_type: str The type of recommendation to get. You can choose from the following recommendation types: recommendations, upgrades_downgrades. months_back: int The number of months back to get upgrades/downgrades for, default is 12.

Inputs: ticker (required), recommendation_type (required), months_back. Returns: result

get_stock_actionsA

Get stock dividends and stock splits for a given ticker symbol from yahoo finance.

Args: ticker: str The ticker symbol of the stock to get stock actions for, e.g. "AAPL"

Inputs: ticker (required). Returns: result

get_stock_infoB

Get stock information for a given ticker symbol from yahoo finance. Include the following information: Stock Price & Trading Info, Company Information, Financial Metrics, Earnings & Revenue, Margins & Returns, Dividends, Balance Sheet, Ownership, Analyst Coverage, Risk Metrics, Other.

Args: ticker: str The ticker symbol of the stock to get information for, e.g. "AAPL"

Inputs: ticker (required). Returns: result

get_yahoo_finance_newsA

Get news for a given ticker symbol from yahoo finance.

Args: ticker: str The ticker symbol of the stock to get news for, e.g. "AAPL"

Inputs: ticker (required). 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

    The tools mostly target distinct aspects (prices, info, news, actions, statements, holders, options, recommendations). Slight overlap exists between get_stock_info and get_financial_statement, as both cover financial data, but their descriptions clarify the different scopes.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with lowercase and underscores, e.g., get_historical_stock_prices, get_stock_info, get_option_chain. Minor deviation: get_yahoo_finance_news includes the service name, but the pattern is otherwise uniform.

    Tool Count5/5

    With 9 tools, the server is well-scoped for a Yahoo Finance data provider. Each tool covers a meaningful data category without excessive overlap or unnecessary granularity.

    Completeness4/5

    The tool surface covers major stock data areas: historical prices, overview info, news, dividends/splits, financial statements, holders, options, and recommendations. Minor gaps exist, such as lack of a ticker search or real-time quote tool, but these are not critical for the server's apparent purpose.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      MCP server that provides AI assistants access to stock market data including financial statements, stock prices, and market news through a Model Context Protocol interface.
      11
      2,329
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      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.
      1
      MIT