Yahoo Finance

io.github.danishashko由 GitHub 帳號 danishashko 發布v1.6.2更新於 Nov 7, 2026

Yahoo Finance data: quotes, financials, earnings, screeners, funds, sectors, options, and news.

發布方自己的服務:Finance Foundation

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

概覽

AI 產生的概覽

在本機執行、唯讀的 MCP 伺服器,讓助理取得 Yahoo 財經的行情、財報、盈餘、選擇權、持股、篩選器、基金與新聞資料。

可以做什麼
  • 查詢即時報價、歷史 OHLCV 價格、公司簡介與關鍵統計
  • 讀取年度損益表、資產負債表、現金流量表、股利與拆股紀錄
  • 查看分析師評等、目標價、前瞻預估、財報日期與財報行事曆
  • 查看選擇權鏈、機構與基金持股、內部人交易,以及 ETF 或共同基金持股
  • 依預設清單篩選股票,瀏覽產業與類股概況,並比較最多十檔股票
  • 搜尋股票代號並依標的取得新聞;結果可為 markdown 或 JSON,並附帶結構化內容
適用情境
適合讓助理回答市場問題、研究公司、比較多檔股票,或取得財報、選擇權與持股資料,而不需要付費資料訂閱或 API 金鑰。
執行需求
透過 npx 在本機執行,需要 Node.js 16+ 與 Python 3.10+(首次啟動時包裝器會建立 Python 環境)。不需要 API 金鑰、帳號或註冊。需要能連線至 Yahoo 財經的網路。可選擇以 Streamable HTTP 在本機連接埠提供服務,供僅支援 URL 的用戶端使用。
安裝前請注意
所有工具皆為唯讀,無法下單或變更任何內容。請求直接送往 Yahoo 財經,因此查詢內容與 IP 對其可見;不儲存也不代理。Yahoo 依 IP 限制約每小時 2,000 次請求,部分報價可能延遲 15 至 20 分鐘。HTTP 模式不附身分驗證,應只綁定在可信任的介面。資料使用受 Yahoo 條款約束,本專案與 Yahoo 無關。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

Yahoo Finance MCP Server 📈

[npm version] [npm downloads] [Python] [License: MIT]

Free Yahoo Finance MCP server with no API key. 18 read-only tools give Claude, Claude Code, Cursor, VS Code, Windsurf, Codex, n8n or any other MCP client live stock quotes, historical prices, financial statements, earnings dates and calendars, analyst ratings and estimates, options chains, insider and institutional holders, stock screeners, ETF and fund holdings, sector overviews and market news. Runs locally with one npx command, over stdio or Streamable HTTP.

npm package: yahoo-finance-mcp-server · GitHub repo: danishashko/yahoo-finance-mcp. The repo name is shorter than the package name; both refer to this project.

🎯 What You Get

  • 📊 Real-time stock quotes with full market data
  • 📈 Historical prices (OHLCV) with summary statistics
  • 🏢 Company profiles, officers, and key statistics
  • 💰 Financial statements (income, balance sheet, cash flow)
  • 🎯 Analyst ratings, price targets, and the recent recommendation trend
  • ⚖️ Multi-stock comparisons side by side
  • 📰 Latest financial news per ticker
  • 🧾 Options chains (calls/puts, strikes, IV, open interest)
  • 🏦 Ownership data — institutional, mutual fund, and insider activity
  • 💵 Dividend & split history
  • 🔮 Forward analyst estimates (price targets, EPS/revenue, growth)
  • 🔎 Symbol search by company name or keyword
  • 🕒 Market status (open/closed) and index summary
  • 📅 Earnings dates: next report, beat/miss history, and a market-wide earnings calendar
  • 🧲 Stock screeners: day gainers/losers, most active, most shorted, undervalued growth, top ETFs
  • 🧺 ETF and fund data: holdings, expense ratio, sector weights
  • 🏭 Sector and industry overviews with their largest, fastest-growing and best-performing companies

Every tool returns human-readable markdown by default, or structured JSON on request (response_format: "json"). Requests share a single browser-impersonating HTTP session to reduce Yahoo Finance rate-limiting.

🚀 Quick Start

Add this to your Claude Desktop config and restart Claude:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
json
{  "mcpServers": {    "yahoo-finance": {      "command": "npx",      "args": ["-y", "yahoo-finance-mcp-server"]    }  }}

That is it. On first launch the npx wrapper creates an isolated Python environment and installs the dependencies for you (a one-time step that can take a minute). You only need Python 3.10+ and Node.js 16+ on your machine.

Other clients

Claude Code

bash
claude mcp add yahoo-finance -- npx -y yahoo-finance-mcp-server

Cursor (~/.cursor/mcp.json), Windsurf (~/.codeium/windsurf/mcp_config.json) and Gemini CLI (~/.gemini/settings.json) take the same mcpServers block as Claude Desktop above.

VS Code (.vscode/mcp.json)

json
{  "servers": {    "yahoo-finance": {      "type": "stdio",      "command": "npx",      "args": ["-y", "yahoo-finance-mcp-server"]    }  }}

Codex CLI (~/.codex/config.toml)

toml
[mcp_servers.yahoo-finance]command = "npx"args = ["-y", "yahoo-finance-mcp-server"]

n8n and other URL-only clients: see HTTP mode.

Prefer a global install?

bash
npm install -g yahoo-finance-mcp-server
json
{  "mcpServers": {    "yahoo-finance": {      "command": "yahoo-finance-mcp-server"    }  }}

🌐 HTTP mode (n8n, remote agents, anything that connects to a URL)

Some clients spawn an MCP server as a child process and talk to it over stdio; others only take a URL. n8n's MCP Client Tool node is the second kind - it offers HTTP Streamable and SSE and no way to launch a command - so stdio alone puts the server out of reach.

--http serves the same 18 tools over Streamable HTTP at /mcp:

bash
npx -y yahoo-finance-mcp-server --http# -> http://127.0.0.1:8000/mcp
FlagDefaultWhat it does
--httpoffServe Streamable HTTP at /mcp instead of stdio
--host127.0.0.1Interface to bind
--port8000Port to bind
--allowed-hostsee belowHost header to accept, repeatable
--statefuloffKeep a session per client instead of stateless

No authentication is added, so keep it on an interface you trust.

Reaching it from a container

n8n in Docker is not on your loopback interface, so bind wider and use the host alias:

bash
npx -y yahoo-finance-mcp-server --http --host 0.0.0.0 --port 8931

Then point the MCP Client Tool node at http://host.docker.internal:8931/mcp with authentication set to None.

DNS-rebinding protection stays on when you bind wider. localhost, 127.0.0.1 and host.docker.internal on the bound port are accepted by default; any other name needs --allowed-host name:port, and a request arriving under an unlisted name gets 421 Misdirected Request.

🔧 Available Tools

ToolWhat it returnsParameters
get_stock_quoteCurrent price, change, day and 52-week range, volume, market cap, P/E, EPS, dividend yieldticker
get_historical_pricesOHLCV history with summary stats and total returnticker, period, interval
get_company_infoBusiness summary, key executives, valuation and financial highlightsticker
get_financial_statementsAnnual income statement, balance sheet, and cash flowticker
compare_stocksKey metrics for multiple tickers side by side, plus quick insightstickers (2 to 10)
get_analyst_recommendationsPrice targets, consensus, recommendation trend, and recent upgrades/downgradesticker
get_market_newsLatest news headlines with source, date, summary, and linkticker, count
get_options_chainExpiration dates, or the calls/puts chain (strike, bid/ask, volume, OI, IV)ticker, expiration_date, option_type
get_holdersInstitutional, mutual-fund, or major holders, or insider transactionsticker, holder_type
get_dividends_splitsDividend payment history (with summary) and stock-split historyticker
get_analyst_estimatesForward price targets, EPS/revenue estimates by period, and growth estimatesticker
search_symbolsFind ticker symbols by company name or keywordquery, count
get_market_statusWhether a market is open/closed, with timing and a major-index summaryregion
get_earningsNext earnings date (days away, EPS and revenue estimates), ex-dividend date, beat/miss historyticker, limit
get_earnings_calendarEvery company reporting in a date range, with timing and EPS estimatestart_date, end_date, min_market_cap, limit
screen_stocksResults of a Yahoo predefined screener with price, change, relative volume, P/Escreener, count
get_fund_dataETF or mutual fund holdings, expense ratio, sector weights, asset classesticker
get_sector_overviewSector or industry overview, largest companies, industries, top growers and performerssector, industry, limit

Every tool also accepts response_format ("markdown", the default, or "json").

Every result also carries the data as MCP structured content, described by the tool's published outputSchema, whichever text format you ask for. Clients that support structured output read typed fields directly; others read the text. Missing figures are null, and a failed call returns isError: true with a message saying what to change.

get_historical_prices options:

  • period: 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max
  • interval: 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo

get_options_chain: call without expiration_date to list available dates, then again with a date. option_type is calls, puts, or both. A chain returns the strikes nearest the current price.

get_holders: holder_type is institutional, mutualfund, major, insider_transactions, insider_purchases (6-month net insider buying), or insider_roster.

screen_stocks: screener is one of day_gainers, day_losers, most_actives, most_shorted_stocks, small_cap_gainers, aggressive_small_caps, growth_technology_stocks, undervalued_growth_stocks, undervalued_large_caps, top_etfs_us, top_performing_etfs, technology_etfs, bond_etfs, top_mutual_funds, solid_large_growth_funds, solid_midcap_growth_funds, conservative_foreign_funds, high_yield_bond, portfolio_anchors.

get_sector_overview: sector is one of basic-materials, communication-services, consumer-cyclical, consumer-defensive, energy, financial-services, healthcare, industrials, real-estate, technology, utilities. Call without industry to get the list of industry keys.

💬 Example Prompts

Once the server is connected, just ask Claude:

  • "What's the current price of Apple stock?"
  • "Show me Amazon's stock performance over the last year"
  • "Tell me about Tesla as a company and who runs it"
  • "Show me Apple's income statement"
  • "Compare AAPL, MSFT, and GOOGL"
  • "What do analysts think about Amazon, and what's the price target?"
  • "What's the latest news on NVIDIA?"
  • "Show me the SPY call options expiring next month"
  • "Who are the biggest institutional holders of Apple?"
  • "What's Coca-Cola's dividend history?"
  • "When does NVIDIA report next, and has it been beating estimates?"
  • "Which large caps report earnings this week?"
  • "What are today's biggest gainers?"
  • "What's inside QQQ and what does it cost?"
  • "Who are the biggest semiconductor companies?"
  • "Are Tesla insiders net buying or selling?"

❓ FAQ

Does it need an API key or a paid plan? No. It reads Yahoo Finance's public data through the yfinance library. There is no key, account or signup.

Is the data real-time? Quotes are near real-time for most US stocks and can be delayed about 15 minutes on some exchanges. Every quote states its exchange, market state and timestamp.

Which tickers work? Any symbol Yahoo Finance lists: US stocks (AAPL), class shares (BRK.B or BRK-B), non-US listings with Yahoo's exchange suffix (7203.T, BP.L, SAP.DE), ETFs and mutual funds (SPY, VFIAX), indices (^GSPC), crypto (BTC-USD) and currencies (EURUSD=X). Case does not matter. If you only have a company name, search_symbols finds the ticker.

Can it place trades or change anything? No. Every tool is read-only.

Does it work with clients other than Claude? Yes. It speaks standard MCP, so any client that supports MCP over stdio or Streamable HTTP can use it. Setup for the common ones is under Quick Start.

How do agents get structured data? Every result carries typed structuredContent matching the tool's outputSchema, whatever text format was asked for. Pass response_format: "json" to get JSON text as well.

Where is the machine-readable summary? llms.txt lists every tool, limit and error behaviour in one page for agents.

🐛 Troubleshooting

"Command not found" / "Python not found" Make sure Python and Node.js are installed and on your PATH. On macOS/Linux, try python3 instead of python in the config.

"Module not found: yfinance" (manual install only) Install the dependencies:

bash
pip install yfinance curl_cffi pandas tabulate mcp pydantic httpx

Tools not showing up in Claude

  1. Confirm the config file is valid JSON (no trailing commas).
  2. Fully quit and reopen Claude Desktop.
  3. Check the path in your config actually exists.

"Error fetching data"

  • Check your internet connection.
  • Verify the ticker symbol (for example AAPL, not Apple).
  • Some smaller companies have limited data, and Yahoo Finance can be briefly unavailable.

Using a different model or provider (LiteLLM, OpenRouter, NVIDIA NIM, a local model) This server never talks to a model. Your client starts it as a local process and speaks JSON-RPC over stdin/stdout, so changing ANTHROPIC_BASE_URL or swapping the model behind your client has no effect on it. If tools stop firing after a switch like that, check two things: the model has to support function calling, and a proxy configured to drop unsupported parameters can silently strip your tool definitions, which produces no error at all. Run /mcp in your client (or claude mcp list) to confirm the server is connected before suspecting the server.

🛠️ Manual Installation (Alternative)

If you would rather run the Python file directly instead of via npx:

1. Download the server

Save yahoo_finance_mcp.py somewhere on your machine and install the dependencies:

bash
pip install yfinance curl_cffi pandas tabulate mcp pydantic httpx

(or pip3 on macOS/Linux)

2. Point Claude Desktop at it

json
{  "mcpServers": {    "yahoo-finance": {      "command": "python3",      "args": ["/absolute/path/to/yahoo_finance_mcp.py"]    }  }}

On Windows use "command": "python" and a path like "C:\\path\\to\\yahoo_finance_mcp.py" (double backslashes or forward slashes).

3. Restart Claude Desktop.

🔒 Privacy & Rate Limits

  • Uses the free Yahoo Finance API via the yfinance library.
  • Requests go straight to Yahoo Finance. Nothing is stored or proxied.
  • Yahoo Finance rate-limits roughly 2,000 requests/hour per IP.
  • Intended for personal, educational, and research use.

📝 Notes

  • Tickers are case-insensitive, and BRK.B is accepted as well as Yahoo's BRK-B.
  • Some quotes may be delayed 15 to 20 minutes.
  • Financial statements are generally available for larger public companies.

📋 Changelog

See CHANGELOG.md for the full version history.

📚 Resources

⚖️ Legal Disclaimer

This tool uses Yahoo Finance's publicly available data through the yfinance library. Yahoo!, Y!Finance, and Yahoo! Finance are registered trademarks of Yahoo, Inc. This tool is not affiliated with, endorsed by, or vetted by Yahoo, Inc. Please refer to Yahoo!'s terms of use for details on your rights to use the data.

👤 Author

Daniel Shashko

📄 License

MIT © Daniel Shashko

來源:README.md,提交 2cf281a

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:伺服器未在限時內回應。

版本歷史

3
  1. v1.6.2最新Nov 7, 2026
  2. v1.6.0Nov 7, 2026
  3. v1.2.4Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Finance 整合