mcp-yfinance

MCP.Pizza Chef: 9nate-drake

mcp-yfinance is an MCP server that integrates Yahoo Finance data into Claude Desktop, enabling real-time access to stock prices, historical market data, and financial analytics. Built with Python and leveraging the yfinance API, it allows users to query financial information directly within Claude Desktop, enhancing AI-driven financial analysis and decision-making workflows. Installation requires Python 3.10+, and configuration is straightforward via Claude Desktop's config file. This server empowers developers and analysts to embed live financial data into AI-assisted environments efficiently.

Use This MCP server To

Fetch current stock prices for real-time market tracking Retrieve historical financial data for trend analysis Integrate financial data into AI-driven reports Enable automated financial queries within Claude Desktop Support investment decision-making with live data Provide market data for algorithmic trading models

README

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

  1. Clone this repo:
git clone https://github.com/9nate-drake/mcp-yfinance
  1. Install required packages:
pip install mcp yfinance

Configuration

Add to your Claude Desktop config file claude_desktop_config.json (on Windows this is usually at %APPDATA%/Claude/):

{
  "mcpServers": {
    "yfinance": {
      "command": "python",
      "args": [
        "/path/to/finance_server/server.py"
      ]
    }
  }
}

Replace the path with the actual full path to your server.py file.

Usage

  1. Restart Claude Desktop
  2. Look for the yfinance server in the 🔌 menu
  3. 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 intsitutional ownership of Nvidia?"
    • Check analyst targets: "What's the median price target for TSLA?"

Development

To modify the server:

  1. Edit server.py directly
  2. Restart Claude Desktop to apply changes

TODO

* Add complete range of yfinance functions

  • Check compliance with anthropic recommended practice for mcp servers

mcp-yfinance FAQ

How do I install the mcp-yfinance server?
Clone the GitHub repo, then install dependencies with 'pip install mcp yfinance'.
What are the system requirements for mcp-yfinance?
Python 3.10 or higher and Claude Desktop are required to run the server.
How do I configure mcp-yfinance with Claude Desktop?
Add the server command and path to 'server.py' in the 'mcpServers' section of claude_desktop_config.json.
Can I query historical stock data using mcp-yfinance?
Yes, the server supports fetching historical financial data via yfinance API.
Is mcp-yfinance limited to specific stocks or markets?
No, it supports any stock or financial instrument available through Yahoo Finance.
How do I start using mcp-yfinance after installation?
Restart Claude Desktop, then select the yfinance server from the plugin menu to begin querying.
Does mcp-yfinance support other LLM platforms besides Claude?
It is designed for Claude Desktop but can be adapted for other MCP-compatible LLM hosts like OpenAI GPT-4 and Anthropic Claude.
What programming language is mcp-yfinance built with?
The server is implemented in Python, leveraging the yfinance library for data retrieval.