yfinance-ai: Yahoo Finance

Yahoo Finance in 68 tools: stocks, crypto, forex, commodities, funds, options, analysts, calendars.

AI & MLPythonv5.0.5

yfinance-ai MCP server

PyPI License: MIT

World's first AI-powered Yahoo Finance integration: 68 tools for stocks, ETFs, mutual funds, crypto, forex and commodities, in one Python file.

🚀 Thousands of downloads on ClawHub and OpenWebUI

Prices and history, financial statements, ratios and valuation history, analyst estimates and price targets, earnings, dividends, options, holders and insiders, funds and ETFs, market movers, sectors and industries, and earnings, IPO, economic and split calendars.

Use it inInstallRepo
Claude, Cursor, VS Code, LangChain, Google ADK, Strands Agents and other MCP clientsuvx yfinance-ai@latestyfinance-ai-mcp
ClawHub skill for OpenClaw 🚀 Thousands of downloadsopenclaw skills install @lkcair/stocksyfinance-ai-skill
OpenWebUI tool 🚀 Thousands of downloadsGet it on openwebui.comyfinance-ai
Pythonfrom yfinance_ai import Toolsyfinance-ai

Install

Needs uv. No API key.

Claude Code:

claude mcp add yfinance-ai -- uvx yfinance-ai@latest

VS Code:

code --add-mcp '{"name":"yfinance-ai","type":"stdio","command":"uvx","args":["yfinance-ai@latest"]}'

Claude Desktop, Cursor, Windsurf and other clients, in the client's MCP config file:

{
  "mcpServers": {
    "yfinance-ai": {
      "command": "uvx",
      "args": [
        "yfinance-ai@latest"
      ]
    }
  }
}

@latest picks up new releases when the client starts. Without uv: pip install yfinance-ai, then use "command": "yfinance-ai" with no args.

Listed in the MCP Registry as io.github.lkcair/yfinance-ai. Every tool is read-only.

Agent frameworks

The server runs over stdio with uvx yfinance-ai@latest, so any framework with MCP support can load all its tools.

LangChain: pip install "langchain[mcp]" langchain-anthropic

import asyncio
from langchain.agents import create_agent
from langchain.mcp import MCPAdapter

async def main():
    config = {"mcpServers": {"yfinance-ai": {
        "command": "uvx", "args": ["yfinance-ai@latest"],
    }}}
    async with MCPAdapter(config) as adapter:
        tools = await adapter.list_tools()
        agent = create_agent("claude-sonnet-5", tools)
        result = await agent.ainvoke({"messages": [{"role": "user", "content": "What is Apple's P/E, and how does it compare with Microsoft and Google?"}]})
        print(result["messages"][-1].content)

asyncio.run(main())

Google ADK: pip install "google-adk[mcp]"

from google.adk.agents import LlmAgent
from google.adk.tools.mcp_tool import McpToolset
from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams
from mcp import StdioServerParameters

root_agent = LlmAgent(
    model="gemini-flash-latest",
    name="yfinance_ai",
    instruction="Answer with the yfinance-ai tools.",
    tools=[McpToolset(connection_params=StdioConnectionParams(
        server_params=StdioServerParameters(command="uvx", args=["yfinance-ai@latest"]),
        timeout=60,
    ))],
)

Strands Agents: pip install strands-agents

from mcp import stdio_client, StdioServerParameters
from strands import Agent
from strands.tools.mcp import MCPClient

yfinance_ai = MCPClient(lambda: stdio_client(StdioServerParameters(
    command="uvx", args=["yfinance-ai@latest"],
)))
agent = Agent(tools=[yfinance_ai])
agent("What is Apple's P/E, and how does it compare with Microsoft and Google?")

Example questions

  • What is Apple's P/E, and how does it compare with Microsoft and Google?
  • What are analysts saying about NVIDIA? Price targets and recent upgrades.
  • Who reports earnings this week?
  • Bitcoin price, EUR/USD rate and gold today.

MCP tools (68)

Quotes and history

ToolParametersDescription
get_stock_pricetickerGet current stock price and key metrics for a ticker symbol
get_stock_quotetickerGet detailed quote with bid/ask, day range, and trading info
get_fast_infotickerGet fast-access ticker information (lightweight, quick response)
get_historical_dataticker, period="1y", interval="1d"Get historical price data for a stock
get_historical_price_on_dateticker, dateGet historical price for a specific date
download_multiple_tickerstickers, period="1mo", interval="1d"Historical data for several tickers at once

Company

ToolParametersDescription
get_company_infotickerGet detailed company information and business description
get_company_overviewtickerCompany overview with context for every metric
get_company_officerstickerGet company officers and key management
get_isintickerGet International Securities Identification Number (ISIN) for a ticker

Financials

ToolParametersDescription
get_income_statementticker, period="annual"Get income statement data
get_balance_sheetticker, period="annual"Get balance sheet data
get_cash_flowticker, period="annual"Get cash flow statement data
get_ttm_financialstickerGet trailing-twelve-month (TTM) income statement and cash flow
get_key_ratiostickerGet key financial ratios and valuation metrics
get_valuation_historytickerGet valuation measures now and for the last quarters (market cap, EV, P/E, PEG, P/S, P/B, EV/EBITDA)
get_financial_summarytickerGet a comprehensive one-page financial summary of a stock
get_shares_historyticker, years=3Get shares outstanding over time (dilution or buybacks)

Earnings and estimates

ToolParametersDescription
get_earnings_datestickerGet upcoming and past earnings dates with estimates
get_earnings_historytickerGet historical earnings data with annual and quarterly figures
get_earnings_calendartickerGet earnings calendar including next earnings date and dividend dates
get_analyst_estimatestickerGet analyst estimates for earnings, revenue, and EPS
get_growth_estimatestickerGet analyst growth estimates
get_eps_trendtickerGet EPS (Earnings Per Share) trend data showing how estimates have changed
get_eps_revisionstickerGet EPS revision data showing analyst estimate changes

Analysts

ToolParametersDescription
get_analyst_recommendationstickerGet analyst recommendations and ratings
get_analyst_price_targetstickerGet detailed analyst price targets for a stock
get_upgrades_downgradesticker, limit=20Get detailed analyst upgrades and downgrades history

Holders and insiders

ToolParametersDescription
get_institutional_holderstickerGet major institutional holders and their ownership
get_major_holderstickerGet major holders summary (institutions, insiders, public float)
get_mutualfund_holderstickerGet mutual fund holders
get_insider_transactionstickerGet recent insider trading activity
get_insider_purchasestickerGet insider purchases only (filtered for buys)
get_insider_roster_holderstickerGet insider roster (list of company insiders)

Dividends and corporate actions

ToolParametersDescription
get_dividendsticker, period="5y"Get dividend payment history and current metrics
get_stock_splitstickerGet stock split history
get_corporate_actionstickerGet all corporate actions (dividends + splits combined)
get_capital_gainstickerGet capital gains distributions (primarily for funds/ETFs)

Options

ToolParametersDescription
get_options_chainticker, expiration=""Get options chain data (calls and puts)
get_options_expirationstickerGet all available options expiration dates

Market-wide

ToolParametersDescription
get_market_statusCheck if US stock markets are currently open
get_market_summaryregion="US"Get a market overview for a region: open/closed status plus main indices, futures, bonds and FX
get_market_indicesGet current prices for major market indices
get_market_moverscategory="day_gainers", count=10Get today's market movers from Yahoo Finance screeners
get_trending_tickerscount=10Get today's most active (trending) US tickers
get_sector_performanceGet performance of major market sectors
get_sector_overviewsector="technology"Get a sector overview: size, weight, largest companies, industries and sector ETFs
get_industry_overviewindustry="semiconductors"Get an industry overview: largest, best-performing and fastest-growing companies

Calendars

ToolParametersDescription
get_upcoming_earningsdays=7, limit=25Get the market-wide earnings calendar (which companies report in the next N days)
get_ipo_calendardays=14, limit=25Get upcoming IPOs (exchange, expected date, price range, shares)
get_economic_calendardays=7, limit=30Get upcoming economic events (CPI, jobs, GDP, rate decisions) with expected and prior values
get_splits_calendardays=14, limit=25Get upcoming stock splits

Funds and ETFs

ToolParametersDescription
get_fund_overviewtickerGet overview data for an ETF or mutual fund
get_fund_holdingsticker, limit=25Get top holdings for an ETF or mutual fund
get_fund_sector_weightstickerGet sector allocation/weights for an ETF or mutual fund

Crypto, forex and commodities

ToolParametersDescription
get_crypto_pricesymbolGet cryptocurrency price and market data
get_forex_ratepairGet foreign exchange (forex) rate for a currency pair
get_commodity_pricecommodityGet commodity/futures price data

Compare

ToolParametersDescription
compare_stockstickersCompare key metrics across multiple stocks
get_peer_comparisonticker, peers=nullCompare a stock with its peers on key metrics
get_historical_comparisontickers, period="1y"Compare historical price performance of multiple stocks
get_complete_analysisticker, peers=""Complete analysis of a stock, calling every relevant tool

News and filings

ToolParametersDescription
get_stock_newsticker, limit=10Get recent news articles about a stock
get_sec_filingstickerGet recent SEC filings (10-K, 10-Q, 8-K, etc.)

Utility

ToolParametersDescription
search_tickerquerySearch for ticker symbols by company name or keyword
validate_tickertickerValidate if a ticker symbol exists and is tradeable
get_api_statusGet API status and usage information
run_self_testticker="SPY"Run comprehensive self-test of the yfinance-ai tools (64 checks)

License

MIT. Data comes from Yahoo Finance through yfinance and may be delayed. Not affiliated with Yahoo. For research and education, not investment advice.

Installation

Source-derived launch command. Check the maintainer’s required arguments and credentials before running:

bash
uvx yfinance-ai

Set up in your AI client

Merge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.

json
{
  "mcpServers": {
    "io-github-lkcair-yfinance-ai": {
      "command": "uvx",
      "args": [
        "yfinance-ai"
      ]
    }
  }
}

Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.

Claude Desktop setup reference

Package

yfinance-aipypi

Compatible MCP Clients

yfinance-ai: Yahoo Finance works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.

  • Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.
  • Cursor~/.cursor/mcp.jsonRestart Cursor for changes to take effect.
  • VS Code.vscode/mcp.jsonReload VS Code window for changes to take effect.
  • Windsurf~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect.
  • Claude Code.mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.

Learn More