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 集成