/ Directory / Playground / YFinance MCP
● Community narumiruna ⚡ Instant

YFinance MCP

by narumiruna · narumiruna/yfinance-mcp

Yahoo Finance via MCP — quotes, fundamentals, historical OHLC, options chains, news for any ticker, free.

Wraps the yfinance Python package as an MCP. No API key. Good for prototyping finance agents, backtesting ideas, or enriching research prompts with real market data. Data is delayed and rate-limited — not for production trading.

Why use it

Key features

Live Demo

What it looks like in practice

yfinance-mcp.replay ▶ ready
0/0

Install

Pick your client

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "yfinance-mcp": {
      "command": "uvx",
      "args": [
        "yfinance-mcp"
      ]
    }
  }
}

Open Claude Desktop → Settings → Developer → Edit Config. Restart after saving.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "yfinance-mcp": {
      "command": "uvx",
      "args": [
        "yfinance-mcp"
      ]
    }
  }
}

Cursor uses the same mcpServers schema as Claude Desktop. Project config wins over global.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "yfinance-mcp": {
      "command": "uvx",
      "args": [
        "yfinance-mcp"
      ]
    }
  }
}

Click the MCP Servers icon in the Cline sidebar, then "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "yfinance-mcp": {
      "command": "uvx",
      "args": [
        "yfinance-mcp"
      ]
    }
  }
}

Same shape as Claude Desktop. Restart Windsurf to pick up changes.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "yfinance-mcp",
      "command": "uvx",
      "args": [
        "yfinance-mcp"
      ]
    }
  ]
}

Continue uses an array of server objects rather than a map.

~/.config/zed/settings.json
{
  "context_servers": {
    "yfinance-mcp": {
      "command": {
        "path": "uvx",
        "args": [
          "yfinance-mcp"
        ]
      }
    }
  }
}

Add to context_servers. Zed hot-reloads on save.

claude mcp add yfinance-mcp -- uvx yfinance-mcp

One-liner. Verify with claude mcp list. Remove with claude mcp remove.

Use Cases

Real-world ways to use YFinance MCP

Quick snapshot of your watchlist — prices, P/E, news

👤 Investors doing daily check-ins ⏱ ~5 min beginner

When to use: You want a one-prompt briefing on 10 tickers before market open.

Flow
  1. Prices
    Use yfinance-mcp. For AAPL, MSFT, NVDA, TSLA, GOOGL, AMZN, META, BRK-B, JPM, V — current price, 1d %, 52w range.✓ Copied
    → Clean table with all 10 rows
  2. Fundamentals
    For the same list, P/E, forward P/E, EPS, and dividend yield.✓ Copied
    → Fundamentals aligned with prior table
  3. News
    For the 3 biggest movers today, pull the 3 most recent headlines each. Summarize the vibe.✓ Copied
    → News grouped by ticker with 1-line vibe

Outcome: A 10-line morning brief tailored to your watchlist.

Pitfalls
  • Rate-limited if you batch too many tickers at once — Chunk to 10 per call, sleep 1s between
Combine with: memory

Backtest a simple strategy idea on historical prices

👤 Retail traders prototyping ⏱ ~20 min intermediate

When to use: You have an idea like "buy SPY when RSI < 30, sell at > 70" and want a quick historical sanity check.

Flow
  1. Pull history
    Pull 5y daily OHLC for SPY.✓ Copied
    → Time series returned as array
  2. Compute
    Compute RSI(14). Run the "buy<30, sell>70" strategy. Report CAGR, max drawdown, trade count vs buy-and-hold.✓ Copied
    → Strategy metrics with honest comparison to baseline
  3. Reality check
    Account for commissions ($1/trade) and slippage (5bps). Does the edge survive?✓ Copied
    → Net-of-costs figures

Outcome: A go/no-go decision on testing the idea further.

Pitfalls
  • Survivorship bias — only liquid tickers are in yfinance — For serious backtesting, use a dedicated dataset; yfinance is for sketching
Combine with: alpaca

Combinations

Pair with other MCPs for X10 leverage

yfinance-mcp + alpaca

yfinance for research, Alpaca for actual orders

Pick 3 ideas via yfinance, place paper trades via Alpaca.✓ Copied
yfinance-mcp + memory

Track your own thesis on tickers over time

Store the thesis on NVDA as of today, along with the price.✓ Copied

Tools

What this MCP exposes

ToolInputsWhen to callCost
get_quote ticker: str Current price snapshot free
get_history ticker, period: str, interval: str Historical data for charting or backtest free
get_fundamentals ticker Valuation / fundamentals analysis free
get_options ticker, expiry?: date Option chain lookup free
get_news ticker, limit?: int Ticker-level headlines free

Cost & Limits

What this costs to run

API quota
Yahoo's undocumented limits — avoid hammering
Tokens per call
OHLC for 5y ≈ 50k tokens, keep requests focused
Monetary
Free
Tip
Resample to weekly for longer histories; only pull daily when you need it

Security

Permissions, secrets, blast radius

Credential storage: None
Data egress: query1.finance.yahoo.com

Troubleshooting

Common errors and fixes

Returns empty / error for a ticker

Use Yahoo-format symbols (e.g. BRK-B not BRK.B); some exchanges need suffix (.T for Tokyo)

JSONDecodeError

Yahoo rate-limited you. Back off for a few minutes, or run fewer tickers per batch.

Package out of date

uvx --upgrade yfinance-mcp — Yahoo breaks things regularly

Alternatives

YFinance MCP vs others

AlternativeWhen to use it insteadTradeoff
Alpaca MCPYou want real brokerage data + order placementRequires Alpaca account
Polygon / FinnhubYou need production-grade, low-latency dataPaid; no MCP (yet)

More

Resources

📖 Read the official README on GitHub

🐙 Browse open issues

🔍 Browse all 400+ MCP servers and Skills