yfinance-ai: Yahoo Finance

io.github.lkcair由 GitHub 帳號 lkcair 發布v5.0.5更新於 Oct 29, 2026

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

發布方自己的服務:Finance Foundation

已驗證STDIO僅桌面金融資料與分析

概覽

AI 產生的概覽

本機 MCP 伺服器,提供 68 個唯讀的 Yahoo Finance 工具,讓助理查詢股票、基金、加密貨幣、外匯與商品市場資料。

可以做什麼
  • 查詢報價、價格、歷史行情與指定日期價格,並支援批次下載與代號搜尋
  • 讀取財務報表、財務比率、估值歷史、TTM 數據與股本變化
  • 取得分析師預估、目標價、評等、調升調降紀錄,以及財報日期與歷史
  • 查看股東、內部人交易、股利、股票分割、選擇權鏈、基金與 ETF 資訊
  • 查詢市場開閉狀態、指數、漲跌排行、產業與類股概覽,以及財報、IPO、經濟與分割行事曆
  • 比較多檔股票與同業,取得新聞與 SEC 文件,並對單一股票執行完整多工具分析
適用情境
適合讓助理在對話中直接回答公開市場、公司基本面、分析師看法或即將發生的市場事件相關問題,並對多檔股票做並列比較。
執行需求
以 stdio 方式在本機執行,需要 uv(uvx yfinance-ai@latest)或 pip install yfinance-ai;不需要 API 金鑰或帳號;需要連網存取 Yahoo Finance 資料。
安裝前請注意
報價可能延遲約 15 分鐘,輸出不構成投資建議。新聞標題與摘要屬第三方文字,助理應如實轉述而非遵從其中指令。get_complete_analysis 與 run_self_test 會發出大量請求,僅在確實需要該深度時使用。所有工具皆為唯讀。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 yfinance-ai: Yahoo Finance,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

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:

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

VS Code:

bash
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:

json
{  "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

python
import asynciofrom langchain.agents import create_agentfrom 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]"

python
from google.adk.agents import LlmAgentfrom google.adk.tools.mcp_tool import McpToolsetfrom google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParamsfrom 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

python
from mcp import stdio_client, StdioServerParametersfrom strands import Agentfrom 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.

來源:README.md,提交 2477fa8

工具

68

compare_stocks

Compare Stocks

Compare key metrics across multiple stocks. Returns: Comparison table of price, market cap, P/E, dividend yield, and returns

輸入參數tickers必填

download_multiple_tickers

Download Multiple Tickers

Download historical data for multiple tickers at once (bulk operation). Returns: Summary of downloaded data for all tickers

輸入參數periodtickers必填interval

get_analyst_estimates

Analyst Estimates

Get analyst estimates for earnings, revenue, and EPS. Returns: Comprehensive analyst estimates and forecasts

輸入參數ticker必填

get_analyst_price_targets

Analyst Price Targets

Get detailed analyst price targets for a stock. Returns: Comprehensive price target data including current, low, mean, median, high targets and the number of analysts covering the stock

輸入參數ticker必填

get_analyst_recommendations

Analyst Recommendations

Get analyst recommendations and ratings. Returns: Analyst buy/hold/sell recommendations, consensus, and recent upgrades/downgrades

輸入參數ticker必填

get_api_status

API Status

Get API status and usage information. Returns: Current API usage statistics and configuration

無需輸入參數。

get_balance_sheet

Balance Sheet

Get balance sheet data. Returns: Balance sheet with assets, liabilities, and equity

輸入參數periodticker必填

get_capital_gains

Capital Gains

Get capital gains distributions (primarily for funds/ETFs). Returns: Capital gains distribution history

輸入參數ticker必填

get_cash_flow

Cash Flow

Get cash flow statement data. Returns: Cash flow statement with operating, investing, and financing activities

輸入參數periodticker必填

get_commodity_price

Commodity Price

Get commodity/futures price data. Returns: Current price, day change, and key market data

輸入參數commodity必填

get_company_info

Company Info

Get detailed company information and business description. Returns: Company overview including sector, industry, employees, website, and business summary

輸入參數ticker必填

get_company_officers

Company Officers

Get company officers and key management. Returns: List of company officers with titles and compensation

輸入參數ticker必填

get_company_overview

Company Overview

Get a beautiful, insightful company overview with context for every metric. Perfect for quick overviews and basic questions about a company. Returns: Beautifully formatted company overview with insights and context

輸入參數ticker必填

get_complete_analysis

Complete Analysis

Run a complete analysis of a stock by calling ALL available functions. This is the most comprehensive analysis available - use when user asks for "everything about" or "complete analysis of" a company. Returns: Comprehensive analysis with results from all applicable functions

輸入參數peersticker必填

get_corporate_actions

Corporate Actions

Get all corporate actions (dividends + splits combined). Returns: Combined history of dividends and stock splits

輸入參數ticker必填

get_crypto_price

Crypto Price

Get cryptocurrency price and market data. Returns: Current price, 24h change, market cap, volume, and key metrics

輸入參數symbol必填

get_dividends

Dividends

Get dividend payment history and current metrics. Returns: Dividend history and current dividend metrics

輸入參數periodticker必填

get_earnings_calendar

Earnings Calendar

Get earnings calendar including next earnings date and dividend dates. Returns: Upcoming earnings dates, ex-dividend dates, and dividend payment dates

輸入參數ticker必填

get_earnings_dates

Earnings Dates

Get upcoming and past earnings dates with estimates. Returns: Earnings calendar with dates, estimates, and actual results

輸入參數ticker必填

get_earnings_history

Earnings History

Get historical earnings data with annual and quarterly figures. Returns: Historical earnings by year and quarter

輸入參數ticker必填

get_economic_calendar

Economic Calendar

Get upcoming economic events (CPI, jobs, GDP, rate decisions) with expected and prior values. Returns: Table of economic events by region and time

輸入參數dayslimit

get_eps_revisions

EPS Revisions

Get EPS revision data showing analyst estimate changes. Returns: EPS revisions showing up/down estimate changes by analysts

輸入參數ticker必填

get_eps_trend

EPS Trend

Get EPS (Earnings Per Share) trend data showing how estimates have changed. Returns: EPS trend data showing estimate changes over different time periods

輸入參數ticker必填

get_fast_info

Fast Info

Get fast-access ticker information (lightweight, quick response). Returns: Quick summary with most recent price, market cap, and basic metrics

輸入參數ticker必填

get_financial_summary

Financial Summary

Get a comprehensive one-page financial summary of a stock. Returns: Comprehensive summary including price, valuation, financials, and analyst data

輸入參數ticker必填

get_forex_rate

Forex Rate

Get foreign exchange (forex) rate for a currency pair. Returns: Current exchange rate, bid/ask, day range, and recent changes

輸入參數pair必填

get_fund_holdings

Fund Holdings

Get top holdings for an ETF or mutual fund. Returns: List of top holdings with weights and values

輸入參數limitticker必填

get_fund_overview

Fund Overview

Get overview data for an ETF or mutual fund. Returns: Fund category, family, total assets, expense ratio, and other key metrics

輸入參數ticker必填

get_fund_sector_weights

Fund Sector Weights

Get sector allocation/weights for an ETF or mutual fund. Returns: Sector allocation percentages for the fund

輸入參數ticker必填

get_growth_estimates

Growth Estimates

Get analyst growth estimates. Returns: Growth rate estimates for various periods

輸入參數ticker必填

get_historical_comparison

Historical Comparison

Compare historical price performance of multiple stocks. Returns: Performance comparison showing % returns for each ticker

輸入參數periodtickers必填

get_historical_data

Historical Data

Get historical price data for a stock. Returns: Historical price data summary with statistics and returns

輸入參數periodticker必填interval

get_historical_price_on_date

Historical Price on Date

Get historical price for a specific date. Returns: Price on that date (or closest trading day)

輸入參數date必填ticker必填

get_income_statement

Income Statement

Get income statement data. Returns: Income statement with revenue, expenses, and net income

輸入參數periodticker必填

get_industry_overview

Industry Overview

Get an industry overview: largest, best-performing and fastest-growing companies. Returns: Industry summary with top companies by size, YTD performance and growth

輸入參數industry

get_insider_purchases

Insider Purchases

Get insider purchases only (filtered for buys). Returns: Recent insider purchase transactions

輸入參數ticker必填

get_insider_roster_holders

Insider Roster Holders

Get insider roster (list of company insiders). Returns: List of company insiders and their positions

輸入參數ticker必填

get_insider_transactions

Insider Transactions

Get recent insider trading activity. Returns: Recent insider buy/sell transactions

輸入參數ticker必填

get_institutional_holders

Institutional Holders

Get major institutional holders and their ownership. Returns: List of institutional holders with shares owned and percentage ownership

輸入參數ticker必填

get_ipo_calendar

IPO Calendar

Get upcoming IPOs (exchange, expected date, price range, shares). Returns: Table of upcoming IPOs

輸入參數dayslimit

get_isin

ISIN

Get International Securities Identification Number (ISIN) for a ticker. Returns: ISIN code and related identification information

輸入參數ticker必填

get_key_ratios

Key Ratios

Get key financial ratios and valuation metrics. Returns: Comprehensive ratios including P/E, P/B, ROE, ROA, profit margins, debt ratios

輸入參數ticker必填

get_major_holders

Major Holders

Get major holders summary (institutions, insiders, public float). Returns: Summary of insider vs institutional ownership percentages

輸入參數ticker必填

get_market_indices

Market Indices

Get current prices for major market indices. Returns: Current values and changes for S&P 500, Nasdaq, Dow Jones, and other major indices

無需輸入參數。

get_market_movers

Market Movers

Get today's market movers from Yahoo Finance screeners. Returns: Table of tickers with price, change %, volume and market cap

輸入參數countcategory

get_market_status

Market Status

Check if US stock markets are currently open. Returns: Market status (open/closed), current time, and market hours

無需輸入參數。

get_market_summary

Market Summary

Get a market overview for a region: open/closed status plus main indices, futures, bonds and FX. Returns: Market status and a table of the region's headline instruments

輸入參數region

get_mutualfund_holders

Mutual Fund Holders

Get mutual fund holders. Returns: List of mutual funds holding the stock

輸入參數ticker必填

get_options_chain

Options Chain

Get options chain data (calls and puts). Returns: Options chain with top calls and puts by volume

輸入參數ticker必填expiration

get_options_expirations

Options Expirations

Get all available options expiration dates. Returns: List of all available options expiration dates

輸入參數ticker必填

get_peer_comparison

Peer Comparison

Compare a stock with its peers on key metrics. Returns: Comparison table of key metrics across stocks

輸入參數peersticker必填

get_sec_filings

SEC Filings

Get recent SEC filings (10-K, 10-Q, 8-K, etc.). Returns: Recent SEC filings with types and dates

輸入參數ticker必填

get_sector_overview

Sector Overview

Get a sector overview: size, weight, largest companies, industries and sector ETFs. Returns: Sector summary with top companies and its industries

輸入參數sector

get_sector_performance

Sector Performance

Get performance of major market sectors. Returns: Performance data for major S&P 500 sectors

無需輸入參數。

get_shares_history

Shares History

Get shares outstanding over time (dilution or buybacks). Returns: Shares outstanding at several points and the total change

輸入參數yearsticker必填

get_splits_calendar

Splits Calendar

Get upcoming stock splits. Returns: Table of upcoming splits with ratios

輸入參數dayslimit

get_stock_news

Stock News

Get recent news articles about a stock. Returns: Recent news headlines, sources, and links

輸入參數limitticker必填

get_stock_price

Stock Price

Get current stock price and key metrics for a ticker symbol. Returns: Formatted string with current price, market cap, P/E ratio, and other key metrics

輸入參數ticker必填

get_stock_quote

Stock Quote

Get detailed quote with bid/ask, day range, and trading info. Returns: Detailed quote information including bid/ask spreads and intraday trading data

輸入參數ticker必填

get_stock_splits

Stock Splits

Get stock split history. Returns: Complete stock split history with dates and ratios

輸入參數ticker必填

get_ttm_financials

TTM Financials

Get trailing-twelve-month (TTM) income statement and cash flow. Returns: Key TTM lines: revenue, gross profit, operating income, net income, EBITDA, EPS, cash flows

輸入參數ticker必填

get_upcoming_earnings

Upcoming Earnings

Get the market-wide earnings calendar (which companies report in the next N days). Returns: Companies with report date, timing and EPS estimate

輸入參數dayslimit

get_upgrades_downgrades

Upgrades and Downgrades

Get detailed analyst upgrades and downgrades history. Returns: Recent analyst rating changes including firm, action, and grade changes

輸入參數limitticker必填

get_valuation_history

Valuation History

Get valuation measures now and for the last quarters (market cap, EV, P/E, PEG, P/S, P/B, EV/EBITDA). Returns: Table of valuation measures by quarter

輸入參數ticker必填

run_self_test

Self-Test

Run comprehensive self-test of the yfinance-ai tools (64 checks). This function is designed to be called by AI assistants to verify that all tools are working correctly. It tests each tool category, reports success/failure status, and shows sample data from each test. Returns: Comprehensive test report with pass/fail status and sample data for all tools

輸入參數ticker

search_ticker

Search Ticker

Search for ticker symbols by company name or keyword. Returns: List of matching tickers

輸入參數query必填

validate_ticker

Validate Ticker

Validate if a ticker symbol exists and is tradeable. Returns: Validation result with ticker details if valid

輸入參數ticker必填

版本歷史

1
  1. v5.0.5最新Oct 21, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Finance 整合