Yahoo Finance MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Yahoo Finance MCP ServerGet latest news for TSLA"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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_typeis not specified: Returns historical price data as a markdown tableIf
chart_typeis 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
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
Install demo dependencies:
uv sync --extra devConfigure environment variables (create a
.envfile):
# 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.1Run the demo:
uv run chainlit run demo.pyThe 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 toolsget_price_historyA
Fetch historical price data for a given stock symbol over a specified period and interval.
| Name | Required | Description | Default |
|---|---|---|---|
| period | No | Time period to retrieve data for (e.g. '1d', '1mo', '1y'). | 1mo |
| symbol | Yes | The stock symbol | |
| interval | No | Data interval frequency (e.g. '1d', '1h', '1m') | 1d |
| chart_type | No | Type 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
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
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.
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.
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.
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.
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.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | The stock symbol |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
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.
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.
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.
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.
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.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | The stock symbol |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
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.
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.
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.
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.
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.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| top_n | No | Number of top entities to retrieve (limit the results) | |
| sector | Yes | The sector to get | |
| top_type | Yes | Type of top companies to retrieve |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
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.
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.
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.
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.
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.
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.
searchC
Fetches and organizes search results from Yahoo Finance, including stock quotes and news articles.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The search query (ticker symbol or company name) | |
| search_type | Yes | Type of search results to retrieve |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
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. It only states that results are fetched and organized; it does not explain result ordering, pagination, limits, or any differences between search_type values. The lack of a mutation warning is fine, but the operational behavior is largely undisclosed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence that states the core function upfront. The word 'organizes' is slightly vague, but there is no wasted content or structural clutter.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With only two required parameters, full schema coverage, and an output schema present, the description is minimally viable. However, it omits usage routing and any practical behavioral constraints, so an agent still has to infer important details about when and how to invoke this tool versus siblings.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with both 'query' and 'search_type' fully described and an enum provided, so the baseline is 3. The description adds no substantial parameter-level meaning beyond what the schema already provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names the resource ('search results from Yahoo Finance') and the action ('fetches and organizes'), and it explicitly mentions stock quotes and news articles, which maps to the search_type enum. It does not explicitly contrast itself with siblings like get_ticker_news or get_ticker_info, but the search-focused framing is still clear.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives no guidance on when to use search versus the sibling tools. It does not say, for example, that get_ticker_news is better for news-only lookup or that get_ticker_info is for detailed symbol data, so the agent must infer routing from tool names alone.
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.
5 tool updates
v0.6.0- First observed
get_price_history - First observed
get_ticker_info - First observed
get_ticker_news - First observed
get_top - First observed
search
TDQS
Scored across 5 tools
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'.
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.
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.
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
Related MCP Connectors
Finnhub MCP — wraps Finnhub Stock API (finnhub.io)
Scrape stock quotes, historical prices, and financial statements from Yahoo Finance.
Market Data App MCP — wraps the Market Data App API (marketdata.app)
Unlock the power of real-time financial data with our Finance MCP. Easily retrieve the latest
Related MCP Servers
- FlicenseAqualityDmaintenanceProvides financial data from Yahoo Finance via MCP, enabling AI agents to access real-time stock info, historical prices, financial statements, and market analysis.1014-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to access Yahoo Finance data including stock information, news, price history, options, and earnings via MCP tools.51MIT
- AlicenseAqualityAmaintenanceMCP 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.22MIT
- AlicenseNot gradedqualityAmaintenanceEnables 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