loading…
Search for a command to run...
loading…
An enhanced Yahoo Finance MCP server with pagination, caching, and LLM-optimized responses for stock data, financials, options, and analyst info.
An enhanced Yahoo Finance MCP server with pagination, caching, and LLM-optimized responses for stock data, financials, options, and analyst info.
Enhanced fork of yahoo-finance-mcp by Alex2Yang97
With intelligent pagination, caching, and LLM-optimized responses
A high-performance Model Context Protocol (MCP) server that provides comprehensive financial data from Yahoo Finance with intelligent pagination, caching, and LLM-optimized responses.
This project is built upon the excellent foundation of yahoo-finance-mcp created by Alex2Yang97. The original implementation provides a comprehensive set of tools for accessing Yahoo Finance data through the Model Context Protocol.
While using the original implementation with LLM agents (Claude, ChatGPT, etc.), I encountered critical limitations:
Problem 1: Context Window Overflow
period="max" could return thousands of rowsProblem 2: No Data Persistence
Problem 3: Poor LLM Readability
This fork adds three key enhancements:
Token-Based Pagination (6,000 token limit per page)
Intelligent Caching (TTL: 5min-1hr)
JSON Export (File Download)
Original Author: Alex2Yang97 deserves full credit for:
This Fork Adds: Pagination, caching, and export features to make the server production-ready for LLM agents handling large financial datasets.

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:Install the package directly from PyPI:
pip install yfin-mcp
Clone this repository:
git clone https://github.com/fritzprix/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 .
After installing the package, you can integrate it with Claude for Desktop:
Install the package (if not already installed):
pip install yfin-mcp
Configure Claude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonAdd the server configuration:
Using uvx (Recommended - No installation needed):
{
"mcpServers": {
"yfinance": {
"command": "uvx",
"args": ["yfin-mcp"]
}
}
}
Using Python directly (if installed via pip):
{
"mcpServers": {
"yfinance": {
"command": "python",
"args": ["-m", "yfin_mcp"]
}
}
}
For development/source installation:
{
"mcpServers": {
"yfinance": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/yahoo-finance-mcp",
"run",
"server.py"
]
}
}
}
{
"mcpServers": {
"yfinance": {
"command": "uv",
"args": [
"--directory",
"C:\\ABSOLUTE\\PATH\\TO\\yahoo-finance-mcp",
"run",
"server.py"
]
}
}
}
Restart Claude for Desktop
For testing with MCP Inspector:
# From source
uv run yfin-mcp
# Or if installed via pip
python -m yfin_mcp
To build and publish the package, use the provided scripts. You can optionally provide an argument to bump the version:
# Just build and publish current version
publish_package.bat
# Bump version and then publish
publish_package.bat patch
publish_package.bat minor
publish_package.bat major
chmod +x publish_package.sh
# Just build and publish current version
./publish_package.sh
# Bump version and then publish
./publish_package.sh patch
./publish_package.sh minor
./publish_package.sh major
[!NOTE] The scripts will build the package into the
dist/directory and then usetwineto upload it. Ensure you have your PyPI credentials configured in~/.pypirc(or%HOME%\.pypircon Windows) or set theTWINE_PASSWORDenvironment variable.
If you see this error when running publish_package.bat or uv build, it means the MCP server is still running and locking the executable.
taskkill /F /IM yfin-mcp.exe /T
taskkill /F /IM python.exe /T
MIT License
Original Work: Copyright (c) 2025 AlexYoung
Fork Enhancements: Copyright (c) 2026 SKTelecom
This project maintains the MIT License from the original yahoo-finance-mcp project. All enhancements (pagination, caching, export) are also released under MIT License.
See LICENSE file for full details.
Выполни в терминале:
claude mcp add yfin-mcp -- npx Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.