mcp-yfinance
by: 9nate-drake
MCP Server for fething yfinance financial data into Claude Desktop
📌Overview
Purpose: To provide a Model Context Protocol server that delivers financial data to Claude Desktop via the Yahoo Finance API (yfinance).
Overview: The yfinance MCP Server is designed to facilitate access to real-time and historical financial data for users leveraging Claude Desktop. It streamlines queries related to stock prices, historical data, institutional ownership, and analyst targets, enhancing the overall financial analysis capabilities of the application.
Key Features:
-
Real-Time Data Access: Enables users to retrieve current stock prices, providing up-to-date financial information for informed decision-making.
-
Historical Data Analysis: Allows for querying of past performance data, assisting users in understanding market trends over specific timeframes.
-
Ownership Insights: Offers insights into institutional ownership of stocks, helping users assess market sentiment and backing.
-
Analyst Target Information: Provides median price targets from analysts, aiding users in evaluating potential stock performance forecasts.
yfinance MCP Server
A Model Context Protocol server that provides financial data to Claude Desktop using yfinance (Yahoo Finance API). Most code created by Claude.
Installation
Requirements
- Python 3.10 or higher
- Claude Desktop
Install
- Clone this repo:
git clone https://github.com/9nate-drake/mcp-yfinance
- Install required packages:
pip install mcp yfinance
Configuration
Add to your Claude Desktop config file claude_desktop_config.json
(on Windows usually at %APPDATA%/Claude/
):
{
"mcpServers": {
"yfinance": {
"command": "python",
"args": [
"/path/to/finance_server/server.py"
]
}
}
}
Replace the path with the full path to your server.py
file.
Usage
- Restart Claude Desktop
- Look for the yfinance server in the 🔌 menu
- Example queries:
- Get current stock price: Get me the current stock price for MSFT
- Get historical data: Analyse the last 3 months of Apple stock performance
- Check ownership: What's the institutional ownership of Nvidia?
- Check analyst targets: What's the median price target for TSLA?
Development
To modify the server:
- Edit
server.py
directly - Restart Claude Desktop to apply changes
TODO
- Check compliance with anthropic recommended practice for MCP servers