stock-scanner-mcp 1.7.0 → 1.9.0
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/README.md +41 -13
- package/dist/index.js +193 -9
- package/package.json +18 -2
package/README.md
CHANGED
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
A modular MCP (Model Context Protocol) server that gives Claude Code real-time access to stock and crypto market data. Scan markets, check technicals, monitor insider trades, track earnings and economic events — all from your terminal.
|
|
8
8
|
|
|
9
|
+
**47 tools** across **9 modules** — 6 modules work with zero API keys.
|
|
10
|
+
|
|
11
|
+
**[Wiki](https://github.com/yyordanov-tradu/stock-scanner-mcp/wiki)** — Full tool reference, example prompts, advanced strategies, and troubleshooting guide.
|
|
12
|
+
|
|
9
13
|
## Quick Start
|
|
10
14
|
|
|
11
15
|
```bash
|
|
@@ -34,7 +38,7 @@ Add to your Claude Code MCP config (`~/.claude.json` or project `.mcp.json`):
|
|
|
34
38
|
}
|
|
35
39
|
```
|
|
36
40
|
|
|
37
|
-
### With API keys (optional, enables
|
|
41
|
+
### With API keys (optional, enables all 47 tools):
|
|
38
42
|
|
|
39
43
|
```json
|
|
40
44
|
{
|
|
@@ -44,7 +48,8 @@ Add to your Claude Code MCP config (`~/.claude.json` or project `.mcp.json`):
|
|
|
44
48
|
"args": ["-y", "stock-scanner-mcp"],
|
|
45
49
|
"env": {
|
|
46
50
|
"FINNHUB_API_KEY": "your-key-here",
|
|
47
|
-
"ALPHA_VANTAGE_API_KEY": "your-key-here"
|
|
51
|
+
"ALPHA_VANTAGE_API_KEY": "your-key-here",
|
|
52
|
+
"FRED_API_KEY": "your-key-here"
|
|
48
53
|
}
|
|
49
54
|
}
|
|
50
55
|
}
|
|
@@ -55,28 +60,33 @@ Add to your Claude Code MCP config (`~/.claude.json` or project `.mcp.json`):
|
|
|
55
60
|
|
|
56
61
|
| Module | Tools | API Key | Description |
|
|
57
62
|
|--------|-------|---------|-------------|
|
|
58
|
-
| tradingview |
|
|
63
|
+
| tradingview | 10 | None | US stock scanner with quotes, technicals, sectors, indices, and screening |
|
|
59
64
|
| tradingview-crypto | 4 | None | Crypto pair scanner with technicals and screening |
|
|
60
65
|
| sec-edgar | 6 | None | SEC filings, insider trades, institutional holdings, ownership |
|
|
61
66
|
| coingecko | 3 | None | Crypto market data, trending coins, global stats |
|
|
62
|
-
| options |
|
|
67
|
+
| options | 5 | None | Options chains, Greeks, unusual activity, max pain, implied move |
|
|
63
68
|
| options-cboe | 1 | None | CBOE put/call ratio sentiment indicator |
|
|
64
|
-
| finnhub |
|
|
69
|
+
| finnhub | 9 | `FINNHUB_API_KEY` | Quotes, news, earnings, analyst ratings, short interest |
|
|
65
70
|
| alpha-vantage | 5 | `ALPHA_VANTAGE_API_KEY` | Quotes, daily prices, fundamentals, earnings, dividends |
|
|
71
|
+
| fred | 4 | `FRED_API_KEY` | Economic calendar, indicators (CPI, GDP, rates), historical data |
|
|
72
|
+
|
|
66
73
|
Modules auto-enable when their required environment variables are set. Modules with no required key are always enabled.
|
|
67
74
|
|
|
68
|
-
## Available Tools (
|
|
75
|
+
## Available Tools (47 total)
|
|
69
76
|
|
|
70
77
|
### TradingView — Stock Scanning (no API key)
|
|
71
78
|
|
|
72
79
|
| Tool | Description |
|
|
73
80
|
|------|-------------|
|
|
74
81
|
| `tradingview_scan` | Scan US stocks with custom filters (price, RSI, volume, etc.) |
|
|
75
|
-
| `
|
|
82
|
+
| `tradingview_compare_stocks` | Side-by-side comparison of 2-5 stocks |
|
|
83
|
+
| `tradingview_quote` | 15-min delayed quotes for stock tickers (includes pre/post-market) |
|
|
76
84
|
| `tradingview_technicals` | Technical indicators (RSI, MACD, moving averages, pivots) |
|
|
77
85
|
| `tradingview_top_gainers` | Today's top gaining stocks by % change |
|
|
78
86
|
| `tradingview_top_losers` | Today's top losing stocks by % change |
|
|
79
87
|
| `tradingview_top_volume` | Highest volume stocks today |
|
|
88
|
+
| `tradingview_market_indices` | Real-time VIX, S&P 500, NASDAQ, Dow Jones |
|
|
89
|
+
| `tradingview_sector_performance` | S&P 500 sector ETF performance (weekly, monthly, YTD) |
|
|
80
90
|
| `tradingview_volume_breakout` | Stocks with unusual volume (2x+ their 10-day average) |
|
|
81
91
|
|
|
82
92
|
### TradingView — Crypto (no API key)
|
|
@@ -115,6 +125,7 @@ Modules auto-enable when their required environment variables are set. Modules w
|
|
|
115
125
|
| `options_chain` | Full options chain with Greeks for a given expiration |
|
|
116
126
|
| `options_unusual_activity` | Unusual options activity — high volume/OI contracts |
|
|
117
127
|
| `options_max_pain` | Max pain (strike where most options expire worthless) |
|
|
128
|
+
| `options_implied_move` | Expected move from ATM straddle pricing |
|
|
118
129
|
|
|
119
130
|
### Options CBOE — Put/Call Sentiment (no API key)
|
|
120
131
|
|
|
@@ -126,11 +137,15 @@ Modules auto-enable when their required environment variables are set. Modules w
|
|
|
126
137
|
|
|
127
138
|
| Tool | Description |
|
|
128
139
|
|------|-------------|
|
|
140
|
+
| `finnhub_quote` | Real-time stock quote |
|
|
141
|
+
| `finnhub_company_profile` | Company info (industry, market cap, IPO date, website) |
|
|
142
|
+
| `finnhub_peers` | Comparable companies in the same industry |
|
|
143
|
+
| `finnhub_market_status` | Exchange open/closed status and current session |
|
|
129
144
|
| `finnhub_market_news` | Latest market news (general, forex, crypto, merger) |
|
|
130
145
|
| `finnhub_company_news` | Company-specific news by ticker and date range |
|
|
131
146
|
| `finnhub_earnings_calendar` | Upcoming and historical earnings reports |
|
|
147
|
+
| `finnhub_analyst_ratings` | Analyst consensus and rating history |
|
|
132
148
|
| `finnhub_short_interest` | Short interest, short ratio, and key financial metrics |
|
|
133
|
-
| `finnhub_economic_calendar` | Economic events (FOMC, CPI, GDP, NFP) with impact ratings |
|
|
134
149
|
|
|
135
150
|
### Alpha Vantage — Fundamentals & History (requires `ALPHA_VANTAGE_API_KEY`)
|
|
136
151
|
|
|
@@ -142,6 +157,15 @@ Modules auto-enable when their required environment variables are set. Modules w
|
|
|
142
157
|
| `alphavantage_earnings_history` | Historical EPS actual vs estimate by quarter |
|
|
143
158
|
| `alphavantage_dividend_history` | Historical dividend payments and dates |
|
|
144
159
|
|
|
160
|
+
### FRED — US Economic Data (requires `FRED_API_KEY`)
|
|
161
|
+
|
|
162
|
+
| Tool | Description |
|
|
163
|
+
|------|-------------|
|
|
164
|
+
| `fred_economic_calendar` | Upcoming high-impact economic releases (FOMC, CPI, NFP, GDP) |
|
|
165
|
+
| `fred_indicator` | Latest value for any indicator (CPI, fed funds, unemployment, etc.) |
|
|
166
|
+
| `fred_indicator_history` | Historical values with unit transforms (YoY %, change, level) |
|
|
167
|
+
| `fred_search` | Discover FRED series IDs by keyword |
|
|
168
|
+
|
|
145
169
|
## Configuration
|
|
146
170
|
|
|
147
171
|
### Environment Variables
|
|
@@ -150,6 +174,7 @@ Modules auto-enable when their required environment variables are set. Modules w
|
|
|
150
174
|
|----------|----------|-------------|
|
|
151
175
|
| `FINNHUB_API_KEY` | No | Enables Finnhub module ([get free key](https://finnhub.io/)) |
|
|
152
176
|
| `ALPHA_VANTAGE_API_KEY` | No | Enables Alpha Vantage module ([get free key](https://www.alphavantage.co/support/#api-key)) |
|
|
177
|
+
| `FRED_API_KEY` | No | Enables FRED module ([get free key](https://fred.stlouisfed.org/docs/api/api_key.html)) |
|
|
153
178
|
|
|
154
179
|
### CLI Options
|
|
155
180
|
|
|
@@ -178,7 +203,8 @@ Once configured, just ask Claude naturally:
|
|
|
178
203
|
- "What's trending in crypto right now?"
|
|
179
204
|
- "Find stocks with unusual volume today"
|
|
180
205
|
- "What earnings are coming up this week?"
|
|
181
|
-
- "
|
|
206
|
+
- "What's the current fed funds rate and CPI inflation trend?"
|
|
207
|
+
- "Show me upcoming high-impact economic events"
|
|
182
208
|
- "What's the short interest on GME?"
|
|
183
209
|
- "Get Apple's dividend history"
|
|
184
210
|
- "What's the options chain for AAPL expiring next Friday?"
|
|
@@ -204,14 +230,15 @@ src/
|
|
|
204
230
|
├── config.ts # CLI arg parsing
|
|
205
231
|
├── registry.ts # Module auto-discovery and filtering
|
|
206
232
|
├── modules/
|
|
207
|
-
│ ├── tradingview/ #
|
|
233
|
+
│ ├── tradingview/ # 10 tools — stock scanning, quotes, technicals, sectors, indices
|
|
208
234
|
│ ├── tradingview-crypto/ # 4 tools — crypto scanning and technicals
|
|
209
235
|
│ ├── sec-edgar/ # 6 tools — filings, insider trades, holdings
|
|
210
236
|
│ ├── coingecko/ # 3 tools — crypto market data
|
|
211
|
-
│ ├── options/ #
|
|
237
|
+
│ ├── options/ # 5 tools — options chains, Greeks, unusual activity, implied move
|
|
212
238
|
│ ├── options-cboe/ # 1 tool — CBOE put/call ratio sentiment
|
|
213
|
-
│ ├── finnhub/ #
|
|
214
|
-
│
|
|
239
|
+
│ ├── finnhub/ # 9 tools — quotes, news, earnings, analyst ratings, short interest
|
|
240
|
+
│ ├── alpha-vantage/ # 5 tools — quotes, fundamentals, dividends
|
|
241
|
+
│ └── fred/ # 4 tools — economic calendar, indicators, historical data
|
|
215
242
|
└── shared/
|
|
216
243
|
├── http.ts # HTTP client with timeouts and key sanitization
|
|
217
244
|
├── cache.ts # In-memory TTL cache
|
|
@@ -231,6 +258,7 @@ src/
|
|
|
231
258
|
| CBOE CDN | No documented limit | 30 min |
|
|
232
259
|
| Finnhub | 30 calls/second | 5 min |
|
|
233
260
|
| Alpha Vantage | 5 calls/minute, 25 calls/day | 1 min |
|
|
261
|
+
| FRED | No hard limit | 30 min |
|
|
234
262
|
|
|
235
263
|
All modules use in-memory TTL caching to minimize API calls. Error responses include retry hints for rate-limited requests.
|
|
236
264
|
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { fileURLToPath } from "url";
|
|
|
6
6
|
import { dirname, join } from "path";
|
|
7
7
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
8
8
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
9
|
-
import { z as
|
|
9
|
+
import { z as z10 } from "zod";
|
|
10
10
|
|
|
11
11
|
// src/config.ts
|
|
12
12
|
function parseConfig(args) {
|
|
@@ -26,7 +26,8 @@ function parseConfig(args) {
|
|
|
26
26
|
enabledModules,
|
|
27
27
|
env: {
|
|
28
28
|
FINNHUB_API_KEY: process.env.FINNHUB_API_KEY,
|
|
29
|
-
ALPHA_VANTAGE_API_KEY: process.env.ALPHA_VANTAGE_API_KEY
|
|
29
|
+
ALPHA_VANTAGE_API_KEY: process.env.ALPHA_VANTAGE_API_KEY,
|
|
30
|
+
FRED_API_KEY: process.env.FRED_API_KEY
|
|
30
31
|
}
|
|
31
32
|
};
|
|
32
33
|
}
|
|
@@ -2482,6 +2483,184 @@ function createOptionsCboeModule() {
|
|
|
2482
2483
|
};
|
|
2483
2484
|
}
|
|
2484
2485
|
|
|
2486
|
+
// src/modules/fred/index.ts
|
|
2487
|
+
import { z as z9 } from "zod";
|
|
2488
|
+
|
|
2489
|
+
// src/modules/fred/client.ts
|
|
2490
|
+
var BASE_URL7 = "https://api.stlouisfed.org/fred";
|
|
2491
|
+
var CACHE_TTL7 = 30 * 60 * 1e3;
|
|
2492
|
+
var cache7 = new TtlCache(CACHE_TTL7);
|
|
2493
|
+
var HIGH_IMPACT_RELEASES = {
|
|
2494
|
+
10: "Consumer Price Index",
|
|
2495
|
+
46: "Producer Price Index",
|
|
2496
|
+
50: "Employment Situation",
|
|
2497
|
+
53: "Gross Domestic Product",
|
|
2498
|
+
54: "Personal Income and Outlays",
|
|
2499
|
+
101: "Federal Funds Rate",
|
|
2500
|
+
7: "Advance Retail Sales",
|
|
2501
|
+
9: "Industrial Production and Capacity Utilization",
|
|
2502
|
+
18: "Housing Starts",
|
|
2503
|
+
32: "ISM Manufacturing"
|
|
2504
|
+
};
|
|
2505
|
+
var COMMON_SERIES = {
|
|
2506
|
+
fed_funds: "DFF",
|
|
2507
|
+
cpi: "CPIAUCSL",
|
|
2508
|
+
core_cpi: "CPILFESL",
|
|
2509
|
+
ppi: "PPIFIS",
|
|
2510
|
+
gdp: "GDPC1",
|
|
2511
|
+
unemployment: "UNRATE",
|
|
2512
|
+
nonfarm_payrolls: "PAYEMS",
|
|
2513
|
+
treasury_10y: "DGS10",
|
|
2514
|
+
treasury_2y: "DGS2",
|
|
2515
|
+
initial_claims: "ICSA",
|
|
2516
|
+
core_pce: "PCEPILFE"
|
|
2517
|
+
};
|
|
2518
|
+
function resolveSeriesId(seriesIdOrAlias) {
|
|
2519
|
+
const lower = seriesIdOrAlias.toLowerCase();
|
|
2520
|
+
return COMMON_SERIES[lower] || seriesIdOrAlias.toUpperCase();
|
|
2521
|
+
}
|
|
2522
|
+
async function getEconomicCalendar(apiKey, limit = 60) {
|
|
2523
|
+
const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
2524
|
+
const cacheKey = `calendar:${today}:${limit}`;
|
|
2525
|
+
const cached = cache7.get(cacheKey);
|
|
2526
|
+
if (cached) return cached;
|
|
2527
|
+
const highImpactIds = new Set(Object.keys(HIGH_IMPACT_RELEASES).map(Number));
|
|
2528
|
+
const url = `${BASE_URL7}/releases/dates?api_key=${encodeURIComponent(apiKey)}&file_type=json&realtime_start=${today}&include_release_dates_with_no_data=true&sort_order=asc&limit=${limit}`;
|
|
2529
|
+
const data = await httpGet(url);
|
|
2530
|
+
const filtered = (data.release_dates || []).filter((r) => highImpactIds.has(r.release_id)).map((r) => ({
|
|
2531
|
+
release_id: r.release_id,
|
|
2532
|
+
release_name: r.release_name,
|
|
2533
|
+
date: r.date
|
|
2534
|
+
}));
|
|
2535
|
+
cache7.set(cacheKey, filtered);
|
|
2536
|
+
return filtered;
|
|
2537
|
+
}
|
|
2538
|
+
async function getIndicator(apiKey, seriesIdOrAlias) {
|
|
2539
|
+
const seriesId = resolveSeriesId(seriesIdOrAlias);
|
|
2540
|
+
const cacheKey = `indicator:${seriesId}`;
|
|
2541
|
+
const cached = cache7.get(cacheKey);
|
|
2542
|
+
if (cached) return cached;
|
|
2543
|
+
const baseParams = `api_key=${encodeURIComponent(apiKey)}&file_type=json`;
|
|
2544
|
+
const seriesUrl = `${BASE_URL7}/series?series_id=${encodeURIComponent(seriesId)}&${baseParams}`;
|
|
2545
|
+
const seriesData = await httpGet(seriesUrl);
|
|
2546
|
+
const s = seriesData.seriess[0];
|
|
2547
|
+
const obsUrl = `${BASE_URL7}/series/observations?series_id=${encodeURIComponent(seriesId)}&${baseParams}&sort_order=desc&limit=1`;
|
|
2548
|
+
const obsData = await httpGet(obsUrl);
|
|
2549
|
+
const obs = obsData.observations[0];
|
|
2550
|
+
const result = {
|
|
2551
|
+
series: {
|
|
2552
|
+
id: s.id,
|
|
2553
|
+
title: s.title,
|
|
2554
|
+
frequency: s.frequency,
|
|
2555
|
+
units: s.units,
|
|
2556
|
+
seasonal_adjustment: s.seasonal_adjustment,
|
|
2557
|
+
last_updated: s.last_updated
|
|
2558
|
+
},
|
|
2559
|
+
latest: {
|
|
2560
|
+
date: obs?.date || "",
|
|
2561
|
+
value: obs?.value === "." ? null : obs?.value || null
|
|
2562
|
+
}
|
|
2563
|
+
};
|
|
2564
|
+
cache7.set(cacheKey, result);
|
|
2565
|
+
return result;
|
|
2566
|
+
}
|
|
2567
|
+
async function getIndicatorHistory(apiKey, seriesIdOrAlias, startDate, endDate, units = "lin") {
|
|
2568
|
+
const seriesId = resolveSeriesId(seriesIdOrAlias);
|
|
2569
|
+
const cacheKey = `history:${seriesId}:${startDate}:${endDate}:${units}`;
|
|
2570
|
+
const cached = cache7.get(cacheKey);
|
|
2571
|
+
if (cached) return cached;
|
|
2572
|
+
const url = `${BASE_URL7}/series/observations?series_id=${encodeURIComponent(seriesId)}&api_key=${encodeURIComponent(apiKey)}&file_type=json&observation_start=${encodeURIComponent(startDate)}&observation_end=${encodeURIComponent(endDate)}&units=${encodeURIComponent(units)}&sort_order=asc`;
|
|
2573
|
+
const data = await httpGet(url);
|
|
2574
|
+
const result = (data.observations || []).filter((o) => o.value !== ".").map((o) => ({
|
|
2575
|
+
date: o.date,
|
|
2576
|
+
value: o.value
|
|
2577
|
+
}));
|
|
2578
|
+
cache7.set(cacheKey, result);
|
|
2579
|
+
return result;
|
|
2580
|
+
}
|
|
2581
|
+
async function searchSeries(apiKey, query, limit = 10) {
|
|
2582
|
+
const cacheKey = `search:${query}:${limit}`;
|
|
2583
|
+
const cached = cache7.get(cacheKey);
|
|
2584
|
+
if (cached) return cached;
|
|
2585
|
+
const url = `${BASE_URL7}/series/search?search_text=${encodeURIComponent(query)}&api_key=${encodeURIComponent(apiKey)}&file_type=json&limit=${limit}&order_by=search_rank`;
|
|
2586
|
+
const data = await httpGet(url);
|
|
2587
|
+
const result = (data.seriess || []).map((s) => ({
|
|
2588
|
+
id: s.id,
|
|
2589
|
+
title: s.title,
|
|
2590
|
+
frequency: s.frequency,
|
|
2591
|
+
units: s.units,
|
|
2592
|
+
popularity: s.popularity,
|
|
2593
|
+
last_updated: s.last_updated
|
|
2594
|
+
}));
|
|
2595
|
+
cache7.set(cacheKey, result);
|
|
2596
|
+
return result;
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
// src/modules/fred/index.ts
|
|
2600
|
+
function createFredModule(apiKey) {
|
|
2601
|
+
const metadata2 = { source: "fred", dataDelay: "varies by indicator" };
|
|
2602
|
+
const calendarTool = {
|
|
2603
|
+
name: "fred_economic_calendar",
|
|
2604
|
+
description: "Get upcoming US economic release dates (FOMC, CPI, PPI, NFP, GDP, PCE, jobless claims, retail sales, ISM, treasury rates). Filters to high-impact releases only. Use this to identify macro catalysts that could move markets.",
|
|
2605
|
+
inputSchema: z9.object({
|
|
2606
|
+
limit: z9.number().optional().default(60).describe("Max raw results to fetch before filtering (default: 60)")
|
|
2607
|
+
}),
|
|
2608
|
+
handler: withMetadata(async (params) => {
|
|
2609
|
+
const releases = await getEconomicCalendar(apiKey, params.limit);
|
|
2610
|
+
return successResult(JSON.stringify(releases, null, 2));
|
|
2611
|
+
}, metadata2)
|
|
2612
|
+
};
|
|
2613
|
+
const indicatorTool = {
|
|
2614
|
+
name: "fred_indicator",
|
|
2615
|
+
description: "Get the latest value of a US economic indicator from FRED. Accepts FRED series IDs (e.g. 'CPIAUCSL', 'DFF', 'UNRATE') or common aliases: cpi, core_cpi, ppi, gdp, unemployment, nonfarm_payrolls, fed_funds, treasury_10y, treasury_2y, initial_claims, core_pce. Returns the indicator metadata (title, frequency, units) and latest observation.",
|
|
2616
|
+
inputSchema: z9.object({
|
|
2617
|
+
series_id: z9.string().describe("FRED series ID or alias (e.g. 'cpi', 'UNRATE', 'treasury_10y')")
|
|
2618
|
+
}),
|
|
2619
|
+
handler: withMetadata(async (params) => {
|
|
2620
|
+
const result = await getIndicator(apiKey, params.series_id);
|
|
2621
|
+
return successResult(JSON.stringify(result, null, 2));
|
|
2622
|
+
}, metadata2)
|
|
2623
|
+
};
|
|
2624
|
+
const historyTool = {
|
|
2625
|
+
name: "fred_indicator_history",
|
|
2626
|
+
description: "Get historical values for a US economic indicator from FRED. Accepts same series IDs/aliases as fred_indicator. Supports units transformation: 'lin' (raw level), 'chg' (change), 'pc1' (% change from year ago \u2014 useful for YoY inflation), 'pch' (% change from prior period). Use 'pc1' with CPI/PPI to get YoY inflation rates directly.",
|
|
2627
|
+
inputSchema: z9.object({
|
|
2628
|
+
series_id: z9.string().describe("FRED series ID or alias"),
|
|
2629
|
+
start_date: z9.string().describe("Start date YYYY-MM-DD"),
|
|
2630
|
+
end_date: z9.string().describe("End date YYYY-MM-DD"),
|
|
2631
|
+
units: z9.enum(["lin", "chg", "ch1", "pch", "pc1", "pca"]).optional().default("lin").describe("Units: lin=level, pch=% change, pc1=YoY % change (default: lin)")
|
|
2632
|
+
}),
|
|
2633
|
+
handler: withMetadata(async (params) => {
|
|
2634
|
+
const result = await getIndicatorHistory(
|
|
2635
|
+
apiKey,
|
|
2636
|
+
params.series_id,
|
|
2637
|
+
params.start_date,
|
|
2638
|
+
params.end_date,
|
|
2639
|
+
params.units
|
|
2640
|
+
);
|
|
2641
|
+
return successResult(JSON.stringify(result, null, 2));
|
|
2642
|
+
}, metadata2)
|
|
2643
|
+
};
|
|
2644
|
+
const searchTool = {
|
|
2645
|
+
name: "fred_search",
|
|
2646
|
+
description: "Search FRED for economic data series by keyword. Returns series IDs that can be used with fred_indicator and fred_indicator_history. Results sorted by relevance. Use to discover series IDs for niche indicators.",
|
|
2647
|
+
inputSchema: z9.object({
|
|
2648
|
+
query: z9.string().describe("Search keywords (e.g. 'consumer price index', 'housing starts')"),
|
|
2649
|
+
limit: z9.number().optional().default(10).describe("Max results (default: 10, max: 50)")
|
|
2650
|
+
}),
|
|
2651
|
+
handler: withMetadata(async (params) => {
|
|
2652
|
+
const results = await searchSeries(apiKey, params.query, params.limit);
|
|
2653
|
+
return successResult(JSON.stringify(results, null, 2));
|
|
2654
|
+
}, metadata2)
|
|
2655
|
+
};
|
|
2656
|
+
return {
|
|
2657
|
+
name: "fred",
|
|
2658
|
+
description: "FRED economic data: calendar, indicators, interest rates, inflation",
|
|
2659
|
+
requiredEnvVars: ["FRED_API_KEY"],
|
|
2660
|
+
tools: [calendarTool, indicatorTool, historyTool, searchTool]
|
|
2661
|
+
};
|
|
2662
|
+
}
|
|
2663
|
+
|
|
2485
2664
|
// src/index.ts
|
|
2486
2665
|
var __filename = fileURLToPath(import.meta.url);
|
|
2487
2666
|
var __dirname = dirname(__filename);
|
|
@@ -2501,6 +2680,9 @@ function buildModules(env) {
|
|
|
2501
2680
|
if (env.ALPHA_VANTAGE_API_KEY) {
|
|
2502
2681
|
modules.push(createAlphaVantageModule(env.ALPHA_VANTAGE_API_KEY));
|
|
2503
2682
|
}
|
|
2683
|
+
if (env.FRED_API_KEY) {
|
|
2684
|
+
modules.push(createFredModule(env.FRED_API_KEY));
|
|
2685
|
+
}
|
|
2504
2686
|
return modules;
|
|
2505
2687
|
}
|
|
2506
2688
|
function printHelp() {
|
|
@@ -2517,15 +2699,16 @@ OPTIONS
|
|
|
2517
2699
|
--modules <list> Comma-separated modules to enable (default: all available)
|
|
2518
2700
|
--default-exchange <ex> Default exchange for symbol resolution (default: NASDAQ)
|
|
2519
2701
|
|
|
2520
|
-
MODULES (
|
|
2521
|
-
tradingview
|
|
2702
|
+
MODULES (47 tools total)
|
|
2703
|
+
tradingview 10 tools Stock scanning, quotes, technicals (no key)
|
|
2522
2704
|
tradingview-crypto 4 tools Crypto pair scanning and technicals (no key)
|
|
2523
2705
|
sec-edgar 6 tools SEC filings, insider trades, holdings (no key)
|
|
2524
2706
|
coingecko 3 tools Crypto market data and trending (no key)
|
|
2525
|
-
options
|
|
2707
|
+
options 5 tools Options chains, Greeks, unusual activity (no key)
|
|
2526
2708
|
options-cboe 1 tool CBOE put/call ratio sentiment (no key)
|
|
2527
2709
|
finnhub 9 tools Quotes, profiles, peers, news, earnings (FINNHUB_API_KEY)
|
|
2528
2710
|
alpha-vantage 5 tools Stock quotes, fundamentals, dividends (ALPHA_VANTAGE_API_KEY)
|
|
2711
|
+
fred 4 tools Economic calendar, indicators, rates (FRED_API_KEY)
|
|
2529
2712
|
|
|
2530
2713
|
SETUP (Claude Code)
|
|
2531
2714
|
Add to ~/.claude.json or .mcp.json:
|
|
@@ -2537,7 +2720,8 @@ SETUP (Claude Code)
|
|
|
2537
2720
|
"args": ["-y", "stock-scanner-mcp"],
|
|
2538
2721
|
"env": {
|
|
2539
2722
|
"FINNHUB_API_KEY": "your-key",
|
|
2540
|
-
"ALPHA_VANTAGE_API_KEY": "your-key"
|
|
2723
|
+
"ALPHA_VANTAGE_API_KEY": "your-key",
|
|
2724
|
+
"FRED_API_KEY": "your-key"
|
|
2541
2725
|
}
|
|
2542
2726
|
}
|
|
2543
2727
|
}
|
|
@@ -2583,7 +2767,7 @@ async function main() {
|
|
|
2583
2767
|
server.registerPrompt("analyze_stock", {
|
|
2584
2768
|
description: "Analyze a stock ticker \u2014 includes crypto correlation check for crypto-related companies",
|
|
2585
2769
|
argsSchema: {
|
|
2586
|
-
ticker:
|
|
2770
|
+
ticker: z10.string().describe("Stock ticker symbol (e.g. AAPL, CIFR, MARA)")
|
|
2587
2771
|
}
|
|
2588
2772
|
}, async ({ ticker }) => {
|
|
2589
2773
|
return {
|
|
@@ -2617,8 +2801,8 @@ async function main() {
|
|
|
2617
2801
|
server.registerPrompt("intraday_candidates", {
|
|
2618
2802
|
description: "Find intraday trading candidates with custom price range and filters",
|
|
2619
2803
|
argsSchema: {
|
|
2620
|
-
min_price:
|
|
2621
|
-
max_price:
|
|
2804
|
+
min_price: z10.string().optional().describe("Minimum stock price (default: 10)"),
|
|
2805
|
+
max_price: z10.string().optional().describe("Maximum stock price (default: 50)")
|
|
2622
2806
|
}
|
|
2623
2807
|
}, async ({ min_price, max_price }) => {
|
|
2624
2808
|
const min = min_price || "10";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stock-scanner-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "MCP server providing Claude Code with real-time stock and crypto market data, SEC filings, insider trades, and technical analysis",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -28,7 +28,23 @@
|
|
|
28
28
|
"market-data",
|
|
29
29
|
"claude-code",
|
|
30
30
|
"claude",
|
|
31
|
-
"ai-tools"
|
|
31
|
+
"ai-tools",
|
|
32
|
+
"price-action",
|
|
33
|
+
"stock-analysis",
|
|
34
|
+
"technical-analysis",
|
|
35
|
+
"fundamental-analysis",
|
|
36
|
+
"options",
|
|
37
|
+
"options-chain",
|
|
38
|
+
"economic-data",
|
|
39
|
+
"fred",
|
|
40
|
+
"finnhub",
|
|
41
|
+
"alpha-vantage",
|
|
42
|
+
"coingecko",
|
|
43
|
+
"trading",
|
|
44
|
+
"investing",
|
|
45
|
+
"financial-data",
|
|
46
|
+
"stock-scanner",
|
|
47
|
+
"stock-screener"
|
|
32
48
|
],
|
|
33
49
|
"author": "Yordan Yordanov",
|
|
34
50
|
"license": "MIT",
|