@insightsentry/mcp 1.2.8 → 1.3.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/chart.d.ts +6 -0
- package/dist/chart.d.ts.map +1 -0
- package/dist/chart.js +32 -0
- package/dist/chart.js.map +1 -0
- package/dist/index.js +107 -1
- package/dist/index.js.map +1 -1
- package/dist/resources.d.ts.map +1 -1
- package/dist/resources.js +0 -16
- package/dist/resources.js.map +1 -1
- package/package.json +4 -2
package/dist/chart.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../src/chart.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAyBnD,wBAAsB,WAAW,CAC/B,MAAM,EAAE,kBAAkB,EAC1B,KAAK,GAAE,MAAsB,EAC7B,MAAM,GAAE,MAAuB,GAC9B,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAW/C"}
|
package/dist/chart.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ChartJSNodeCanvas } from "chartjs-node-canvas";
|
|
2
|
+
import { writeFileSync } from "fs";
|
|
3
|
+
import { tmpdir } from "os";
|
|
4
|
+
import { join } from "path";
|
|
5
|
+
const DEFAULT_WIDTH = 800;
|
|
6
|
+
const DEFAULT_HEIGHT = 400;
|
|
7
|
+
// Cache canvases by dimension to avoid re-creating them
|
|
8
|
+
const canvasCache = new Map();
|
|
9
|
+
function getCanvas(width, height) {
|
|
10
|
+
const key = `${width}x${height}`;
|
|
11
|
+
let canvas = canvasCache.get(key);
|
|
12
|
+
if (!canvas) {
|
|
13
|
+
canvas = new ChartJSNodeCanvas({
|
|
14
|
+
width,
|
|
15
|
+
height,
|
|
16
|
+
backgroundColour: "white",
|
|
17
|
+
});
|
|
18
|
+
canvasCache.set(key, canvas);
|
|
19
|
+
}
|
|
20
|
+
return canvas;
|
|
21
|
+
}
|
|
22
|
+
export async function renderChart(config, width = DEFAULT_WIDTH, height = DEFAULT_HEIGHT) {
|
|
23
|
+
const canvas = getCanvas(width, height);
|
|
24
|
+
const buffer = await canvas.renderToBuffer(config);
|
|
25
|
+
const base64 = buffer.toString("base64");
|
|
26
|
+
// Save to a temp file so the LLM can pass the path directly to the user
|
|
27
|
+
const fileName = `insightsentry_chart_${Date.now()}.png`;
|
|
28
|
+
const filePath = join(tmpdir(), fileName);
|
|
29
|
+
writeFileSync(filePath, buffer);
|
|
30
|
+
return { base64, filePath };
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.js","sourceRoot":"","sources":["../src/chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B,wDAAwD;AACxD,MAAM,WAAW,GAAG,IAAI,GAAG,EAA6B,CAAC;AAEzD,SAAS,SAAS,CAAC,KAAa,EAAE,MAAc;IAC9C,MAAM,GAAG,GAAG,GAAG,KAAK,IAAI,MAAM,EAAE,CAAC;IACjC,IAAI,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAClC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,GAAG,IAAI,iBAAiB,CAAC;YAC7B,KAAK;YACL,MAAM;YACN,gBAAgB,EAAE,OAAO;SAC1B,CAAC,CAAC;QACH,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAA0B,EAC1B,QAAgB,aAAa,EAC7B,SAAiB,cAAc;IAE/B,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IACnD,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAEzC,wEAAwE;IACxE,MAAM,QAAQ,GAAG,uBAAuB,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC;IACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC1C,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAEhC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAC9B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import jsonata from "jsonata";
|
|
|
5
5
|
import { ApiClient } from "./api-client.js";
|
|
6
6
|
import { toolDefinitions } from "./tool-definitions.js";
|
|
7
7
|
import { docResources } from "./resources.js";
|
|
8
|
+
import { renderChart } from "./chart.js";
|
|
8
9
|
const INSTRUCTIONS = `You are connected to the InsightSentry financial data API. You have access to real-time and historical market data for equities, futures, options, crypto, forex, and more.
|
|
9
10
|
|
|
10
11
|
## IMPORTANT: Symbol Code Format
|
|
@@ -76,7 +77,7 @@ Read the documentation resources for comprehensive guides:
|
|
|
76
77
|
- **Symbol format**: Always \`EXCHANGE:SYMBOL\` (e.g., NASDAQ:AAPL, BINANCE:BTCUSDT, CME_MINI:NQ1!)
|
|
77
78
|
- **Option codes**: \`OPRA:AAPL260417P325.0\` = OPRA exchange, AAPL, expires 2026-04-17, Put, $325 strike
|
|
78
79
|
- **Screeners**: First GET to discover fields, then POST to filter. Fields are case-insensitive.
|
|
79
|
-
- **Time series**: \`bar_type\` (tick/second/minute/hour/day/week/month) + \`bar_interval\` (1-1440). Use \`dp\` to control data points (default 3000, max 30000).
|
|
80
|
+
- **Time series**: \`bar_type\` (tick/second/minute/hour/day/week/month) + \`bar_interval\` (1-1440). Use \`dp\` to control data points (default 3000, max 30000). Use \`filter\` to compute aggregates or extract specific fields from the series (e.g., \`series.close\`).
|
|
80
81
|
- **WebSocket**: For real-time streaming, read the websocket resource. Two endpoints: /live (market data) and /newsfeed (news).
|
|
81
82
|
|
|
82
83
|
## Handling Large Responses — Use \`filter\` (JSONata)
|
|
@@ -119,6 +120,49 @@ Screener fields are limited to 10 per request — pick the most relevant ones an
|
|
|
119
120
|
|
|
120
121
|
**Volatility + volume spike** — unusual activity detection:
|
|
121
122
|
\`screen_stocks({ fields: ["close", "market_cap", "volatility_week", "volatility_month", "relative_volume_intraday", "gap", "change_percent"], exchanges: ["NYSE", "NASDAQ"], sortBy: "relative_volume_intraday", sortOrder: "desc", filter: "data[relative_volume_intraday][volatility_week][relative_volume_intraday > 2 and volatility_week > 3].{ \"name\": name, \"code\": symbol_code, \"vol_w\": volatility_week, \"rvol\": relative_volume_intraday, \"gap\": gap, \"chg\": change_percent }" })\`
|
|
123
|
+
|
|
124
|
+
## Charting with \`render_chart\`
|
|
125
|
+
|
|
126
|
+
Use \`render_chart\` to visualize data as PNG images. It accepts a full [Chart.js](https://www.chartjs.org/docs/) configuration as a JSON string. Combine with \`get_symbol_series\` or \`get_symbol_history\` using \`filter\` to extract chart-ready arrays.
|
|
127
|
+
|
|
128
|
+
### Series response format
|
|
129
|
+
\`get_symbol_series\` and \`get_symbol_history\` return:
|
|
130
|
+
\`\`\`json
|
|
131
|
+
{ "code": "NASDAQ:AAPL", "bar_type": "1d", "series": [{ "time": 1733432340, "open": 242.89, "high": 243.09, "low": 242.82, "close": 243.08, "volume": 533779 }, ...] }
|
|
132
|
+
\`\`\`
|
|
133
|
+
Use \`filter\` to extract parallel arrays for charting — e.g., \`filter: "{ \"labels\": series.$fromMillis(time * 1000, \"[M01]/[D01]\"), \"close\": series.close }"\`.
|
|
134
|
+
|
|
135
|
+
### Example: Line chart — daily closing prices
|
|
136
|
+
Step 1: Fetch data with filter to extract labels and values:
|
|
137
|
+
\`get_symbol_series({ symbol: "NASDAQ:AAPL", bar_type: "day", dp: 30, filter: "{ \"labels\": series.$fromMillis(time * 1000, \"[M01]/[D01]\"), \"close\": series.close }" })\`
|
|
138
|
+
→ returns \`{ "labels": ["03/01", "03/02", ...], "close": [242.5, 243.1, ...] }\`
|
|
139
|
+
|
|
140
|
+
Step 2: Pass to render_chart:
|
|
141
|
+
\`render_chart({ config: "{ \"type\": \"line\", \"data\": { \"labels\": [\"03/01\", \"03/02\", ...], \"datasets\": [{ \"label\": \"AAPL Close\", \"data\": [242.5, 243.1, ...], \"borderColor\": \"rgb(59,130,246)\", \"fill\": false, \"pointRadius\": 0 }] }, \"options\": { \"plugins\": { \"title\": { \"display\": true, \"text\": \"AAPL Daily Close (30 days)\" } } } }" })\`
|
|
142
|
+
|
|
143
|
+
### Example: Bar chart — daily volume
|
|
144
|
+
\`get_symbol_series({ symbol: "NASDAQ:AAPL", bar_type: "day", dp: 30, filter: "{ \"labels\": series.$fromMillis(time * 1000, \"[M01]/[D01]\"), \"volume\": series.volume }" })\`
|
|
145
|
+
\`render_chart({ config: "{ \"type\": \"bar\", \"data\": { \"labels\": [...], \"datasets\": [{ \"label\": \"Volume\", \"data\": [...], \"backgroundColor\": \"rgba(59,130,246,0.5)\" }] }, \"options\": { \"plugins\": { \"title\": { \"display\": true, \"text\": \"AAPL Daily Volume\" } } } }" })\`
|
|
146
|
+
|
|
147
|
+
### Example: Multi-line — comparing two symbols
|
|
148
|
+
Fetch both series (can be parallel), then combine into one chart:
|
|
149
|
+
\`render_chart({ config: "{ \"type\": \"line\", \"data\": { \"labels\": [...dates...], \"datasets\": [{ \"label\": \"AAPL\", \"data\": [...], \"borderColor\": \"rgb(59,130,246)\", \"pointRadius\": 0 }, { \"label\": \"MSFT\", \"data\": [...], \"borderColor\": \"rgb(239,68,68)\", \"pointRadius\": 0 }] }, \"options\": { \"plugins\": { \"title\": { \"display\": true, \"text\": \"AAPL vs MSFT\" } } } }" })\`
|
|
150
|
+
|
|
151
|
+
### Example: Candlestick-style OHLC using floating bars
|
|
152
|
+
Chart.js doesn't have a native candlestick type, but you can approximate with floating bar charts:
|
|
153
|
+
\`get_symbol_series({ symbol: "NASDAQ:AAPL", bar_type: "day", dp: 20, filter: "{ \"labels\": series.$fromMillis(time * 1000, \"[M01]/[D01]\"), \"open\": series.open, \"close\": series.close, \"high\": series.high, \"low\": series.low }" })\`
|
|
154
|
+
Use the \`open\` and \`close\` arrays as \`[low, high]\` pairs in a floating bar dataset, with color conditional on open vs close.
|
|
155
|
+
|
|
156
|
+
### Example: Intraday chart from history
|
|
157
|
+
\`get_symbol_history({ symbol: "NASDAQ:AAPL", bar_type: "minute", bar_interval: 5, start_date: "2026-03", filter: "{ \"labels\": series.$fromMillis(time * 1000, \"[H01]:[m01]\"), \"close\": series.close }" })\`
|
|
158
|
+
Then pass labels and close arrays to \`render_chart\` as a line chart.
|
|
159
|
+
|
|
160
|
+
### Tips
|
|
161
|
+
- Use \`filter\` with \`$fromMillis(time * 1000, \"[pattern]\")\` to format Unix timestamps as readable labels. The \`time\` field is in seconds — multiply by 1000 for milliseconds.
|
|
162
|
+
- Set \`pointRadius: 0\` on line charts with many data points for cleaner output.
|
|
163
|
+
- For large datasets (hundreds of points), use \`dp\` to limit data points or increase chart \`width\`.
|
|
164
|
+
- Supported chart types: line, bar, pie, doughnut, radar, polarArea, bubble, scatter.
|
|
165
|
+
- Default dimensions: 800×400px. Use \`width\`/\`height\` params to customize (200–2000px).
|
|
122
166
|
`;
|
|
123
167
|
const apiKey = process.env.INSIGHTSENTRY_API_KEY?.trim();
|
|
124
168
|
function isJwt(token) {
|
|
@@ -192,6 +236,68 @@ for (const tool of toolDefinitions) {
|
|
|
192
236
|
}
|
|
193
237
|
});
|
|
194
238
|
}
|
|
239
|
+
// Register chart rendering tool
|
|
240
|
+
server.registerTool("render_chart", {
|
|
241
|
+
description: "Render a Chart.js chart and return the PNG image. Accepts a full Chart.js configuration object (type, data, options). Supports all Chart.js chart types: line, bar, pie, doughnut, radar, polarArea, bubble, scatter. Use this after fetching market data to visualize trends, comparisons, or distributions.",
|
|
242
|
+
inputSchema: {
|
|
243
|
+
config: z
|
|
244
|
+
.string()
|
|
245
|
+
.describe('Chart.js configuration as a JSON string. Must include "type" and "data" fields. Example: {"type":"line","data":{"labels":["Jan","Feb"],"datasets":[{"label":"Price","data":[100,105]}]},"options":{}}'),
|
|
246
|
+
width: z
|
|
247
|
+
.number()
|
|
248
|
+
.int()
|
|
249
|
+
.min(200)
|
|
250
|
+
.max(2000)
|
|
251
|
+
.default(800)
|
|
252
|
+
.describe("Chart width in pixels (default: 800)")
|
|
253
|
+
.optional(),
|
|
254
|
+
height: z
|
|
255
|
+
.number()
|
|
256
|
+
.int()
|
|
257
|
+
.min(200)
|
|
258
|
+
.max(2000)
|
|
259
|
+
.default(400)
|
|
260
|
+
.describe("Chart height in pixels (default: 400)")
|
|
261
|
+
.optional(),
|
|
262
|
+
},
|
|
263
|
+
}, async (args) => {
|
|
264
|
+
try {
|
|
265
|
+
const config = JSON.parse(args.config);
|
|
266
|
+
if (!config.type || !config.data) {
|
|
267
|
+
return {
|
|
268
|
+
content: [
|
|
269
|
+
{
|
|
270
|
+
type: "text",
|
|
271
|
+
text: 'Error: Chart config must include "type" and "data" fields.',
|
|
272
|
+
},
|
|
273
|
+
],
|
|
274
|
+
isError: true,
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
const { base64, filePath } = await renderChart(config, args.width, args.height);
|
|
278
|
+
return {
|
|
279
|
+
content: [
|
|
280
|
+
{
|
|
281
|
+
type: "image",
|
|
282
|
+
data: base64,
|
|
283
|
+
mimeType: "image/png",
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
type: "text",
|
|
287
|
+
text: `Chart saved to: ${filePath}`,
|
|
288
|
+
},
|
|
289
|
+
],
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
catch (error) {
|
|
293
|
+
return {
|
|
294
|
+
content: [
|
|
295
|
+
{ type: "text", text: `Error: ${error.message}` },
|
|
296
|
+
],
|
|
297
|
+
isError: true,
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
});
|
|
195
301
|
// Register documentation resources
|
|
196
302
|
for (const doc of docResources) {
|
|
197
303
|
server.registerResource(doc.name, doc.uri, { mimeType: doc.mimeType, description: doc.description }, async () => ({
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC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oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/resources.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,EAAE,WAAW,EA+
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,EAAE,WAAW,EA+qFrC,CAAC"}
|
package/dist/resources.js
CHANGED
|
@@ -102,22 +102,6 @@ Use the \`search_symbols\` tool to find symbol codes.
|
|
|
102
102
|
}
|
|
103
103
|
\`\`\`
|
|
104
104
|
|
|
105
|
-
### Compact format (abbr=true)
|
|
106
|
-
Add \`abbr=true\` to get arrays instead of objects — smaller response, same data.
|
|
107
|
-
**Important:** Not all bar types include the same fields. Tick data may only have \`[time, type, close]\` or \`[time, type, close, volume]\`. Always check \`series_keys\` to know the column order.
|
|
108
|
-
\`\`\`json
|
|
109
|
-
{
|
|
110
|
-
"code": "NASDAQ:AAPL",
|
|
111
|
-
"bar_end": 1733432399.0,
|
|
112
|
-
"last_update": 1733432399820,
|
|
113
|
-
"bar_type": "1m",
|
|
114
|
-
"series_keys": ["time", "open", "high", "low", "close", "volume"],
|
|
115
|
-
"series": [
|
|
116
|
-
[1733432340.0, 242.89, 243.09, 242.82, 243.08, 533779.0]
|
|
117
|
-
]
|
|
118
|
-
}
|
|
119
|
-
\`\`\`
|
|
120
|
-
|
|
121
105
|
## Response Format: Quote Data
|
|
122
106
|
\`\`\`json
|
|
123
107
|
{
|
package/dist/resources.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,kFAAkF;AAClF,kEAAkE;AAClE,uCAAuC;AAUvC,MAAM,CAAC,MAAM,YAAY,GAAkB;IACzC;QACE,GAAG,EAAE,+BAA+B;QACpC,IAAI,EAAE,8BAA8B;QACpC,WAAW,EAAE,2GAA2G;QACxH,QAAQ,EAAE,eAAe;QACzB,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,kFAAkF;AAClF,kEAAkE;AAClE,uCAAuC;AAUvC,MAAM,CAAC,MAAM,YAAY,GAAkB;IACzC;QACE,GAAG,EAAE,+BAA+B;QACpC,IAAI,EAAE,8BAA8B;QACpC,WAAW,EAAE,2GAA2G;QACxH,QAAQ,EAAE,eAAe;QACzB,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqHZ;KACE;IACD;QACE,GAAG,EAAE,gCAAgC;QACrC,IAAI,EAAE,qCAAqC;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA8JA;KACV;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@insightsentry/mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "MCP server for InsightSentry financial data API - provides AI-accessible tools for market data, screening, options, and comprehensive API documentation resources",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -30,6 +30,8 @@
|
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
33
|
+
"chart.js": "^4.5.1",
|
|
34
|
+
"chartjs-node-canvas": "^5.0.0",
|
|
33
35
|
"jsonata": "^2.1.0",
|
|
34
36
|
"zod": "^4.3.6"
|
|
35
37
|
},
|
|
@@ -41,4 +43,4 @@
|
|
|
41
43
|
"engines": {
|
|
42
44
|
"node": ">=18"
|
|
43
45
|
}
|
|
44
|
-
}
|
|
46
|
+
}
|