@dwlf/mcp-server 0.42.0 → 0.43.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/dist/index.js CHANGED
@@ -4,6 +4,7 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
4
4
  import { DWLFClient } from './client.js';
5
5
  import { registerMarketDataTools } from './tools/market-data.js';
6
6
  import { registerRangeTools } from './tools/ranges.js';
7
+ import { registerCycleSetupTools } from './tools/cycle-setups.js';
7
8
  import { registerIndicatorTools } from './tools/indicators.js';
8
9
  import { registerSignalTools } from './tools/signals.js';
9
10
  import { registerWatchlistTools } from './tools/watchlist.js';
@@ -31,6 +32,7 @@ const client = new DWLFClient();
31
32
  // Register all tools — Phase 1 (read)
32
33
  registerMarketDataTools(server, client);
33
34
  registerRangeTools(server, client);
35
+ registerCycleSetupTools(server, client);
34
36
  registerIndicatorTools(server, client);
35
37
  registerSignalTools(server, client);
36
38
  registerWatchlistTools(server, client);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,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CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAErC,gGAAgG;AAChG,yBAAyB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1C,qBAAqB;AACrB,uBAAuB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAExC,oCAAoC;AACpC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { DWLFClient } from '../client.js';
3
+ export declare function registerCycleSetupTools(server: McpServer, client: DWLFClient): void;
4
+ //# sourceMappingURL=cycle-setups.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cycle-setups.d.ts","sourceRoot":"","sources":["../../src/tools/cycle-setups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAC;AAyG3D,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,QAkQ5E"}
@@ -0,0 +1,322 @@
1
+ import { z } from 'zod';
2
+ import { normalizeSymbol } from '../client.js';
3
+ /**
4
+ * Cycle Setup Screener stage transitions (`cycle.setup.*`).
5
+ *
6
+ * The scheduled `cycleSetupTransitions` job classifies the universe daily at
7
+ * 04:12 UTC and writes ONE event row per stage change. Writing the row IS
8
+ * publishing the API — the raw transitions are already reachable via
9
+ * `dwlf_get_events`. What that does not give you is a single call: the events
10
+ * endpoint filters ONE `type` per request, so a caller wanting the whole
11
+ * picture burns five round-trips and then has to group them by hand. The
12
+ * morning brief does exactly that, every day.
13
+ *
14
+ * This tool is the thin wrapper: five parallel fetches, merged, pre-grouped
15
+ * into entered / downgraded / left, newest first.
16
+ *
17
+ * ⚠️ CHARTER NOTE (invariant 2 — "responses are passed through, not
18
+ * re-enveloped"). Row-level, this complies: `project()` spreads the backend
19
+ * row and adds derived fields alongside, so a field the transitions job adds
20
+ * later reaches agents without an edit here.
21
+ *
22
+ * Top-level it necessarily does NOT: this call merges FIVE backend responses,
23
+ * so there is no single envelope to preserve — grouping them is the entire
24
+ * reason the tool exists. Recorded as a deliberate exception rather than
25
+ * drift. If a future backend endpoint returns all five types in one response,
26
+ * this wrapper should be deleted in favour of passing that through.
27
+ */
28
+ /** Stage-entry events, ranked best → worst (mirrors STAGE_RANK in the job). */
29
+ const ENTERED_TYPES = [
30
+ 'cycle.setup.confirmed', // confirmed_setup — weekly window open x fresh daily cycle low
31
+ 'cycle.setup.forming', // awaiting_confirmation — daily pivot still provisional
32
+ 'cycle.setup.window_open', // window_open — weekly window open, no daily pivot yet
33
+ ];
34
+ const DOWNGRADED_TYPE = 'cycle.setup.downgraded'; // stage FELL, window still open
35
+ const LEFT_TYPE = 'cycle.setup.window_closed'; // row gone — the weekly window shut
36
+ const ALL_TYPES = [...ENTERED_TYPES, DOWNGRADED_TYPE, LEFT_TYPE];
37
+ /** Verified 26-Aug-2026 against live `/events`: `{ events, cursor, countTruncated }`. */
38
+ const asArray = (data) => {
39
+ if (Array.isArray(data))
40
+ return data;
41
+ if (data && typeof data === 'object') {
42
+ const events = data.events;
43
+ if (Array.isArray(events))
44
+ return events;
45
+ }
46
+ return [];
47
+ };
48
+ /** True when the payload is an object we do NOT recognise as an events envelope. */
49
+ const isUnrecognised = (data) => !Array.isArray(data) &&
50
+ !!data &&
51
+ typeof data === 'object' &&
52
+ !Array.isArray(data.events);
53
+ const countTruncatedOf = (data) => !Array.isArray(data) &&
54
+ !!data &&
55
+ typeof data === 'object' &&
56
+ data.countTruncated === true;
57
+ const cursorOf = (data) => {
58
+ if (data && typeof data === 'object' && !Array.isArray(data)) {
59
+ const c = data.cursor;
60
+ if (typeof c === 'string' && c)
61
+ return c;
62
+ }
63
+ return null;
64
+ };
65
+ /**
66
+ * Charter invariant 2 — responses are passed through, not re-enveloped:
67
+ * spread the backend row and add derived fields ALONGSIDE it, so a field the
68
+ * transitions job adds later reaches agents without an edit here.
69
+ *
70
+ * `date` is normalised because the two candidate fields carry DIFFERENT
71
+ * precision — verified on live rows: `date: "2026-08-26"` (day) vs
72
+ * `eventTimestamp: "2026-08-26T06:00:00.000Z"` (instant).
73
+ *
74
+ * The SORT key prefers `eventTimestamp`, the display `date` prefers `date`.
75
+ * That asymmetry is deliberate: sorting on the day-precision field collapses
76
+ * every same-day row to midnight, so "newest first" stops ordering within a
77
+ * day — which is most of what this tool returns, since the job writes one
78
+ * batch per morning.
79
+ */
80
+ const project = (e) => ({
81
+ ...e,
82
+ date: e.date ?? e.eventTimestamp,
83
+ });
84
+ /** Kept OUT of `project` so it never reaches the agent-facing payload. */
85
+ const sortKey = (e) => toTime(e.eventTimestamp ?? e.date);
86
+ function toTime(v) {
87
+ if (typeof v === 'number')
88
+ return v;
89
+ const t = Date.parse(String(v ?? ''));
90
+ return Number.isNaN(t) ? 0 : t;
91
+ }
92
+ const newestFirst = (a, b) => b.ms - a.ms;
93
+ export function registerCycleSetupTools(server, client) {
94
+ server.tool('dwlf_get_setup_transitions', 'Cycle Setup Screener stage transitions in ONE call — the five `cycle.setup.*` event types ' +
95
+ 'merged and pre-grouped into `entered` / `downgraded` / `left`, newest first. ' +
96
+ 'Use this instead of five separate `dwlf_get_events` calls (that endpoint filters one `type` per request). ' +
97
+ '💡 This is the delta feed: what CHANGED stage, not what currently sits in the screener — ' +
98
+ 'for the current standing list use `dwlf_get_cycle_setups`. ' +
99
+ '⚠️ SEEDED ROWS ARE EXCLUDED BY DEFAULT. The first live run of the transitions job seeds the ' +
100
+ 'entire current state as `seeded: true` rows (≈34 of them on 27-Aug-2026); they are bookkeeping, ' +
101
+ 'not news, and SPT’s dispatcher does not deliver them either. Counting them as transitions would ' +
102
+ 'report a flood of false “new setups”. `suppressedSeeded` tells you how many were hidden. ' +
103
+ 'Pass `includeSeeded: true` only when auditing the seed itself. ' +
104
+ '📅 Transitions are written by the 04:12 UTC job, so the freshest data appears after that. ' +
105
+ '📑 Each type is paginated to completeness (cursor-followed, 10-page cap). If a type hits the cap the ' +
106
+ 'response carries `truncated: true` + `truncatedTypes` and the counts are PARTIAL — narrow with a ' +
107
+ 'smaller `days` or a `symbol`. A per-type fetch failure sets `partial: true` + `failedTypes` rather ' +
108
+ 'than failing the whole call.', {
109
+ days: z
110
+ .number()
111
+ .int()
112
+ .positive()
113
+ .optional()
114
+ .describe('Look-back window in days. Defaults to 7. The transitions job runs once daily, so `days: 1` ' +
115
+ 'may return nothing if today’s 04:12 run has not happened yet — prefer 2+ for "what changed recently".'),
116
+ symbol: z
117
+ .string()
118
+ .optional()
119
+ .describe('Restrict to one symbol — accepts BTC, BTC/USD, BTC-USD, BTCUSD, or stock tickers.'),
120
+ side: z
121
+ .enum(['long', 'short'])
122
+ .optional()
123
+ .describe('Restrict to one side. Omit for both.'),
124
+ maxRows: z
125
+ .number()
126
+ .int()
127
+ .positive()
128
+ .optional()
129
+ .describe('Max rows returned PER bucket (default 200). `counts` are always complete — this caps only ' +
130
+ 'what is rendered, newest first, and reports `rowsOmitted`.'),
131
+ includeSeeded: z
132
+ .boolean()
133
+ .optional()
134
+ .describe('Include first-run seed rows (`seeded: true`). Defaults to FALSE — they are current-state ' +
135
+ 'bookkeeping, not stage changes. Set true only to audit what the seed wrote.'),
136
+ }, async ({ days, symbol, side, includeSeeded, maxRows }) => {
137
+ try {
138
+ const sym = symbol ? normalizeSymbol(symbol) : undefined;
139
+ const effectiveDays = days ?? 7;
140
+ // One request per type — the endpoint filters a single `type` per
141
+ // call. Run them concurrently; that is the whole point of the tool.
142
+ //
143
+ // `allSettled`, not `all`: with `all`, a transient 500 on one type
144
+ // discards the four successful responses, which is strictly worse
145
+ // than the five separate calls this tool replaces. Partial results
146
+ // degrade visibly via `failedTypes` instead.
147
+ const PAGE_CAP = 10;
148
+ const settled = await Promise.allSettled(ALL_TYPES.map(async (type) => {
149
+ // Follow the cursor. A hard limit with no follow silently drops
150
+ // rows AND makes `counts` confidently wrong rather than obviously
151
+ // partial — the undercount class `dwlf_get_events` was fixed for.
152
+ const rows = [];
153
+ let cursor;
154
+ let pages = 0;
155
+ let truncated = false;
156
+ let unrecognised = false;
157
+ let backendTruncated = false;
158
+ do {
159
+ const data = await client.get('/events', {
160
+ type,
161
+ symbol: sym,
162
+ days: effectiveDays,
163
+ limit: 500,
164
+ cursor,
165
+ });
166
+ // Fail LOUDLY on an unrecognised envelope. An empty array is
167
+ // indistinguishable from a genuinely quiet day, and today's
168
+ // whole bug class was exactly that kind of silence.
169
+ if (isUnrecognised(data))
170
+ unrecognised = true;
171
+ if (countTruncatedOf(data))
172
+ backendTruncated = true;
173
+ rows.push(...asArray(data));
174
+ cursor = cursorOf(data) ?? undefined;
175
+ pages += 1;
176
+ if (cursor && pages >= PAGE_CAP) {
177
+ truncated = true;
178
+ break;
179
+ }
180
+ } while (cursor);
181
+ return { type, rows, truncated, pages, unrecognised, backendTruncated };
182
+ }));
183
+ const results = settled.flatMap((s) => (s.status === 'fulfilled' ? [s.value] : []));
184
+ const failedTypes = settled.flatMap((s, i) => s.status === 'rejected'
185
+ ? [{ type: ALL_TYPES[i], error: String(s.reason?.message ?? s.reason) }]
186
+ : []);
187
+ const truncatedTypes = results.filter((r) => r.truncated).map((r) => r.type);
188
+ const unrecognisedTypes = results.filter((r) => r.unrecognised).map((r) => r.type);
189
+ const backendTruncatedTypes = results.filter((r) => r.backendTruncated).map((r) => r.type);
190
+ const buckets = {
191
+ entered: [],
192
+ downgraded: [],
193
+ left: [],
194
+ };
195
+ // Tallied in the SAME pass as the buckets — a second filtered pass
196
+ // drifts from this one the moment the suppression rule changes, and
197
+ // then byEventType silently stops summing to total.
198
+ // A failed type must NOT read as "0 rows" — that is indistinguishable
199
+ // from a successful empty query. null says "unknown, this one failed".
200
+ const failedSet = new Set(failedTypes.map((f) => f.type));
201
+ const byEventType = Object.fromEntries(ALL_TYPES.map((t) => [t, failedSet.has(t) ? null : 0]));
202
+ let suppressedSeeded = 0;
203
+ let total = 0;
204
+ for (const { type, rows } of results) {
205
+ for (const raw of rows) {
206
+ // `side` lives under `setup` — SPT's mapEventItem nests the
207
+ // screener snapshot there (the flat top-level fields the job
208
+ // writes are stripped by the mapper's allow-list). `seeded`
209
+ // stays top-level: it is row provenance, not part of the
210
+ // snapshot. Getting this wrong is silent in both directions —
211
+ // side filters everything out, or seed suppression no-ops.
212
+ const setup = (raw.setup ?? {});
213
+ // Prefer the nested placement (SPT#596) but tolerate a flat
214
+ // field — the mapper's shape is a cross-repo contract, and a
215
+ // silent all-rows-filtered-out is the worst way to learn it moved.
216
+ const rowSide = setup.side ?? raw.side;
217
+ if (side && rowSide !== side)
218
+ continue;
219
+ if (!includeSeeded && raw.seeded) {
220
+ suppressedSeeded += 1;
221
+ continue;
222
+ }
223
+ total += 1;
224
+ byEventType[type] = (byEventType[type] ?? 0) + 1;
225
+ const bucket = type === DOWNGRADED_TYPE ? 'downgraded' : type === LEFT_TYPE ? 'left' : 'entered';
226
+ buckets[bucket].push({ row: project(raw), ms: sortKey(raw) });
227
+ }
228
+ }
229
+ for (const key of Object.keys(buckets))
230
+ buckets[key].sort(newestFirst);
231
+ // Context ceiling. 10 pages x 500 rows x 5 types could dump thousands
232
+ // of rows into an agent's context. `counts` are computed BEFORE this,
233
+ // so they stay truthful; only the returned rows are capped.
234
+ const cap = maxRows ?? 200;
235
+ let rowsOmitted = 0;
236
+ const output = {};
237
+ for (const [key, list] of Object.entries(buckets)) {
238
+ rowsOmitted += Math.max(0, list.length - cap);
239
+ output[key] = list.slice(0, cap).map((b) => b.row);
240
+ }
241
+ return {
242
+ content: [
243
+ {
244
+ type: 'text',
245
+ text: JSON.stringify({
246
+ transitions: output,
247
+ counts: { total, byEventType },
248
+ suppressedSeeded,
249
+ ...(rowsOmitted > 0
250
+ ? {
251
+ rowsOmitted,
252
+ rowsOmittedHint: `${rowsOmitted} row(s) beyond the ${cap}-per-bucket display cap were omitted ` +
253
+ '(newest kept). This cap affects RENDERED ROWS ONLY — `counts` reflect everything ' +
254
+ 'fetched. Note `counts` are themselves partial if `truncated` or `partial` is set. ' +
255
+ 'Raise `maxRows` or narrow the query.',
256
+ }
257
+ : {}),
258
+ ...(unrecognisedTypes.length > 0
259
+ ? {
260
+ unrecognisedShape: unrecognisedTypes,
261
+ unrecognisedHint: 'The /events envelope was not the expected { events, cursor } shape for: ' +
262
+ `${unrecognisedTypes.join(', ')}. Rows may have been dropped — a zero count ` +
263
+ 'here is NOT evidence of a quiet day. Check the API contract.',
264
+ }
265
+ : {}),
266
+ ...(backendTruncatedTypes.length > 0
267
+ ? { backendCountTruncated: backendTruncatedTypes }
268
+ : {}),
269
+ ...(failedTypes.length > 0
270
+ ? {
271
+ failedTypes,
272
+ partial: true,
273
+ partialHint: `${failedTypes.length} of ${ALL_TYPES.length} type queries failed — ` +
274
+ 'the results below are INCOMPLETE. Counts exclude the failed types.',
275
+ }
276
+ : {}),
277
+ ...(truncatedTypes.length > 0
278
+ ? {
279
+ truncated: true,
280
+ truncatedTypes,
281
+ truncatedHint: `Hit the ${PAGE_CAP}-page cap on: ${truncatedTypes.join(', ')}. ` +
282
+ 'FETCHING stopped early, so `counts` for those types are PARTIAL (this is ' +
283
+ 'different from `rowsOmitted`, which only caps rendering). Narrow with a ' +
284
+ 'smaller `days` or a `symbol`.',
285
+ }
286
+ : {}),
287
+ ...(suppressedSeeded > 0
288
+ ? {
289
+ seededHint: `${suppressedSeeded} seed row(s) hidden — first-run current-state bookkeeping, ` +
290
+ 'not stage changes. Pass includeSeeded: true to audit them.',
291
+ }
292
+ : {}),
293
+ filtersApplied: {
294
+ days: effectiveDays,
295
+ ...(days === undefined ? { defaulted: { days: true } } : {}),
296
+ ...(sym ? { symbol: sym } : {}),
297
+ ...(side ? { side } : {}),
298
+ includeSeeded: Boolean(includeSeeded),
299
+ maxRows: cap,
300
+ types: ALL_TYPES,
301
+ },
302
+ }, null, 2),
303
+ },
304
+ ],
305
+ };
306
+ }
307
+ catch (error) {
308
+ // isError so a 401/500/timeout is not delivered to the client as a
309
+ // *successful* result whose text merely starts with "Error…".
310
+ return {
311
+ isError: true,
312
+ content: [
313
+ {
314
+ type: 'text',
315
+ text: `Error fetching setup transitions: ${error instanceof Error ? error.message : String(error)}`,
316
+ },
317
+ ],
318
+ };
319
+ }
320
+ });
321
+ }
322
+ //# sourceMappingURL=cycle-setups.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cycle-setups.js","sourceRoot":"","sources":["../../src/tools/cycle-setups.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,+EAA+E;AAC/E,MAAM,aAAa,GAAG;IACpB,uBAAuB,EAAO,+DAA+D;IAC7F,qBAAqB,EAAS,wDAAwD;IACtF,yBAAyB,EAAK,uDAAuD;CAC7E,CAAC;AAEX,MAAM,eAAe,GAAG,wBAAwB,CAAC,CAAG,gCAAgC;AACpF,MAAM,SAAS,GAAG,2BAA2B,CAAC,CAAM,oCAAoC;AAExF,MAAM,SAAS,GAAG,CAAC,GAAG,aAAa,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;AAIjE,yFAAyF;AACzF,MAAM,OAAO,GAAG,CAAC,IAAa,EAAc,EAAE;IAC5C,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,IAAkB,CAAC;IACnD,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACrC,MAAM,MAAM,GAAI,IAAgC,CAAC,MAAM,CAAC;QACxD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,OAAO,MAAoB,CAAC;IACzD,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAEF,oFAAoF;AACpF,MAAM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",
3
- "version": "0.42.0",
4
- "description": "MCP server for DWLF market analysis platform \u2014 exposes market data, indicators, signals, strategies, backtests, portfolio, trade journal, and more as AI-accessible tools",
3
+ "version": "0.43.0",
4
+ "description": "MCP server for DWLF market analysis platform — exposes market data, indicators, signals, strategies, backtests, portfolio, trade journal, and more as AI-accessible tools",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "bin": {