Skip to main content
Glama
Yahoo Finance MCP Server

Yahoo Finance MCP Server

by 16Coffee

Financial Modeling Prep MCP Server

This is a Model Context Protocol (MCP) server that provides comprehensive financial data from Financial Modeling Prep. It allows you to retrieve detailed information about stocks, including historical prices, company information, financial statements, options data, and market news.

Demo

MCP Demo

Related MCP server: MCP Yahoo Finance

MCP Tools

The server exposes the following tools through the Model Context Protocol:

Stock Information

Tool

Description

get_historical_stock_prices

Get historical OHLCV data for a stock with customizable period and interval

get_stock_info

Get comprehensive stock data including price, metrics, and company details

get_news_sentiment

Get latest news articles for a stock

get_stock_actions

Get stock dividends and splits history

Financial Statements

Tool

Description

get_financial_statement

Get income statement, balance sheet, or cash flow statement (annual/quarterly) using Financial Modeling Prep

Options Data

Tool

Description

get_option_expiration_dates

Get available options expiration dates

get_option_chain

Get options chain for a specific expiration date and type (calls/puts)

Stock Grades

Tool

Description

get_stock_grades

Get the latest analyst grades for a stock

get_stock_grades_historical

Get historical analyst grades

get_stock_grades_summary

Get a consensus summary of analyst grades

get_stock_grade_news

Get grade-related news for a stock

get_stock_grade_latest_news

Get the most recent analyst grade news

get_analyst_estimates

Retrieve analyst financial estimates

get_ratings

Get ratings snapshot or history

get_price_target_info

Get price target summary, consensus or news

Reference Data

Tool

Description

lookup_identifier

Search by symbol, name, CIK, CUSIP or ISIN

get_directory_list

Retrieve exchange, sector and other lists

Corporate Events

Tool

Description

get_calendar_data

Get dividends, earnings, IPO and split calendars

get_shares_float_info

Retrieve float data for one or all companies

get_ma_data

Get latest or search M&A transactions

get_executive_info

Fetch company executives or compensation info

get_dcf_valuation

Obtain DCF or levered DCF valuation

get_economic_data

Retrieve treasury rates and other macro data

Cryptocurrency Data

Tool

Description

get_crypto_list

Retrieve the list of tradable cryptocurrencies

get_crypto_quote

Get complete quote data for a cryptocurrency

get_crypto_quote_short

Get quick quote data for a cryptocurrency

get_all_crypto_quotes

Get real-time quotes for all cryptocurrencies

get_crypto_price_eod

Get historical cryptocurrency EOD prices in light or full mode

get_crypto_intraday

Get intraday cryptocurrency data by 1min, 5min or 1hour interval

get_crypto_news

Search cryptocurrency-related news

get_crypto_latest_news

Retrieve the latest cryptocurrency news

Real-World Use Cases

With this MCP server, you can use Claude to:

Stock Analysis

  • Price Analysis: "Show me the historical stock prices for AAPL over the last 6 months with daily intervals."

  • Financial Health: "Get the quarterly balance sheet for Microsoft."

  • Performance Metrics: "What are the key financial metrics for Tesla from the stock info?"

  • Trend Analysis: "Compare the quarterly income statements of Amazon and Google."

  • Cash Flow Analysis: "Show me the annual cash flow statement for NVIDIA."

Market Research

  • News Analysis: "Get the latest news articles about Meta Platforms."

  • Market Movers: "List today's top gainers and losers."

  • Options Analysis: "Get the options chain for SPY with expiration date 2024-06-21 for calls."

Investment Research

  • "Create a comprehensive analysis of Microsoft's financial health using their latest quarterly financial statements."

  • "Compare the dividend history and stock splits of Coca-Cola and PepsiCo."

  • "Generate a report on the options market activity for Apple stock with expiration in 30 days."

Requirements

  • Python 3.11 or higher

  • Dependencies as listed in pyproject.toml, including:

    • mcp

    • requests

    • pandas

    • pydantic

    • and other packages for data processing

Setup

  1. Clone this repository:

    git clone https://github.com/Alex2Yang97/financialmodelingprep-mcp.git
    cd financialmodelingprep-mcp
  2. Create and activate a virtual environment and install dependencies:

    uv venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    uv pip install -e .
  3. Set your Financial Modeling Prep API key:

    export FMP_API_KEY=YOUR_API_KEY

Usage

Development Mode

You can test the server with MCP Inspector by running:

uv run server.py

This will start the server and allow you to test the available tools.

Integration with Claude for Desktop

To integrate this server with Claude for Desktop:

  1. Install Claude for Desktop to your local machine.

  2. Install VS Code to your local machine. Then run the following command to open the claude_desktop_config.json file:

    • MacOS: code ~/Library/Application\ Support/Claude/claude_desktop_config.json

    • Windows: code $env:AppData\Claude\claude_desktop_config.json

  3. Edit the Claude for Desktop config file, located at:

    • macOS:

      {
        "mcpServers": {
          "financialmodelingprep": {
            "command": "uv",
            "args": [
              "--directory",
              "/ABSOLUTE/PATH/TO/PARENT/FOLDER/financialmodelingprep-mcp",
              "run",
              "server.py"
            ]
          }
        }
      }
    • Windows:

      {
        "mcpServers": {
          "financialmodelingprep": {
            "command": "uv",
            "args": [
              "--directory",
              "C:\\ABSOLUTE\\PATH\\TO\\PARENT\\FOLDER\\financialmodelingprep-mcp",
              "run",
              "server.py"
            ]
          }
        }
      }
    • Note: You may need to put the full path to the uv executable in the command field. You can get this by running which uv on MacOS/Linux or where uv on Windows.

  4. Restart Claude for Desktop

License

MIT

Available Tools

34 tools
get_all_crypto_quotesB

获取全部加密货币的批量行情。

Inputs: no named parameters.

get_analyst_estimatesB

获取分析师的财务预估数据。

参数说明: symbol: str 股票代码,例如 "AAPL" period: str annual 或 quarter,默认 annual page: int 页码,默认 0 limit: int 返回数量,默认 10

Inputs: symbol (required), limit, page, period.

get_calendar_dataC

获取分红、收益、IPO、拆股等日历信息。

参数说明: event_type: str 可选值:dividends、dividends_calendar、earnings、earnings_calendar、 ipos_calendar、ipos_disclosure、ipos_prospectus、splits、splits_calendar symbol: str 部分类型需要股票代码 page: int 页码,默认 0 limit: int 返回数量,默认 100

Inputs: event_type (required), limit, page, symbol.

get_crypto_intradayC

按时间间隔获取加密货币的分时价格,支持 1min、5min 和 1hour。

Inputs: symbol (required), interval.

get_crypto_latest_newsC

获取加密货币最新新闻列表。

Inputs: limit, page.

get_crypto_listB

获取交易所上市的加密货币列表。

Inputs: no named parameters.

get_crypto_newsC

搜索加密货币相关新闻。

Inputs: symbols (required).

get_crypto_price_eodC

获取加密货币的历史收盘价,可选简略或完整模式。

Inputs: symbol (required), mode.

get_crypto_quoteC

获取指定加密货币的完整行情。

Inputs: symbol (required).

get_crypto_quote_shortC

获取指定加密货币的简要行情。

Inputs: symbol (required).

get_dcf_valuationB

获取 DCF 或杠杆 DCF 估值数据。

参数说明: valuation_type: str dcf 或 levered symbol: str 股票代码

Inputs: symbol (required), valuation_type (required).

get_directory_listB

获取市场或公司目录列表。

参数说明: list_type: str 可选值:stock、financial_statement_symbol、cik、symbol_change、etf、 actively_trading、earnings_transcript、available_exchanges、 available_sectors、available_industries、available_countries

Inputs: list_type (required).

get_economic_dataC

获取宏观经济数据。

参数说明: data_type: str treasury_rates、economic_indicators、economic_calendar、market_risk_premium name: str 经济指标名称,data_type 为 economic_indicators 时必填 from_date: str 起始日期,格式 YYYY-MM-DD to_date: str 结束日期,格式 YYYY-MM-DD

Inputs: data_type (required), from_date, name, to_date.

get_executive_infoB

获取公司高管信息或薪酬数据。

参数说明: info_type: str executives、compensation 或 benchmark symbol: str 当类型为 executives 或 compensation 时必填

Inputs: info_type (required), symbol.

get_financial_statementB

获取公司财报,类型包括年度/季度的收入表、资产负债表和现金流量表。

参数说明: ticker: str 股票代码,例如 "AAPL" financial_type: str 财报类型:income_stmt_annual、income_stmt_quarterly、balance_sheet_annual、balance_sheet_quarterly、cashflow_annual、cashflow_quarterly

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

get_historical_stock_pricesA

获取指定股票的历史价格,返回日期、开盘价、最高价、最低价、收盘价和成交量。 参数说明: ticker: str 股票代码,例如 "AAPL" period : str 支持的周期:1d,5d,1mo,3mo,6mo,1y,2y,5y,10y,ytd,max; 也可以使用开始和结束日期;默认 "1mo" interval : str 支持的间隔:1m,2m,5m,15m,30m,60m,90m,1h,1d,5d,1wk,1mo,3mo; 分钟级数据最多可追溯60天;默认 "1d"

Inputs: ticker (required), interval, period.

get_ma_dataC

获取并购相关数据。

参数说明: action_type: str latest 或 search name: str 搜索模式下的公司名称 page: int 页码,默认 0 limit: int 返回数量,默认 100

Inputs: action_type (required), limit, name, page.

get_news_sentimentC

获取指定股票的相关新闻列表。

参数说明: ticker: str 股票代码,例如 "AAPL"

Inputs: ticker (required).

get_option_chainA

根据股票代码、到期日和期权类型获取期权链数据。

参数说明: ticker: str 股票代码,例如 "AAPL" expiration_date: str 期权到期日,格式为 'YYYY-MM-DD' option_type: str 期权类型:'calls' 或 'puts'

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

get_option_expiration_datesC

获取指定股票可用的期权到期日。

参数说明: ticker: str 股票代码,例如 "AAPL"

Inputs: ticker (required).

get_price_target_infoB

获取分析师目标价相关信息,可选择汇总、共识或新闻。

参数说明: info_type: str summary、consensus、news、latest_news symbol: str 股票代码,news/summary/consensus 必填 page: int 页码,默认 0 limit: int 返回数量,默认 10

Inputs: info_type (required), limit, page, symbol.

get_ratingsA

获取股票评级数据,可选择快照或历史记录。

参数说明: symbol: str 股票代码,例如 "AAPL" rating_type: str snapshot 或 historical,默认 snapshot limit: int 返回数量,默认 1

Inputs: symbol (required), limit, rating_type.

get_shares_float_infoB

获取流通股数据或全部公司流通股列表。

参数说明: info_type: str single 或 all symbol: str 查询单个公司时必填 page: int 列表分页,默认 0 limit: int 返回数量,默认 1000

Inputs: info_type (required), limit, page, symbol.

get_stock_actionsC

获取股票的分红与拆股历史。

参数说明: ticker: str 股票代码,例如 "AAPL"

Inputs: ticker (required).

get_stock_grade_latest_newsB

获取最新评级新闻。

参数说明: page: int 页码,默认 0 limit: int 每页数量,最大 1000,默认 10

Inputs: limit, page.

get_stock_grade_newsB

获取指定股票的评级新闻。

参数说明: ticker: str 股票代码,例如 "AAPL" page: int 页码,默认 0 limit: int 每页数量,最大 100,默认 1

Inputs: ticker (required), limit, page.

get_stock_gradesC

获取分析师最新评级。

参数说明: ticker: str 股票代码,例如 "AAPL

Inputs: ticker (required).

get_stock_grades_historicalB

获取分析师评级历史记录。

参数说明: ticker: str 股票代码,例如 "AAPL" limit: int 返回记录数量,最大 1000,默认 100

Inputs: ticker (required), limit.

get_stock_grades_summaryC

获取分析师评级汇总。

参数说明: ticker: str 股票代码,例如 "AAPL

Inputs: ticker (required).

get_stock_infoB

获取公司概况及关键财务指标。

参数说明: ticker: str 股票代码,例如 "AAPL"

Inputs: ticker (required).

get_top_gainersB

获取今日涨幅最大的股票列表。

Inputs: no named parameters.

get_top_losersB

获取今日跌幅最大的股票列表。

Inputs: no named parameters.

lookup_identifierB

按标识类型查询股票代码、CIK、CUSIP 或 ISIN。

参数说明: identifier_type: str 可选值:symbol、name、cik、cusip、isin、exchange_variant query: str 对应的查询内容

Inputs: identifier_type (required), query (required).

search_companiesB

根据关键字搜索公司信息。

参数说明: query: str 搜索关键字 limit: int 返回结果数量,默认 10 exchange: str 交易所代码,可选

Inputs: query (required), exchange, limit.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 34 tools

    Disambiguation3/5

    The tool set has clear thematic grouping (crypto, stock, news, etc.), but there is significant overlap within categories. For example, get_crypto_quote and get_crypto_quote_short are nearly identical, and multiple tools for stock grades (get_stock_grades, get_stock_grades_historical, get_stock_grades_summary) could confuse an agent about which to use. Descriptions help differentiate, but the boundaries are not always sharp.

    Naming Consistency4/5

    Most tools follow a consistent verb_noun pattern (e.g., get_crypto_quote, get_historical_stock_prices), with minor deviations like lookup_identifier and search_companies. The naming is generally predictable and readable, though not perfectly uniform across all tools.

    Tool Count2/5

    With 34 tools, the count is excessive for a single server, making it heavy and potentially overwhelming. While Yahoo Finance is a broad domain, many tools could be consolidated (e.g., multiple crypto quote tools) or parameterized to reduce the surface area, indicating poor scoping.

    Completeness5/5

    The tool set comprehensively covers the Yahoo Finance domain, including stock data, crypto, news, analyst estimates, financial statements, options, and economic indicators. There are no obvious gaps; agents can perform a wide range of financial analysis tasks without dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      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.
      3
      27
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      A Model Context Protocol server that enables interaction with Yahoo Finance to retrieve stock pricing, company information, and historical financial data through natural language queries.
      21
      1,006 PyPI
      29
      MIT
    • A
      license
      C
      quality
      Not graded
      maintenance
      A Model Context Protocol server that provides tools for interacting with Yahoo Finance, allowing users to retrieve stock prices, company information, and perform financial data comparisons.
      11
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      A Model Context Protocol server providing comprehensive access to Yahoo Finance data through the yahooquery library, enabling AI assistants to retrieve stock prices, financial statements, market data, and company analytics.
      12
      MIT