
Yahoo Finance
STDIOYahoo Finance MCP server providing comprehensive stock and financial market data
Yahoo Finance MCP server providing comprehensive stock and financial market data
This is a Model Context Protocol (MCP) server that provides comprehensive financial data from Yahoo Finance. It allows you to retrieve detailed information about stocks, including historical prices, company information, financial statements, options data, and market news.
The server exposes the following tools through the Model Context Protocol:
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_yahoo_finance_news | Get latest news articles for a stock |
get_stock_actions | Get stock dividends and splits history |
Tool | Description |
---|---|
get_financial_statement | Get income statement, balance sheet, or cash flow statement (annual/quarterly) |
get_holder_info | Get major holders, institutional holders, mutual funds, or insider transactions |
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) |
Tool | Description |
---|---|
get_recommendations | Get analyst recommendations or upgrades/downgrades history |
With this MCP server, you can use Claude to:
pyproject.toml
, including:
Clone this repository:
git clone https://github.com/Alex2Yang97/yahoo-finance-mcp.git cd yahoo-finance-mcp
Create and activate a virtual environment and install dependencies:
uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate uv pip install -e .
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.
To integrate this server with Claude for Desktop:
Install Claude for Desktop to your local machine.
Install VS Code to your local machine. Then run the following command to open the claude_desktop_config.json
file:
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
code $env:AppData\Claude\claude_desktop_config.json
Edit the Claude for Desktop config file, located at:
macOS:
{ "mcpServers": { "yfinance": { "command": "uv", "args": [ "--directory", "/ABSOLUTE/PATH/TO/PARENT/FOLDER/yahoo-finance-mcp", "run", "server.py" ] } } }
Windows:
{ "mcpServers": { "yfinance": { "command": "uv", "args": [ "--directory", "C:\\ABSOLUTE\\PATH\\TO\\PARENT\\FOLDER\\yahoo-finance-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.
Restart Claude for Desktop
MIT