yfinance-agent-mcp: Yahoo Finance MCP server for AI trading-research agents
yfinance-agent-mcp is a read-only Model Context Protocol server that gives AI agents market data from Yahoo Finance through yfinance: quotes, price history with ready-made indicators, news, screeners, earnings and economic calendars, fundamentals, analyst views, options and live prices.
It is built for agents that follow news and trends and prepare trading decisions: answers are small, timestamped and honest about delays, and failures come back as actionable errors instead of empty data.
uvx yfinance-agent-mcp
Documentation · Tools · Changelog
Why this server
- 13 tools that cover all of yfinance, shaped for agents rather than one tool per library method.
- Answers that fit in context. Price history comes with returns, SMA 20/50/200, RSI 14, ATR 14 and the 52-week range instead of thousands of raw bars; every response stays under 20,000 characters by default.
- Freshness you can check. Every answer carries
as_of; quotes addmarket_state,quote_sourceanddelay_min, because many exchanges are delayed by 15 minutes. - Errors an agent can act on:
rate_limited(with the seconds to wait),not_found,invalid_argument(with the valid values) andupstream_error, never a silent empty result. - Gentle with Yahoo. One shared session, a process-wide rate limit, a pause after HTTP 429, and a short-lived cache with its own expiry times.
- Safe with news. Publisher text arrives in fields marked
untrusted, so agents treat headlines as data, not instructions. - Read-only. It cannot place orders.
Quick start
You need uv. uvx downloads and runs the server; it talks MCP over stdio.
Claude Code
claude mcp add yfinance -- uvx yfinance-agent-mcp
Or install the plugin, which adds the server and a market-research skill:
/plugin marketplace add n-kostadinov/yfinance-agent-mcp
/plugin install yfinance@yfinance-agent-mcp
On Claude Code 2.1.275 or later this works in one step: /plugin install yfinance --marketplace n-kostadinov/yfinance-agent-mcp.
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"yfinance": {
"command": "uvx",
"args": ["yfinance-agent-mcp"]
}
}
}
Cursor
Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global):
{
"mcpServers": {
"yfinance": {
"command": "uvx",
"args": ["yfinance-agent-mcp"]
}
}
}
VS Code
Add to .vscode/mcp.json:
{
"servers": {
"yfinance": {
"type": "stdio",
"command": "uvx",
"args": ["yfinance-agent-mcp"]
}
}
}
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"yfinance": {
"command": "uvx",
"args": ["yfinance-agent-mcp"]
}
}
}
More clients, including the Claude Agent SDK, are covered in the client guides.
Tools
| Tool | What it answers |
|---|---|
search_symbols |
Which Yahoo symbol is "Nvidia", "SAP" or "gold"? |
get_quotes |
Price, change, day range, volume and freshness for up to 25 symbols |
get_market_overview |
Is the market open, and how are the indices doing? |
get_price_history |
Trend, momentum and volatility: indicators plus the latest bars |
get_news |
Latest news for symbols or a topic, newest first, publisher text marked untrusted |
screen_securities |
Candidates from Yahoo's predefined screens or a custom query |
get_sector_industry |
Leaders, ETFs and industries of a sector or industry |
get_events |
Earnings, IPO, economic and split calendars; a symbol's next earnings |
get_fundamentals |
Income, balance sheet, cash flow, valuation history, key ratios |
get_analyst_view |
Price targets, ratings, rating changes, EPS and revenue estimates |
get_options |
Calls and puts around the current price, every expiration |
get_ticker_dataset |
Holders, insider trades, dividends, splits, SEC filings, fund holdings and more |
get_live_quotes |
The price right now, from Yahoo's streaming feed |
Each tool is described in detail, with examples, in the tool reference.
Example prompts
- "What moved NVDA today? Check the news, the price action and whether earnings are coming."
- "Screen today's top gainers and tell me which ones have above-average volume and analyst upgrades."
- "Compare AAPL and MSFT: valuation, margins, growth and the 6-month trend."
- "Is the US market open? How are the indices and Bitcoin doing right now?"
Configuration
Everything is optional; set environment variables in your client's server config.
| Variable | Default | Meaning |
|---|---|---|
YFINANCE_AGENT_MCP_RATE_LIMIT |
2 |
Requests per second to Yahoo |
YFINANCE_AGENT_MCP_RATE_BURST |
5 |
Requests allowed at once |
YFINANCE_AGENT_MCP_TTL_<CATEGORY> |
per category | Seconds a cached answer stays valid, e.g. YFINANCE_AGENT_MCP_TTL_QUOTES=5 |
YFINANCE_AGENT_MCP_CACHE_DIR |
user cache dir | Where yfinance keeps its timezone and cookie caches |
YFINANCE_AGENT_MCP_LANG / _REGION |
en-US / US |
Yahoo locale |
YFINANCE_AGENT_MCP_PROXY |
none | Proxy URL for Yahoo requests |
YFINANCE_AGENT_MCP_LOG_LEVEL |
WARNING |
Log level (logs go to stderr) |
See the configuration guide for all cache categories.
Disclaimer
yfinance-agent-mcp is not affiliated with, endorsed by, or vetted by Yahoo. It uses yfinance, which reads Yahoo Finance's publicly available endpoints; Yahoo's terms of service say the data is for personal use. Data can be delayed, incomplete or wrong. Nothing here is investment advice, and the server cannot trade. Read the full disclaimer.
Contributing
Issues and pull requests are welcome. See the contributing guide to set up the project with uv and run the tests.
License
Metadata
Release files for yfinance-agent-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| yfinance_agent_mcp-0.1.0.tar.gz | 45.7 kB | With provenance | Details for yfinance_agent_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| yfinance_agent_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for yfinance_agent_mcp-0.1.0-py3-none-any.whl |
Total release size: 102.9 kB
Release files / yfinance_agent_mcp-0.1.0.tar.gz
| Download URL | yfinance_agent_mcp-0.1.0.tar.gz |
|---|---|
| Size | 45.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e2b5956f763183a073b0811c5c1fb68456bff957dee42ad2bba33faa27f596ea
|
|
BLAKE2b-256 checksum How to use checksums |
87d6bbd59acd50582e95132e450210925c8be8d97b6421e4561a2301c813e72c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / yfinance_agent_mcp-0.1.0-py3-none-any.whl
| Download URL | yfinance_agent_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 57.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
56c1f81ee98fb7b584fca31ef03583338465ce829423282a5fdd76512e17a6b3
|
|
BLAKE2b-256 checksum How to use checksums |
d2803472f29b87a98b55cc4ef5d29730561285a4a39c6b936377785242868df0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logSecurity for yfinance-agent-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for yfinance_agent_mcp-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.