/ Diretório / Playground / YFinance MCP
● Comunidade narumiruna ⚡ Instantâneo

YFinance MCP

por 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.

Por que usar

Principais recursos

Demo ao vivo

Como fica na prática

yfinance-mcp.replay ▶ pronto
0/0

Instalar

Escolha seu cliente

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

Abra Claude Desktop → Settings → Developer → Edit Config. Reinicie após salvar.

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

Cursor usa o mesmo esquema mcpServers que o Claude Desktop. Config de projeto vence a global.

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

Clique no ícone MCP Servers na barra lateral do Cline, depois "Edit Configuration".

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

Mesmo formato do Claude Desktop. Reinicie o Windsurf para aplicar.

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

O Continue usa um array de objetos de servidor em vez de um map.

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

Adicione em context_servers. Zed recarrega automaticamente ao salvar.

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

Uma linha só. Verifique com claude mcp list. Remova com claude mcp remove.

Casos de uso

Usos do mundo real: YFinance MCP

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

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

Quando usar: You want a one-prompt briefing on 10 tickers before market open.

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

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

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

Backtest a simple strategy idea on historical prices

👤 Retail traders prototyping ⏱ ~20 min intermediate

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

Fluxo
  1. Pull history
    Pull 5y daily OHLC for SPY.✓ Copiado
    → 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.✓ Copiado
    → Strategy metrics with honest comparison to baseline
  3. Reality check
    Account for commissions ($1/trade) and slippage (5bps). Does the edge survive?✓ Copiado
    → Net-of-costs figures

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

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

Combinações

Combine com outros MCPs para 10× de alavancagem

yfinance-mcp + alpaca

yfinance for research, Alpaca for actual orders

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

Track your own thesis on tickers over time

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

Ferramentas

O que este MCP expõe

FerramentaEntradasQuando chamarCusto
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

Custo e limites

O que custa rodar

Cota de API
Yahoo's undocumented limits — avoid hammering
Tokens por chamada
OHLC for 5y ≈ 50k tokens, keep requests focused
Monetário
Free
Dica
Resample to weekly for longer histories; only pull daily when you need it

Segurança

Permissões, segredos, alcance

Armazenamento de credenciais: None
Saída de dados: query1.finance.yahoo.com

Solução de problemas

Erros comuns e correções

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

Alternativas

YFinance MCP vs. outros

AlternativaQuando usarTroca
Alpaca MCPYou want real brokerage data + order placementRequires Alpaca account
Polygon / FinnhubYou need production-grade, low-latency dataPaid; no MCP (yet)

Mais

Recursos

📖 Leia o README oficial no GitHub

🐙 Ver issues abertas

🔍 Ver todos os 400+ servidores MCP e Skills