yfinance-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
yfinance-mcp
A Model Context Protocol (MCP) server that gives AI agents access to Yahoo Finance market data: real-time quotes, price history, options chains, company fundamentals, financial statements, analyst recommendations, ESG scores, news and predefined stock screeners. No API key is required.
It is read-only: the server only fetches public market data and has no trading or account functionality.
Disclaimer. This project is unofficial and is not affiliated with, endorsed by, or sponsored by Yahoo or Yahoo Finance. It calls Yahoo's unofficial, undocumented web endpoints, which can change or stop working at any time. Data is provided for informational purposes only and is not investment advice. Your use of Yahoo Finance data is subject to Yahoo's terms of service; you are responsible for complying with them.
How it works
Transport: Streamable HTTP, listening on
http://0.0.0.0:7576/mcp(override the port withPORT).Yahoo access: a small built-in client (
src/yf-client.ts) obtains the cookie and crumb Yahoo requires, attaches them to requests, and refreshes them once if Yahoo rejects them.Sessions: every MCP
initializerequest gets its own server and transport, so clients can reconnect freely.Output: tools return Yahoo's JSON, pretty-printed as text. A few tools trim the payload (
yf_newsreturns only the news array,yf_dividends_and_splitsonly theeventsobject).Several tools accept a region code (for example
AR,BR,GB), so Yahoo's non-US markets can be queried. The server adds no special handling beyond passing the code through.
There is no authentication on the HTTP endpoint. Run it on localhost or a trusted network, not exposed to the internet.
Related MCP server: Yahoo Finance MCP Server
Quick start
Docker (prebuilt image)
docker run -d --name yfinance-mcp --restart unless-stopped -p 127.0.0.1:7576:7576 ghcr.io/ejgonzalez90/yfinance-mcp:latestThe examples publish the port on 127.0.0.1 only, because the server has no authentication of its own; drop the 127.0.0.1: prefix only if you put it behind something that does.
Docker Compose (build locally)
git clone https://github.com/ejgonzalez90/yfinance-mcp.git
cd yfinance-mcp
docker compose up -d --buildThe container restarts automatically (unless-stopped) and serves on port 7576. No environment file is needed.
Node.js
Requires Node.js 22 or newer (the Docker image uses Node 24).
npm ci
npm run dev # run from source with tsx
# or
npm run build && npm start # compiledConnect a client
Claude Code
claude mcp add --transport http yfinance-mcp http://localhost:7576/mcpOther MCP clients
Any client that supports Streamable HTTP can use the endpoint URL. For clients configured through JSON, an entry like this is typical (the exact key names vary by client):
{
"mcpServers": {
"yfinance-mcp": {
"type": "http",
"url": "http://localhost:7576/mcp"
}
}
}Tools
17 tools, all prefixed yf_.
Market data
Tool | Description |
| Real-time quote data for one or more tickers: price, change %, volume, market cap, PE ratio, 52-week range, bid/ask |
| Historical OHLCV data. |
| Options chain (calls and puts). Without |
| Currently trending tickers for a region (default |
| Snapshot of major market indices and benchmarks for a region |
Fundamentals
Tool | Description |
| Company or fund profile and key statistics: sector, industry, market cap, PE, EPS, dividend yield, beta, 52-week range |
| Income statement, balance sheet and cash flow, annual and/or quarterly |
| Institutional holders, insider holders and transactions, major holders breakdown, net share purchase activity |
| Dividend and stock split history (defaults to since 2000-01-01) |
| Analyst buy/hold/sell trends, upgrade/downgrade history, earnings estimates and history |
| ESG sustainability scores |
| Fund profile and top holdings for ETFs and mutual funds |
| Low-level access to any of the Yahoo |
Search and discovery
Tool | Description |
| Search symbols, ETFs, funds, indices or crypto by name or keyword; also returns related news |
| Latest news for a ticker or topic |
| Tickers Yahoo considers similar to a given symbol |
| Run a predefined Yahoo screener, e.g. |
Configuration
Variable | Default | Description |
|
| Listen port |
| unset | Anything other than |
Development
npm ci
npm run dev # tsx, run from source
npm run build # tsc -> dist/
npm test # vitest; the Yahoo client is mocked, no network needed
npm run prettier:fix # format src/Docker targets: dev (mount src/ and hot-reload with tsx watch), builder, and runtime (production image).
docker build --target runtime -t yfinance-mcp:latest .
docker build --target dev -t yfinance-mcp:dev .
docker run --rm -p 127.0.0.1:7576:7576 -v "$(pwd)/src:/app/src" yfinance-mcp:devTool implementations live in src/tools/; see CLAUDE.md for the code layout and how to add a tool.
License
This server cannot be deployed
Maintenance
Related MCP Connectors
Yahoo Finance for AI agents: quotes, price history, options with Greeks, financials, news, movers.
Yahoo Finance stock quotes and multi-ticker comparison as agent tools.
Live stock quotes, a stock screener, crypto prices and FX rates as agent tools.
US stock market data for AI agents: SEC filings, financials, insider trades, 13F, options, macro.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides real-time stock market data through Yahoo Finance without requiring an API key. Get quotes, historical data, company information, financial statements, and ticker search capabilities.-
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to retrieve stock market data and financial information from Yahoo Finance using the yfinance Python library. Supports querying stock prices, historical data, and other financial metrics through natural language.MIT
- AlicenseNot gradedqualityDmaintenanceProvides comprehensive financial data from Yahoo Finance, enabling retrieval of stock prices, company information, financial statements, options data, analyst recommendations, and market news through natural language queries.MIT
- AlicenseNot gradedqualityCmaintenanceProvides real-time stock quotes, historical data, and stock search via Yahoo Finance, enabling AI assistants to access and analyze financial market data.17 npm19MIT