yfinance-mcp
yfinance-mcp: An MCP server providing Yahoo Finance data for AI models. Access stock data, news, and sentiment analysis tools.

yfinance-mcp Solution Overview
yfinance-mcp is an MCP server designed to provide AI models with real-time financial data from Yahoo Finance. It offers a suite of tools for retrieving stock information, news, and conducting financial searches. AI models can seamlessly access functions like get_ticker_info
for stock details, get_ticker_news
for market sentiment analysis, and search_quote
for identifying investment opportunities.
This server empowers developers to build AI-driven applications for stock analysis, algorithmic trading, and portfolio management. By integrating yfinance-mcp, developers eliminate the complexities of direct API interactions, focusing instead on crafting intelligent financial models. The server utilizes the yfinance
library and can be easily integrated into existing MCP ecosystems using uv
or Docker, providing a streamlined approach to accessing and utilizing Yahoo Finance data.
yfinance-mcp Key Capabilities
Real-time Stock Data Retrieval
The yfinance-mcp server provides AI models with the ability to access real-time stock data from Yahoo Finance. This is achieved through the get_ticker_info
tool, which takes a stock symbol as input and returns comprehensive information about the specified stock. This includes details such as the current price, historical data, company profile, and key statistics. The tool leverages the yfinance
library to ensure accurate and up-to-date information. This functionality is crucial for AI models that require timely financial data for tasks such as algorithmic trading, portfolio analysis, and risk management. For example, an AI model could use this tool to monitor the price of a specific stock and trigger an alert when it reaches a certain threshold.
Financial News Aggregation
The yfinance-mcp
server offers the get_ticker_news
and search_news
tools, enabling AI models to access and analyze financial news articles related to specific stocks or general market trends. The get_ticker_news
tool fetches news articles for a given stock symbol, while the search_news
tool allows for broader searches using a query string. This capability is essential for sentiment analysis, event detection, and understanding the factors that influence stock prices. For instance, an AI model could use these tools to track news sentiment surrounding a particular company and incorporate this information into its investment decisions. The server aggregates news from various sources, providing a comprehensive view of market sentiment.
Sector-Specific Financial Insights
The yfinance-mcp server provides tools to retrieve top-performing entities within specific sectors, including ETFs (get_top_etfs
), mutual funds (get_top_mutual_funds
), and companies (get_top_companies
, get_top_growth_companies
, get_top_performing_companies
). These tools allow AI models to quickly identify leading players in different sectors, facilitating tasks such as sector analysis, investment strategy development, and competitive benchmarking. For example, an AI model could use the get_top_etfs
tool to identify the best-performing ETFs in the technology sector and allocate investments accordingly. This functionality enables AI models to make more informed decisions based on sector-specific insights.
Sentiment Analysis Integration
The analyze_sentiment
tool allows AI models to directly integrate sentiment analysis results into their workflows. This tool accepts a stock symbol, reasoning behind the sentiment, the sentiment label ('positive', 'negative', or 'neutral'), and a sentiment score as inputs. While the server itself doesn't perform the sentiment analysis, it provides a standardized way to record and associate sentiment data with specific stocks. This is particularly useful when an AI model uses an external service or its own internal logic to determine sentiment. For example, an AI model could analyze news articles related to a company, determine the overall sentiment, and then use this tool to store the sentiment and its associated score within the yfinance-mcp server for later retrieval and analysis.