yahoo-finance-mcp-server 1.2.2 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,35 @@ All notable changes to this project are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.2.4] - 2026-07-30
9
+
10
+ ### Fixed
11
+
12
+ - Fresh installs no longer crash on startup. `requirements.txt` had no upper
13
+ bound on `mcp`, so after the MCP Python SDK 2.0.0 release (2026-07-28)
14
+ `pip install -r requirements.txt` pulled 2.x, which removed
15
+ `mcp.server.fastmcp` and made the server die with
16
+ `ModuleNotFoundError: No module named 'mcp.server.fastmcp'`. The requirement
17
+ is now `mcp>=1.2.0,<2`. Existing installs were unaffected (the launcher
18
+ caches its virtualenv per requirements hash).
19
+
20
+ ## [1.2.3] - 2026-06-06
21
+
22
+ ### Changed
23
+
24
+ - Enriched every tool description with purpose, when-to-use/disambiguation
25
+ guidance, and return/error behavior. This raises self-describing quality for
26
+ AI agents (and Glama's Tool Definition Quality score) while staying lean
27
+ (~140 tokens per tool); parameters remain self-documented via their field
28
+ descriptions.
29
+
30
+ ### Added
31
+
32
+ - `Dockerfile`, `.dockerignore`, and `glama.json` to support a containerized
33
+ Glama release (builds `python:3.12-slim`, runs the server over stdio as a
34
+ non-root user). Verified locally: the image builds and `tools/list` returns
35
+ all 13 tools.
36
+
8
37
  ## [1.2.2] - 2026-06-04
9
38
 
10
39
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yahoo-finance-mcp-server",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "mcpName": "io.github.danishashko/yahoo-finance-mcp",
5
5
  "description": "Yahoo Finance MCP Server - Real-time stock data, company info, financial statements, and market analysis via Model Context Protocol",
6
6
  "main": "bin/cli.js",
package/requirements.txt CHANGED
@@ -1,10 +1,11 @@
1
- # Yahoo Finance MCP Server Requirements
2
- # Install all dependencies with: pip install -r requirements.txt
3
-
4
- yfinance>=0.2.61
5
- curl_cffi>=0.7.0
6
- pandas>=1.5.0
7
- tabulate>=0.9.0
8
- mcp>=1.2.0
9
- pydantic>=2.0.0
10
- httpx>=0.24.0
1
+ # Yahoo Finance MCP Server Requirements
2
+ # Install all dependencies with: pip install -r requirements.txt
3
+
4
+ yfinance>=0.2.61
5
+ curl_cffi>=0.7.0
6
+ pandas>=1.5.0
7
+ tabulate>=0.9.0
8
+ # Pinned below 2.0: the v2 SDK removed mcp.server.fastmcp, which this server uses.
9
+ mcp>=1.2.0,<2
10
+ pydantic>=2.0.0
11
+ httpx>=0.24.0
package/server.json CHANGED
@@ -1,21 +1,23 @@
1
1
  {
2
2
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
3
  "name": "io.github.danishashko/yahoo-finance-mcp",
4
- "description": "Real-time stock market data from Yahoo Finance: quotes, history, financials, analyst ratings, options, holders, dividends, news, and market status.",
4
+ "description": "Real-time Yahoo Finance data: quotes, history, financials, analyst ratings, options, and news.",
5
5
  "title": "Yahoo Finance",
6
6
  "repository": {
7
7
  "url": "https://github.com/danishashko/yahoo-finance-mcp",
8
8
  "source": "github"
9
9
  },
10
- "version": "1.2.2",
10
+ "version": "1.2.4",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "npm",
14
14
  "registryBaseUrl": "https://registry.npmjs.org",
15
15
  "identifier": "yahoo-finance-mcp-server",
16
- "version": "1.2.2",
16
+ "version": "1.2.4",
17
17
  "runtimeHint": "npx",
18
- "transport": { "type": "stdio" }
18
+ "transport": {
19
+ "type": "stdio"
20
+ }
19
21
  }
20
22
  ]
21
23
  }
@@ -302,7 +302,12 @@ async def get_stock_quote(
302
302
  ),
303
303
  ] = ResponseFormat.MARKDOWN,
304
304
  ) -> str:
305
- """Current stock quote: price, change, day/52-week range, volume, market cap, P/E, EPS, dividend yield. Use for "what's the price of [stock]"."""
305
+ """Real-time quote snapshot for ONE stock: last price, day change ($ and %), open, previous close, day range, 52-week range, volume and average volume, market cap, beta, trailing P/E, EPS, dividend yield, and sector/industry/website.
306
+
307
+ Use for "what's the price of X" or a quick single-stock snapshot. For several stocks side by side use compare_stocks; for the full company profile use get_company_info; for a past price series use get_historical_prices.
308
+
309
+ Returns Markdown by default, or structured JSON when response_format='json'. An unknown ticker or an upstream/rate-limit error returns a short error message rather than raising.
310
+ """
306
311
  ticker = _norm_ticker(ticker)
307
312
  try:
308
313
  ticker_obj = make_ticker(ticker)
@@ -439,7 +444,12 @@ async def get_historical_prices(
439
444
  ),
440
445
  ] = ResponseFormat.MARKDOWN,
441
446
  ) -> str:
442
- """Historical OHLCV price data with summary stats and total return, for trends/charting. Use for "how has [stock] performed over [period]"."""
447
+ """Historical OHLCV price series for one stock over a chosen period/interval, plus summary stats (highest/lowest/average close, average volume) and total return over the window.
448
+
449
+ Use for performance, trends, or charting ("how has X done over the last year"). For a single current price use get_stock_quote; for dividend/split events use get_dividends_splits. Note: intraday intervals (1m-90m) are only available for short recent periods, and long periods return many rows, so prefer JSON or a shorter period if the output is truncated.
450
+
451
+ Returns Markdown (summary stats plus the last 10 rows) by default, or the full series as JSON when response_format='json'. An empty or unsupported period/interval combination returns a short message.
452
+ """
443
453
  ticker = _norm_ticker(ticker)
444
454
  try:
445
455
  ticker_obj = make_ticker(ticker)
@@ -533,7 +543,12 @@ async def get_company_info(
533
543
  ),
534
544
  ] = ResponseFormat.MARKDOWN,
535
545
  ) -> str:
536
- """Company profile: business summary, executives, valuation and financial-highlight stats. Use for "what does [company] do" or company background."""
546
+ """Detailed company profile for one stock: long business summary, sector/industry, key executives, headquarters/website/employee count, and valuation & financial-highlight stats (market cap, P/E, margins, and similar).
547
+
548
+ Use for "what does X do", company background, or a business overview. For the statement-level numbers (income/balance/cash flow) use get_financial_statements; for just the live price use get_stock_quote.
549
+
550
+ Returns Markdown by default, or JSON when response_format='json'. An unknown ticker or upstream error returns a short error message.
551
+ """
537
552
  ticker = _norm_ticker(ticker)
538
553
  try:
539
554
  ticker_obj = make_ticker(ticker)
@@ -655,7 +670,12 @@ async def get_financial_statements(
655
670
  ),
656
671
  ] = ResponseFormat.MARKDOWN,
657
672
  ) -> str:
658
- """Annual income statement, balance sheet, and cash flow. Use for revenue, earnings, assets/liabilities, or fundamental analysis."""
673
+ """Annual financial statements for one company: income statement, balance sheet, and cash flow statement, each with multiple years of data.
674
+
675
+ Use for revenue, earnings, assets/liabilities, cash flow, or fundamental analysis. For headline ratios only use get_company_info; for forward projections use get_analyst_estimates. Quarterly data is not returned; request JSON for the complete machine-readable export.
676
+
677
+ Returns Markdown by default, or JSON when response_format='json'. Companies without filed statements (for example some ETFs or ADRs) return empty sections or a short message.
678
+ """
659
679
  ticker = _norm_ticker(ticker)
660
680
  try:
661
681
  ticker_obj = make_ticker(ticker)
@@ -740,7 +760,12 @@ async def compare_stocks(
740
760
  ),
741
761
  ] = ResponseFormat.MARKDOWN,
742
762
  ) -> str:
743
- """Compare key metrics for 2-10 stocks side by side, with quick insights. Use for "which is better, X or Y" or relative performance."""
763
+ """Side-by-side comparison of 2-10 stocks across key metrics (price, market cap, P/E, EPS, dividend yield, 52-week range, and period performance) with brief auto-generated insights.
764
+
765
+ Use for "which is better, X or Y", peer/relative comparison, or screening a small set. For a deep dive on a single name use get_stock_quote or get_company_info.
766
+
767
+ Pass 2-10 tickers in the tickers list. Returns a Markdown comparison table by default, or JSON when response_format='json'. A ticker that fails to resolve is reported per-symbol rather than failing the whole call.
768
+ """
744
769
  tickers = [_norm_ticker(t) for t in tickers]
745
770
  try:
746
771
  comparison_data = []
@@ -841,7 +866,12 @@ async def get_analyst_recommendations(
841
866
  ),
842
867
  ] = ResponseFormat.MARKDOWN,
843
868
  ) -> str:
844
- """Analyst price targets, consensus rating, recommendation trend, and recent upgrades/downgrades. Use for "what do analysts think of [stock]". For forward EPS/revenue estimates use get_analyst_estimates."""
869
+ """Wall Street analyst view on one stock: price targets (high/mean/low), consensus rating, the buy/hold/sell recommendation-trend breakdown, and recent upgrades/downgrades.
870
+
871
+ Use for "what do analysts think of X", ratings, or sentiment. For forward EPS/revenue/growth projections use get_analyst_estimates instead: this tool is ratings and targets, that one is the numeric estimates.
872
+
873
+ Returns Markdown by default, or JSON when response_format='json'. A stock with no analyst coverage returns the available fields as N/A; errors return a short message.
874
+ """
845
875
  ticker = _norm_ticker(ticker)
846
876
  try:
847
877
  ticker_obj = make_ticker(ticker)
@@ -981,7 +1011,12 @@ async def get_market_news(
981
1011
  ),
982
1012
  ] = ResponseFormat.MARKDOWN,
983
1013
  ) -> str:
984
- """Latest news headlines for a stock (source, date, summary, link). Use for "what's the latest news on [stock]"."""
1014
+ """Latest news articles for one stock; each item has a title, publisher/source, publish date, a short summary, and a link.
1015
+
1016
+ Use for "what's the latest news on X", recent headlines, or catalysts. Returns news only: for price use get_stock_quote, for fundamentals use the financials tools.
1017
+
1018
+ count sets how many articles to return (1-20, default 10). Returns Markdown by default, or JSON when response_format='json'. No recent news returns a short message.
1019
+ """
985
1020
  ticker = _norm_ticker(ticker)
986
1021
  try:
987
1022
  articles = make_ticker(ticker).get_news(count=count) or []
@@ -1085,7 +1120,12 @@ async def get_options_chain(
1085
1120
  ),
1086
1121
  ] = ResponseFormat.MARKDOWN,
1087
1122
  ) -> str:
1088
- """Options chain (strike, bid/ask, volume, open interest, IV) for an expiration. Call with no expiration_date first to list available dates, then again with a date."""
1123
+ """Equity options data for one underlying, in two modes: call with no expiration_date to LIST every available expiration date; call again with a specific 'YYYY-MM-DD' to get that expiration's chain (strike, bid/ask, last, volume, open interest, implied volatility).
1124
+
1125
+ Use for options pricing, implied volatility, or open-interest analysis. option_type selects 'calls', 'puts', or 'both'. Always discover the valid dates first (call with no date) before requesting a chain, since only listed expirations work.
1126
+
1127
+ Returns Markdown by default, or JSON when response_format='json'. A ticker with no listed options returns a short message.
1128
+ """
1089
1129
  ticker = _norm_ticker(ticker)
1090
1130
  try:
1091
1131
  t = make_ticker(ticker)
@@ -1178,7 +1218,12 @@ async def get_holders(
1178
1218
  ),
1179
1219
  ] = ResponseFormat.MARKDOWN,
1180
1220
  ) -> str:
1181
- """Stock ownership and insider activity by holder_type: institutional, mutualfund, major (insider-vs-institutional %), or insider_transactions."""
1221
+ """Ownership and insider activity for one stock, selected by holder_type: 'institutional' (top institutional holders), 'mutualfund' (top fund holders), 'major' (insider-vs-institutional ownership % breakdown), or 'insider_transactions' (recent insider buys and sells).
1222
+
1223
+ Use for "who owns X", institutional ownership, or insider trading activity. One holder_type per call: call again to get a different view.
1224
+
1225
+ Returns Markdown by default, or JSON when response_format='json'. Missing data for the chosen category returns a short message.
1226
+ """
1182
1227
  ticker = _norm_ticker(ticker)
1183
1228
  try:
1184
1229
  t = make_ticker(ticker)
@@ -1249,7 +1294,12 @@ async def get_dividends_splits(
1249
1294
  ),
1250
1295
  ] = ResponseFormat.MARKDOWN,
1251
1296
  ) -> str:
1252
- """Dividend payment history (with trailing summary) and stock-split history for a stock."""
1297
+ """Full dividend payment history (with a trailing-period summary) and the stock-split history for one stock.
1298
+
1299
+ Use for dividend-income analysis, payment dates and amounts, dividend growth, or past split events. For the current/forward dividend yield use get_stock_quote; for price history use get_historical_prices.
1300
+
1301
+ Returns Markdown by default, or JSON when response_format='json'. A stock that pays no dividend or has never split returns a short message noting that none exist.
1302
+ """
1253
1303
  ticker = _norm_ticker(ticker)
1254
1304
  try:
1255
1305
  t = make_ticker(ticker)
@@ -1344,7 +1394,12 @@ async def get_analyst_estimates(
1344
1394
  ),
1345
1395
  ] = ResponseFormat.MARKDOWN,
1346
1396
  ) -> str:
1347
- """Forward analyst estimates: price targets, EPS/revenue estimates by period, and growth. Complements get_analyst_recommendations (ratings/trend) with projected numbers."""
1397
+ """Forward-looking analyst estimates for one stock: price targets, EPS and revenue estimates by period (current and next quarter and year), and growth estimates.
1398
+
1399
+ Use for projected/expected numbers and forecasts. This complements get_analyst_recommendations: that tool returns ratings and the recommendation trend, this one returns the numeric forward estimates.
1400
+
1401
+ Returns Markdown by default, or JSON when response_format='json'. A stock without analyst coverage returns the available fields as N/A or a short message.
1402
+ """
1348
1403
  ticker = _norm_ticker(ticker)
1349
1404
  try:
1350
1405
  t = make_ticker(ticker)
@@ -1447,7 +1502,12 @@ async def search_symbols(
1447
1502
  ),
1448
1503
  ] = ResponseFormat.MARKDOWN,
1449
1504
  ) -> str:
1450
- """Find ticker symbols by company name or keyword. Use to resolve a name to a ticker before calling other tools."""
1505
+ """Resolve a company name or keyword to ticker symbols; each match returns the symbol, name, exchange, and instrument type (equity, ETF, and so on).
1506
+
1507
+ Use this first when you have a company or brand name but not its ticker, then pass the resolved symbol to the other tools. Not for fetching prices or fundamentals.
1508
+
1509
+ query is the name/keyword to search; count caps the number of matches (1-20, default 8). Returns Markdown by default, or JSON when response_format='json'. No matches returns a short message.
1510
+ """
1451
1511
  query = query.strip()
1452
1512
  try:
1453
1513
  session = _get_session()
@@ -1523,7 +1583,12 @@ async def get_market_status(
1523
1583
  ),
1524
1584
  ] = ResponseFormat.MARKDOWN,
1525
1585
  ) -> str:
1526
- """Whether a market (by region code, e.g. US/GB/JP) is open or closed, with timing and a major-index summary."""
1586
+ """Whether a stock market is currently open or closed for a given region, with trading-session timing and a summary of that region's major indices.
1587
+
1588
+ Use for "is the US market open", market hours, or a quick index overview. region is a country code (US, GB, CA, DE, FR, IN, JP, HK, AU; default US). This is market-wide, not per-stock: use get_stock_quote for an individual price.
1589
+
1590
+ Returns Markdown by default, or JSON when response_format='json'. An unrecognized region returns a short message.
1591
+ """
1527
1592
  region = region.strip().upper()
1528
1593
  try:
1529
1594
  session = _get_session()