yfinance-mcp

jl0703/yfinance-mcp

3.2

If you are the rightful owner of yfinance-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The yfinance-mcp-server is a lightweight Model Context Protocol (MCP) server that provides structured access to Yahoo Finance data for LLM-driven agents.

Tools
8
Resources
0
Prompts
0

yfinance-mcp-server

Lightweight Model Context Protocol (MCP) server exposing Yahoo Finance data for LLM-driven agents.


🚀 Available Tools

This MCP server provides structured access to Yahoo Finance data through the following tools:

ToolDescriptionRequest SchemaResponse
get_snapshot(symbol)Current price snapshot & metadatasymbol: strSnapshotResponse
get_profile(symbol)Company profile (sector, industry, website, etc.)symbol: strProfileResponse
get_fundamentals(symbol)Valuation & fundamental metricssymbol: strFundamentalsResponse
get_history(req)Historical OHLCV rows{ "symbol", "period", "interval" }List[HistoricalRow]
get_news(req)Recent market news{ "symbol", "lookback_days", "max_items" }List[NewsItem]
get_analyst_insights(symbol)Analyst consensus & target pricessymbol: strAnalystResponse
get_quote(symbol)Combined snapshot + fundamentals + profilesymbol: strDict[str, Any]
get_financial_statements(req)Income, balance, cash statements{ "symbol", "statement", "quarterly" }Dict[str, Any]

📦 Requirements & Setup

  • Python 3.13
  • uv (Astral’s tool)
  • Dependencies as defined in pyproject.toml.

🛠️ Installation

Run Locally
# Clone repository
git clone https://github.com/jl0703/yfinance-mcp.git
cd yfinance-mcp

# Install dependencies via uv
uv sync

# Start MCP server (stdio)
uv run server.py
Using Docker
  1. Build the Docker image:

    docker build -t yfinance-mcp .
    
  2. Configure your MCP client:

    {
      "mcpServers": {
         "yfinance": {
            "command": "docker",
            "args": ["run", "-i", "--rm", "yfinance-mcp"],
            "transport": "stdio"
         }
      }
    }
    
Install in Claude Desktop
  1. In Claude Desktop, go to SettingsDeveloperOpen App Config File...
  2. Add an entry for yfinance_mcp:
    {
        "mcpServers": {
            "yfinance": {
                "command": "uv",
                "args": [
                    "--directory",
                    "C:\\ABSOLUTE\\PATH\\TO\\PARENT\\FOLDER\\yfinance-mcp",
                    "run",
                    "server.py"
                ]
            }
        }
    }
    
  3. Save the file and restart Claude Desktop.

Claude will then detect the tools offered by this MCP server.

Install in Cursor
  1. In Cursor, open SettingsMCP & IntegrationsNew MCP Server
  2. Add an entry for yfinance_mcp:
    {
        "mcpServers": {
            "yfinance": {
                "command": "uv",
                "args": [
                    "--directory",
                    "C:\\ABSOLUTE\\PATH\\TO\\PARENT\\FOLDER\\yfinance-mcp",
                    "run",
                    "server.py"
                ]
            }
        }
    }
    
  3. Save the config. Cursor should detect and launch or connect to your MCP server.

In your Cursor workspace, you can now issue prompts that invoke tools from yfinance_mcp.