Skip to main content
Glama
bald-newcomer

Yahoo Finance MCP Server

Yahoo Finance MCP Server

A simple MCP server for Yahoo Finance using yfinance. This server provides a set of tools to fetch stock data, news, and other financial information.

Tools

  • get_ticker_info

    • Retrieve stock data including company info, financials, trading metrics and governance data.

    • Inputs:

      • symbol (string): The stock symbol.

  • get_ticker_news

    • Fetches recent news articles related to a specific stock symbol with title, content, and source details.

    • Inputs:

      • symbol (string): The stock symbol.

  • search

    • Fetches and organizes search results from Yahoo Finance, including stock quotes and news articles.

    • Inputs:

      • query (string): The search query (ticker symbol or company name).

      • search_type (string): Type of search results to retrieve (options: "all", "quotes", "news").

  • get_top

    • Get top entities (ETFs, mutual funds, companies, growth companies, or performing companies) in a sector.

    • Inputs:

      • sector (string): The sector to get.

      • top_type (string): Type of top companies to retrieve (options: "top_etfs", "top_mutual_funds", "top_companies", "top_growth_companies", "top_performing_companies").

      • top_n (number, optional): Number of top entities to retrieve (default 10).

  • get_price_history

    • Fetch historical price data for a given stock symbol over a specified period and interval. Can return data as a markdown table or generate professional financial charts using mplfinance, including candlestick charts with volume bars, VWAP overlays, and volume profile analysis.

    • Inputs:

      • symbol (string): The stock symbol.

      • period (string, optional): Time period to retrieve data for (e.g. '1d', '1mo', '1y'). Default is '1mo'.

      • interval (string, optional): Data interval frequency (e.g. '1d', '1h', '1m'). Default is '1d'.

      • chart_type (string, optional): Type of chart to generate. If not specified, returns price data as markdown table. Options:

        • "price_volume": Candlestick chart with volume bars

        • "vwap": Volume Weighted Average Price chart with VWAP overlay

        • "volume_profile": Candlestick chart with volume profile showing volume distribution by price level (displayed as a histogram on the right side)

    • Output:

      • If chart_type is not specified: Returns historical price data as a markdown table

      • If chart_type is specified: Returns a base64-encoded WebP image for efficient token usage

Related MCP server: Yahoo Finance MCP Server

Usage

You can use this MCP server via uv (Python package installer), Docker, or local development.

Via uv

  1. Install uv

  2. Add the following configuration to your MCP server configuration file:

{
  "mcpServers": {
    "yfmcp": {
      "command": "uvx",
      "args": ["yfmcp@latest"]
    }
  }
}

Via Docker

Add the following configuration to your MCP server configuration file:

{
  "mcpServers": {
    "yfmcp": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "narumi/yfinance-mcp"]
    }
  }
}

Local Development

For local development, add the following configuration to your MCP server configuration file:

{
  "mcpServers": {
    "yfmcp": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/path/to/yfinance-mcp",
        "yfmcp"
      ]
    }
  }
}

Replace /path/to/yfinance-mcp with the actual path to your local repository.

Demo Chatbot

This repository includes a demo chatbot built with Chainlit that provides a conversational interface to the Yahoo Finance MCP server.

Features

  • Interactive chat interface for querying stock information

  • Automatic display of financial charts and data visualizations

  • Support for both OpenAI and LiteLLM backends

  • Tool calling integration with the MCP server

Setup

  1. Install demo dependencies:

uv sync --extra dev
  1. Configure environment variables (create a .env file):

# For OpenAI
OPENAI_API_KEY=your_openai_api_key
DEFAULT_MODEL=gpt-4.1

# For LiteLLM (alternative)
LITELLM_API_KEY=your_litellm_api_key
LITELLM_BASE_URL=your_litellm_base_url
DEFAULT_MODEL=gpt-4.1
  1. Run the demo:

uv run chainlit run demo.py

The chatbot will be available at http://localhost:8000.

Example Queries

  • "Get AAPL stock information"

  • "Show me recent TSLA news"

  • "Display NVDA price history for the past month"

  • "Show me a candlestick chart for MSFT over the last 3 months"

Available Tools

5 tools
get_price_historyA

Fetch historical price data for a given stock symbol over a specified period and interval.

ParametersJSON Schema
NameRequiredDescriptionDefault
periodNoTime period to retrieve data for (e.g. '1d', '1mo', '1y').1mo
symbolYesThe stock symbol
intervalNoData interval frequency (e.g. '1d', '1h', '1m')1d
chart_typeNoType of chart: 'price_volume' for candlestick with volume bars, 'vwap' for Volume Weighted Average Price, or 'volume_profile' for volume distribution by price level

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must carry behavioral disclosure, and it does at least make clear this is a read-only fetch rather than a mutation. However, it omits caveats such as valid period/interval combinations, data limitations, or rate-limit behavior, leaving meaningful gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One sentence, front-loaded with the action, with no filler or repetition of schema details. It is as concise as a tool description can be.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple data-fetch tool, the description plus the complete input schema and output schema cover the essential calling context. The main omissions are behavioral caveats and routing guidance, which are already reflected in other dimensions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the description only needs to add extra context; it mentions period and interval but merely restates their names. It does not warn about important interactions like intraday intervals being usable only for recent periods.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description starts with a specific verb and object ('Fetch historical price data') and scopes it to a stock symbol with a period and interval. This cleanly separates it from the news, info, search, and top-list siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The tool's intended use is easy to infer: call it whenever historical price series are needed for a symbol. It does not explicitly name when not to use it or mention alternatives, but the context is sufficiently clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_ticker_infoA

Retrieve stock data including company info, financials, trading metrics and governance data.

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolYesThe stock symbol

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the behavioral transparency burden. The verb 'Retrieve' clearly signals a read-only operation with no side effects, and the output schema covers return structure. It does not disclose data freshness or validation behavior, but these are minor for a simple lookup tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the main action and then lists meaningful categories without any padding. Every part contributes to understanding what the tool returns.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given a simple one-parameter schema, an output schema, and a clearly scoped retrieval purpose, the description is largely sufficient. It could be improved by naming sibling tools or noting data limitations, but nothing critical is missing for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already fully describes the only parameter, 'symbol', with 100% coverage. The description adds no extra meaning about symbol format or expected input values, so it stays at the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a clear verb and resource: 'Retrieve stock data' and specifies the content areas (company info, financials, trading metrics, governance data). This makes the tool's purpose understandable, though it doesn't explicitly contrast with siblings like search or get_top.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage whenever broad ticker information is needed, but it offers no explicit when-to-use guidance or mentions of alternatives. An agent must infer the boundary against get_ticker_news and get_price_history from the listed data categories rather than from direct instructions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_ticker_newsA

Fetches recent news articles related to a specific stock symbol with title, content, and source details.

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolYesThe stock symbol

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It communicates that the tool performs a read-only fetch and returns news article fields, which is useful. However, it leaves 'recent' vague and does not mention pagination, sorting, time windows, or behavior for invalid symbols.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence with the core verb and object front-loaded. It contains no filler, no tautology, and every word adds meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter read tool with an output schema present, the description covers the essential purpose and return contents. The main gaps are the undefined meaning of 'recent' and missing details about article count or pagination, but these are minor given the tool's simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already documents the only parameter, 'symbol', as 'The stock symbol', achieving 100% coverage. The description adds no format, validation, or examples beyond that, but none are necessary given the high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Fetches'), the resource ('recent news articles'), and the scope ('related to a specific stock symbol'), and even lists the returned content ('title, content, and source details'). This makes it easily distinguishable from sibling tools like get_ticker_info, get_price_history, and search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool should be used when news for a particular stock symbol is needed, but it does not explicitly state when to prefer this tool over alternatives like 'search' or 'get_ticker_info'. No exclusions or alternative conditions are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_topB

Get top entities (ETFs, mutual funds, companies, growth companies, or performing companies) in a sector.

ParametersJSON Schema
NameRequiredDescriptionDefault
top_nNoNumber of top entities to retrieve (limit the results)
sectorYesThe sector to get
top_typeYesType of top companies to retrieve

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Get' implies a read-only operation, but the description does not explain how 'top' is determined, whether results are sorted, how many results are returned, or whether the tool aggregates across multiple entities. The absence of such context leaves significant behavioral ambiguity.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence with no filler. It front-loads the core purpose and includes useful examples of entity types. It could be slightly more compact by omitting the parenthetical list, but the list adds clarity without bloat.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present and only three parameters, the description is mostly sufficient for basic invocation. However, it does not define the ranking criterion behind 'top', which is essential for an agent to interpret results correctly. This is a meaningful gap for a ranking tool, but the overall simplicity and schema coverage keep it at a moderate level.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds modest value by enumerating the entity types and the sector scope, but it does not provide meaning beyond the schema's own parameter descriptions. The parameter descriptions are adequate, so no major gaps exist.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action and resource: getting top entities (ETFs, mutual funds, companies, growth companies, or performing companies) within a sector. It is clearly distinct from the sibling tools, which focus on ticker info, news, search, and price history. However, it does not explicitly clarify what metric defines 'top', so some ambiguity remains.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies this tool is for retrieving ranked lists of entities per sector, which distinguishes it from siblings like get_ticker_info or get_price_history. However, there is no explicit guidance on when to choose this tool over alternatives, nor any mention of when not to use it. Usage context is only implied, not stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 5 tool updatesv0.6.0
    • First observedget_price_history
    • First observedget_ticker_info
    • First observedget_ticker_news
    • First observedget_top
    • First observedsearch

TDQS

A3.6/5.0

Scored across 5 tools

Disambiguation4/5

Tools are mostly distinct: price history, news, company info, and top lists each have clear purposes. Some ambiguity exists because 'search' also returns news articles, which overlaps with 'get_ticker_news'.

Naming Consistency4/5

Most tools follow a consistent get_* pattern with clear object names like get_ticker_info and get_price_history. The outlier is 'search', which lacks the get_ prefix and is more generic.

Tool Count5/5

Five tools is an appropriate, focused scope for a Yahoo Finance server covering quotes, news, historical data, search, and top lists. Each tool adds clear value without unnecessary bloat.

Completeness4/5

The server covers core Yahoo Finance workflows: retrieving quotes and fundamentals, news, price history, and sector/entity rankings. Minor gaps like financial statement detail or options data exist, but the surface is sufficient for common use cases.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    A
    quality
    D
    maintenance
    Provides financial data from Yahoo Finance via MCP, enabling AI agents to access real-time stock info, historical prices, financial statements, and market analysis.
    10
    14
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to access Yahoo Finance data including stock information, news, price history, options, and earnings via MCP tools.
    51
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    MCP server that exposes Yahoo Finance data through tools for searching instruments, fetching quotes, history, company info, financials, dividends, news, recommendations, and options. Enables AI assistants to answer market-data questions using natural language.
    22
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI assistants to retrieve real-time US stock market data including prices, company info, financials, and news via MCP tools, using Yahoo Finance as the data source.
    MIT