home / mcp / yfinance mcp server
Provides Yahoo Finance data via MCP, enabling stock prices, historical data, ownership, and target analyses.
Configuration
View docs{
"mcpServers": {
"9nate-drake-mcp-yfinance": {
"command": "python",
"args": [
"/path/to/finance_server/server.py"
]
}
}
}You can use the yfinance MCP Server to query financial data via Claude Desktop. It exposes Yahoo Finance data through a Model Context Protocol interface, enabling you to fetch real-time prices, historical performance, institutional ownership details, and analyst targets through simple natural language prompts.
You interact with the server through Claude Desktop by selecting the yfinance MCP Server in the MCP menu and sending natural language requests. You can ask for the current price of a stock, analyze recent performance, check institutional ownership, or retrieve analyst price targets. Practical examples include questions like: getting the current stock price, analyzing the last three months of a company’s stock performance, querying institutional ownership, and asking for the median price target for a ticker.
# Prerequisites
Python 3.10 or higher
Claude Desktop
# Install required packages
pip install mcp yfinance
# Optional: clone the project if you want to inspect or modify the server
git clone https://github.com/9nate-drake/mcp-yfinanceConfigure Claude Desktop to run the yfinance MCP Server by adding a server entry in your claude_desktop_config.json. Use the following structure, replacing the path with the actual location of server.py on your system.
{
"mcpServers": {
"yfinance": {
"command": "python",
"args": [
"/path/to/finance_server/server.py"
]
}
}
}After configuring, restart Claude Desktop and look for the yfinance server in the MCP menu. From there you can start asking questions about stock prices, historical data, ownership, and targets.
Fetches the latest price for a given ticker symbol.
Retrieves historical price data for a ticker over a specified period.
Returns institutional ownership information for a ticker.
Provides the median analyst price target for a ticker.