home / mcp / yfinance mcp server

yfinance MCP Server

Provides Yahoo Finance data via MCP, enabling stock prices, historical data, ownership, and target analyses.

Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

# 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-yfinance

Configuration and usage details

Configure 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"
      ]
    }
  }
}

Additional notes

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.

Available tools

get_current_price

Fetches the latest price for a given ticker symbol.

get_historical_data

Retrieves historical price data for a ticker over a specified period.

get_institutional_ownership

Returns institutional ownership information for a ticker.

get_median_target

Provides the median analyst price target for a ticker.

yfinance MCP Server - 9nate-drake/mcp-yfinance