@insightsentry/mcp 1.4.40 → 1.4.42

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 CHANGED
@@ -55,6 +55,16 @@ Use `npx` in your MCP config:
55
55
  The MCP server also falls back to the key saved by `insight login` when `INSIGHTSENTRY_API_KEY` is not set.
56
56
  Set `INSIGHTSENTRY_CONFIG_DIR` to force the CLI and MCP server to read the same saved-login directory when they run with different home directories.
57
57
 
58
+ ### Bounded live collection for AI agents
59
+
60
+ The MCP server exposes `collect_live` and `collect_newsfeed`. Both return structured JSON and stop
61
+ after 20 data messages or 10 seconds by default. Calls can request up to 100 messages or 60 seconds;
62
+ whichever limit is reached first ends the collection. A fixed response-size limit may stop a call
63
+ earlier; check `stop_reason`. The structured result includes `activated`, while the text response is
64
+ a short summary so message data is not duplicated. If the subscription does not activate before the
65
+ duration limit, the call returns `activation_timeout`. Use the CLI commands below for continuous
66
+ terminal streaming.
67
+
58
68
  ## CLI Usage
59
69
 
60
70
  ```bash
@@ -70,10 +80,11 @@ insight whoami
70
80
  insight search_symbols --query "tesla"
71
81
  insight get_quotes --codes "NASDAQ:AAPL,NASDAQ:MSFT"
72
82
  insight get_symbol_series --symbol "NASDAQ:AAPL" --bar_type day --dp 30
83
+ insight get_options_snapshot --code "CBOE:VIX_W" --range 10
73
84
  insight screen_stocks --fields "close,volume,market_cap" --exchanges "NYSE,NASDAQ" --sortBy market_cap --sortOrder desc
74
85
  insight download_history --symbol "NASDAQ:AAPL" --bar_type day --from 2024-01-01 --to 2024-06-30 --output_dir ./history
75
- insight stream_live --symbols "NASDAQ:AAPL,NASDAQ:MSFT" --type both --bar_type minute --bar_interval 1
76
- insight stream_newsfeed --output_file ./news.ndjson --append
86
+ insight stream_live --symbols "NASDAQ:AAPL,NASDAQ:MSFT" --type both --bar_type minute --bar_interval 1 --max_messages 100 --duration_seconds 30
87
+ insight stream_newsfeed --output_file ./news.ndjson --append --duration_seconds 30
77
88
  ```
78
89
 
79
90
  Symbol codes must use `EXCHANGE:SYMBOL` format. Use `search_symbols` before calling symbol tools.
@@ -98,21 +109,23 @@ The long-running WebSocket commands are available through the terminal CLI:
98
109
 
99
110
  ```bash
100
111
  # Use the same settings for every symbol
101
- insight stream_live --symbols "NASDAQ:AAPL,NASDAQ:MSFT" --type quote
112
+ insight stream_live --symbols "NASDAQ:AAPL,NASDAQ:MSFT" --type quote \
113
+ --max_messages 100 --duration_seconds 30
102
114
 
103
115
  # Use different settings per symbol
104
116
  insight stream_live \
105
- --subscriptions '[{"code":"NASDAQ:AAPL","type":"series","bar_type":"minute","bar_interval":5},{"code":"NASDAQ:MSFT","type":"quote"}]'
117
+ --subscriptions '[{"code":"NASDAQ:AAPL","type":"series","bar_type":"minute","bar_interval":5},{"code":"NASDAQ:MSFT","type":"quote"}]' \
118
+ --duration_seconds 60
106
119
 
107
120
  # Collect 100 data messages, then disconnect successfully
108
121
  insight stream_live --symbols "NASDAQ:AAPL" --type quote --max_messages 100
109
122
 
110
123
  # Stream all news to stdout
111
- insight stream_newsfeed
124
+ insight stream_newsfeed --max_messages 20 --duration_seconds 30
112
125
 
113
126
  # Append filtered news to a file and also emit it to stdout
114
127
  insight stream_newsfeed --content "earnings" --related_symbols "NASDAQ:AAPL" \
115
- --output_file ./news.ndjson --append --tee
128
+ --output_file ./news.ndjson --append --tee --duration_seconds 60
116
129
  ```
117
130
 
118
131
  In an interactive terminal, run `insight stream_live` or choose it from the no-argument command
@@ -124,7 +137,8 @@ unless `--append` is set; `--tee` also writes the same lines to stdout. Connecti
124
137
  and local errors are written to stderr, so stdout remains valid NDJSON and can be piped safely:
125
138
 
126
139
  ```bash
127
- insight stream_live --symbols "NASDAQ:AAPL" --type quote | jq -c .
140
+ insight stream_live --symbols "NASDAQ:AAPL" --type quote \
141
+ --max_messages 20 --duration_seconds 30 --quiet | jq -c .
128
142
  ```
129
143
 
130
144
  The CLI answers WebSocket control pings, reconnects with bounded exponential backoff, and resends
@@ -138,6 +152,9 @@ and exits successfully. The message limit counts quote, series, or news data—n
138
152
  market-data timestamp frames—and continues across reconnects. `--max_reconnect_attempts 0` disables
139
153
  automatic reconnects.
140
154
 
155
+ Use `--quiet` to suppress WebSocket connection and status diagnostics. Preflight errors still use
156
+ stderr, received server error frames remain in NDJSON, and failures retain a non-zero exit code.
157
+
141
158
  Newsfeed connections replay up to 10 recent matching items before streaming new items. Reconnecting
142
159
  can therefore repeat items already written; consumers should deduplicate by `link`, or by
143
160
  `published_at`, `source`, and `title` when no link is present. Content terms are matched with OR,
@@ -145,10 +162,10 @@ while populated `source`, `related_symbols`, and `content` filters are combined
145
162
 
146
163
  Quote updates can be sparse. Merge updates by `code` when maintaining a current quote snapshot.
147
164
 
148
- Run `insight stream_live --help` or `insight stream_newsfeed --help` for every flag. WebSocket
149
- streaming is CLI-only and is not registered as a long-running MCP tool.
165
+ Run `insight stream_live --help` or `insight stream_newsfeed --help` for every flag. Continuous
166
+ WebSocket streaming is CLI-only; use the bounded MCP collection tools from an AI client.
150
167
 
151
- ## Tools
168
+ ## MCP Tools
152
169
 
153
170
  Auth and files:
154
171
 
@@ -158,8 +175,6 @@ Auth and files:
158
175
  | `download_history` | Download date ranges to JSON/CSV files |
159
176
  | `get_symbol_history` | Same as `download_history`; downloads history to files |
160
177
  | `render_chart` | Render Chart.js configs as PNG images |
161
- | `stream_live` | Stream real-time market data as NDJSON |
162
- | `stream_newsfeed` | Stream financial news as NDJSON |
163
178
 
164
179
  Market data:
165
180
 
@@ -172,6 +187,8 @@ Market data:
172
187
  | `get_sip_quotes` | Latest SIP quotes |
173
188
  | `get_sip_series` | Recent SIP market-data series |
174
189
  | `get_sip_history` | SIP intraday history for a specific period |
190
+ | `collect_live` | Collect a bounded sample of live quotes or series |
191
+ | `collect_newsfeed` | Collect a bounded sample of live financial news |
175
192
  | `get_symbol_info` | Symbol metadata |
176
193
  | `get_symbol_session` | Trading hours and session details |
177
194
  | `get_symbol_contracts` | Futures contract list |
@@ -184,6 +201,7 @@ Fundamentals, options, screeners, calendars, documents:
184
201
  | `get_fundamentals_series` | Historical fundamental indicators |
185
202
  | `get_fundamentals_meta` | Available fundamental/technical IDs |
186
203
  | `get_options_contracts` | Option contract metadata and codes |
204
+ | `get_options_snapshot` | Latest option bars, quotes, trades, Greeks, and implied volatility |
187
205
  | `get_options_quotes` | Option quote rows with bid/ask and Greeks |
188
206
  | `screen_stocks`, `screen_etfs`, `screen_bonds`, `screen_crypto` | Screen assets |
189
207
  | `get_stock_screener_params`, `get_etf_screener_params`, `get_bond_screener_params`, `get_crypto_screener_params` | Screener fields |
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAInD,OAAO,EAAE,KAAK,UAAU,EAAyC,MAAM,kBAAkB,CAAC;AAsB1F,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,KAAK,cAAc,EAAmB,MAAM,uBAAuB,CAAC;AAE7E,OAAO,EAKL,KAAK,qBAAqB,EAC3B,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EACL,KAAK,yBAAyB,EAE9B,KAAK,eAAe,EACrB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAyI/C,UAAU,UAAU;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CA6CpD;AAED,wBAAgB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,SAAS,CAAC;CACpD;AAKD,UAAU,mBAAmB;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAOD,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAWrE;AA6xDD,wBAAgB,IAAI,SAgDnB"}
package/dist/cli.js CHANGED
@@ -22,6 +22,7 @@ import { toolDefinitions } from "./tool-definitions.js";
22
22
  import { runApiTool, validateFilterExpression } from "./tool-runner.js";
23
23
  import { fetchLatestPackageVersion, formatUpgradeNotice, formatVersionStatus, getVersionStatus, } from "./version-status.js";
24
24
  import { buildLiveStreamRequest, buildNewsfeedStreamRequest, } from "./websocket-contract.js";
25
+ import { LIVE_STREAM_SCHEMA, NEWSFEED_STREAM_SCHEMA, STREAM_OUTPUT_SCHEMA, } from "./websocket-schemas.js";
25
26
  import { runWebSocketStream, } from "./websocket-stream.js";
26
27
  export { coerceArgs } from "./arg-coercion.js";
27
28
  const DOWNLOAD_HISTORY_COMMAND = "download_history";
@@ -75,83 +76,6 @@ const RENDER_CHART_SCHEMA = {
75
76
  .optional()
76
77
  .describe("Chart height in pixels. Default: 400."),
77
78
  };
78
- const LIVE_STREAM_SCHEMA = {
79
- symbols: z
80
- .string()
81
- .optional()
82
- .describe("Comma-separated EXCHANGE:SYMBOL codes for simple subscriptions."),
83
- type: z
84
- .enum(["quote", "quotes", "series", "both"])
85
- .optional()
86
- .describe("Data to receive for every symbol. quotes is accepted as an alias for quote."),
87
- subscriptions: z
88
- .string()
89
- .optional()
90
- .describe("JSON array of subscription objects for different per-symbol settings."),
91
- bar_type: z
92
- .enum(["tick", "second", "minute", "hour", "day", "week", "month"])
93
- .optional()
94
- .describe("Series bar type."),
95
- bar_interval: z
96
- .number()
97
- .int()
98
- .positive()
99
- .optional()
100
- .describe("Series interval. Tick requires 1; second accepts 1, 5, 10, 15, 30, or 45."),
101
- dp: z
102
- .number()
103
- .int()
104
- .min(1)
105
- .max(30_000)
106
- .optional()
107
- .describe("Initial series data points, 1-30000."),
108
- currency: z.string().optional().describe("Requested currency code."),
109
- unit: z.string().optional().describe("Requested unit code."),
110
- extended: z.boolean().optional().describe("Include extended-hours data."),
111
- "24h": z.boolean().optional().describe("Include 24-hour market data."),
112
- split: z.boolean().optional().describe("Apply split adjustment."),
113
- dadj: z.boolean().optional().describe("Apply dividend adjustment."),
114
- badj: z.boolean().optional().describe("Back-adjust continuous futures."),
115
- settlement: z.boolean().optional().describe("Use settlement as daily close."),
116
- slow_consumer_policy: z
117
- .enum(["disconnect", "adaptive"])
118
- .optional()
119
- .describe("Use adaptive for fresh lower-frequency delivery instead of backlog disconnects."),
120
- };
121
- const NEWSFEED_STREAM_SCHEMA = {
122
- source: z.string().optional().describe("Case-insensitive exact source name."),
123
- related_symbols: z.string().optional().describe("Comma- or space-separated related symbols."),
124
- content: z
125
- .string()
126
- .optional()
127
- .describe("Comma- or space-separated terms; matches when content contains at least one term."),
128
- };
129
- const STREAM_OUTPUT_SCHEMA = {
130
- output_file: z.string().optional().describe("Write NDJSON messages to this file."),
131
- append: z
132
- .boolean()
133
- .optional()
134
- .describe("Append instead of replacing the output file. Requires output_file."),
135
- tee: z.boolean().optional().describe("Also write NDJSON to stdout when output_file is set."),
136
- max_reconnect_attempts: z
137
- .number()
138
- .int()
139
- .min(0)
140
- .max(100)
141
- .optional()
142
- .describe("Maximum consecutive reconnect or request-retry attempts. Use 0 to disable automatic reconnects. Default: 10."),
143
- duration_seconds: z
144
- .number()
145
- .positive()
146
- .optional()
147
- .describe("Stop successfully after this total duration, including reconnects."),
148
- max_messages: z
149
- .number()
150
- .int()
151
- .positive()
152
- .optional()
153
- .describe("Stop successfully after this many data messages; status and time frames do not count."),
154
- };
155
79
  export function parseArgs(argv) {
156
80
  const args = {};
157
81
  const valuelessArgs = new Set();
@@ -227,8 +151,8 @@ export function buildHelp() {
227
151
  lines.push(' insight screen_stocks --fields "close,volume,market_cap" --exchanges "NYSE,NASDAQ" --sortBy market_cap --sortOrder desc');
228
152
  lines.push(" insight get_earnings --c US");
229
153
  lines.push(' insight get_options_contracts --code "NASDAQ:AAPL" --type call --range 10');
230
- lines.push(' insight stream_live --symbols "NASDAQ:AAPL" --type both --bar_type minute');
231
- lines.push(" insight stream_newsfeed --output_file ./news.ndjson --append");
154
+ lines.push(' insight stream_live --symbols "NASDAQ:AAPL" --type both --bar_type minute --max_messages 100 --duration_seconds 30');
155
+ lines.push(" insight stream_newsfeed --output_file ./news.ndjson --append --duration_seconds 30");
232
156
  lines.push("");
233
157
  lines.push("API tools support --filter <jsonata> to transform the response.");
234
158
  lines.push("Use: insight <tool> --help for tool-specific parameters.");
@@ -317,7 +241,7 @@ export function buildStreamHelp(commandName) {
317
241
  : "[optional]";
318
242
  lines.push(` --${key.padEnd(24)} ${formatTypeName(zodType)} ${requirement} ${formatHelpDescription(zodType)}`);
319
243
  }
320
- lines.push("", "Boolean options accept a bare flag or an explicit true/false value.", "Received WebSocket frames use stdout as NDJSON; CLI status and local errors use stderr.");
244
+ lines.push("", "Boolean options accept a bare flag or an explicit true/false value.", "Received WebSocket frames use stdout as NDJSON; CLI status and local errors use stderr.", "Use --quiet to suppress WebSocket status diagnostics for machine-readable terminal output.");
321
245
  if (isLive) {
322
246
  lines.push("Quote updates can be sparse; merge updates by code when maintaining a current snapshot.");
323
247
  }
@@ -327,12 +251,12 @@ export function buildStreamHelp(commandName) {
327
251
  lines.push("");
328
252
  lines.push("Examples:");
329
253
  if (isLive) {
330
- lines.push(' insight stream_live --symbols "NASDAQ:AAPL,NASDAQ:MSFT" --type both --bar_type minute --bar_interval 1');
331
- lines.push(` insight stream_live --subscriptions '[{"code":"NASDAQ:AAPL","type":"series","bar_type":"day"},{"code":"NASDAQ:MSFT","type":"quote"}]' --output_file ./market.ndjson --append`);
254
+ lines.push(' insight stream_live --symbols "NASDAQ:AAPL,NASDAQ:MSFT" --type both --bar_type minute --bar_interval 1 --max_messages 100 --duration_seconds 30');
255
+ lines.push(` insight stream_live --subscriptions '[{"code":"NASDAQ:AAPL","type":"series","bar_type":"day"},{"code":"NASDAQ:MSFT","type":"quote"}]' --output_file ./market.ndjson --append --duration_seconds 60`);
332
256
  }
333
257
  else {
334
- lines.push(" insight stream_newsfeed");
335
- lines.push(' insight stream_newsfeed --content "earnings" --related_symbols "NASDAQ:AAPL" --output_file ./news.ndjson --append');
258
+ lines.push(" insight stream_newsfeed --max_messages 20 --duration_seconds 30");
259
+ lines.push(' insight stream_newsfeed --content "earnings" --related_symbols "NASDAQ:AAPL" --output_file ./news.ndjson --append --duration_seconds 60');
336
260
  }
337
261
  lines.push("");
338
262
  lines.push("Press Ctrl+C to close the socket after queued output is written.");
@@ -393,6 +317,7 @@ const toolExamples = {
393
317
  get_options_snapshot: [
394
318
  'insight get_options_snapshot --code "NASDAQ:AAPL"',
395
319
  'insight get_options_snapshot --code "NASDAQ:AAPL" --expiration "2026-06-19" --type call',
320
+ 'insight get_options_snapshot --code "CBOE:VIX_W" --range 10',
396
321
  ],
397
322
  get_options_quotes: [
398
323
  'insight get_options_quotes --code "NASDAQ:AAPL"',
@@ -897,8 +822,10 @@ async function runStreamCliCommand(commandName, args, valuelessArgs, sessionApiK
897
822
  const request = commandName === STREAM_LIVE_COMMAND
898
823
  ? buildLiveStreamRequest(pickStreamInput(coerced, LIVE_STREAM_SCHEMA), apiKey)
899
824
  : buildNewsfeedStreamRequest(pickStreamInput(coerced, NEWSFEED_STREAM_SCHEMA), apiKey);
900
- reportArgUsage(io, knownArgs, Object.keys(fullSchema), inputArgs);
901
- if (request.ignoredArgs.length > 0) {
825
+ if (coerced.quiet !== true) {
826
+ reportArgUsage(io, knownArgs, Object.keys(fullSchema), inputArgs);
827
+ }
828
+ if (coerced.quiet !== true && request.ignoredArgs.length > 0) {
902
829
  io.progress?.(`Ignoring inapplicable subscription args: ${request.ignoredArgs.join(", ")}`);
903
830
  }
904
831
  const outputFactory = io.createStreamOutput ?? createStreamOutput;
@@ -912,7 +839,7 @@ async function runStreamCliCommand(commandName, args, valuelessArgs, sessionApiK
912
839
  const result = await runner({
913
840
  request,
914
841
  output: streamOutput,
915
- diagnostics: io.progress,
842
+ diagnostics: coerced.quiet === true ? () => { } : io.progress,
916
843
  signal: io.streamSignal,
917
844
  maxReconnectAttempts: typeof coerced.max_reconnect_attempts === "number"
918
845
  ? coerced.max_reconnect_attempts