misp-mcp 1.2.0 → 1.3.5
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 +226 -209
- package/dist/chunk-GTLBUJZI.js +2491 -0
- package/dist/chunk-GTLBUJZI.js.map +1 -0
- package/dist/chunk-ZKNV5JUW.js +26 -0
- package/dist/chunk-ZKNV5JUW.js.map +1 -0
- package/dist/cli.d.ts +43 -0
- package/dist/cli.js +332 -0
- package/dist/cli.js.map +1 -0
- package/dist/client-D1YKT07H.d.ts +349 -0
- package/dist/index.d.ts +28 -1
- package/dist/index.js +39 -2368
- package/dist/index.js.map +1 -1
- package/dist/mcp-bin.d.ts +2 -0
- package/dist/mcp-bin.js +14 -0
- package/dist/mcp-bin.js.map +1 -0
- package/package.json +16 -9
package/dist/index.js
CHANGED
|
@@ -1,2379 +1,50 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
import {
|
|
3
|
+
MispClient,
|
|
4
|
+
createMispMcpServer,
|
|
5
|
+
getConfig,
|
|
6
|
+
serveMcp
|
|
7
|
+
} from "./chunk-GTLBUJZI.js";
|
|
8
|
+
|
|
9
|
+
// src/cli-safety.ts
|
|
10
|
+
var CliGateError = class extends Error {
|
|
11
|
+
constructor(message) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.name = "CliGateError";
|
|
12
14
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const verifySsl = process.env.MISP_VERIFY_SSL !== "false";
|
|
18
|
-
const timeout = parseInt(process.env.MISP_TIMEOUT ?? "30", 10) * 1e3;
|
|
19
|
-
return {
|
|
20
|
-
url: url.replace(/\/+$/, ""),
|
|
21
|
-
apiKey,
|
|
22
|
-
verifySsl,
|
|
23
|
-
timeout
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// src/client.ts
|
|
28
|
-
import { Agent } from "undici";
|
|
29
|
-
var ID_PATTERN = /^[A-Za-z0-9_-]+$/;
|
|
30
|
-
function encodeId(id, kind = "id") {
|
|
31
|
-
if (!ID_PATTERN.test(id)) {
|
|
32
|
-
throw new Error(`Invalid ${kind}: ${JSON.stringify(id)}`);
|
|
33
|
-
}
|
|
34
|
-
return encodeURIComponent(id);
|
|
15
|
+
};
|
|
16
|
+
function envEnabled(value) {
|
|
17
|
+
const normalized = value?.trim().toLowerCase();
|
|
18
|
+
return normalized === "1" || normalized === "true";
|
|
35
19
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
constructor(config2) {
|
|
42
|
-
this.baseUrl = config2.url;
|
|
43
|
-
this.apiKey = config2.apiKey;
|
|
44
|
-
this.timeout = config2.timeout;
|
|
45
|
-
this.dispatcher = new Agent({
|
|
46
|
-
connect: { rejectUnauthorized: config2.verifySsl }
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
async request(method, path, body, rawResponse = false) {
|
|
50
|
-
const url = `${this.baseUrl}${path}`;
|
|
51
|
-
const headers = {
|
|
52
|
-
Authorization: this.apiKey,
|
|
53
|
-
Accept: "application/json",
|
|
54
|
-
"Content-Type": "application/json"
|
|
55
|
-
};
|
|
56
|
-
const controller = new AbortController();
|
|
57
|
-
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
58
|
-
const options = {
|
|
59
|
-
method,
|
|
60
|
-
headers,
|
|
61
|
-
body: body ? JSON.stringify(body) : void 0,
|
|
62
|
-
signal: controller.signal,
|
|
63
|
-
dispatcher: this.dispatcher
|
|
64
|
-
};
|
|
65
|
-
let response;
|
|
66
|
-
try {
|
|
67
|
-
response = await fetch(url, options);
|
|
68
|
-
} catch (err) {
|
|
69
|
-
if (err instanceof Error && err.name === "AbortError") {
|
|
70
|
-
throw new Error(`MISP API timeout after ${this.timeout}ms`);
|
|
71
|
-
}
|
|
72
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
73
|
-
throw new Error(`MISP API request failed: ${message}`);
|
|
74
|
-
} finally {
|
|
75
|
-
clearTimeout(timeoutId);
|
|
76
|
-
}
|
|
77
|
-
const text = await response.text();
|
|
78
|
-
if (!response.ok) {
|
|
79
|
-
const statusMessages = {
|
|
80
|
-
401: "Invalid API key or unauthorized",
|
|
81
|
-
403: "Insufficient permissions",
|
|
82
|
-
404: "Resource not found",
|
|
83
|
-
405: "Method not allowed"
|
|
84
|
-
};
|
|
85
|
-
const prefix = statusMessages[response.status] || `HTTP ${response.status}`;
|
|
86
|
-
let detail = "";
|
|
87
|
-
try {
|
|
88
|
-
const parsed = JSON.parse(text);
|
|
89
|
-
detail = parsed.message || parsed.errors || text;
|
|
90
|
-
} catch {
|
|
91
|
-
detail = text;
|
|
92
|
-
}
|
|
93
|
-
throw new Error(`${prefix}: ${detail}`);
|
|
94
|
-
}
|
|
95
|
-
if (rawResponse) {
|
|
96
|
-
return text;
|
|
97
|
-
}
|
|
98
|
-
try {
|
|
99
|
-
return JSON.parse(text);
|
|
100
|
-
} catch {
|
|
101
|
-
throw new Error(`Failed to parse MISP response as JSON: ${text.slice(0, 200)}`);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
// --- Event methods ---
|
|
105
|
-
async searchEvents(params) {
|
|
106
|
-
const body = {
|
|
107
|
-
returnFormat: "json",
|
|
108
|
-
limit: params.limit ?? 50
|
|
109
|
-
};
|
|
110
|
-
if (params.value) body.value = params.value;
|
|
111
|
-
if (params.type) body.type = params.type;
|
|
112
|
-
if (params.category) body.category = params.category;
|
|
113
|
-
if (params.tags) body.tags = params.tags;
|
|
114
|
-
if (params.eventid) body.eventid = params.eventid;
|
|
115
|
-
if (params.org) body.org = params.org;
|
|
116
|
-
if (params.dateFrom) body.from = params.dateFrom;
|
|
117
|
-
if (params.dateTo) body.to = params.dateTo;
|
|
118
|
-
if (params.last) body.last = params.last;
|
|
119
|
-
if (params.published !== void 0) body.published = params.published ? 1 : 0;
|
|
120
|
-
if (params.page) body.page = params.page;
|
|
121
|
-
const data = await this.request(
|
|
122
|
-
"POST",
|
|
123
|
-
"/events/restSearch",
|
|
124
|
-
body
|
|
125
|
-
);
|
|
126
|
-
return (data.response || []).map((r) => r.Event);
|
|
127
|
-
}
|
|
128
|
-
async getEvent(eventId) {
|
|
129
|
-
const data = await this.request(
|
|
130
|
-
"GET",
|
|
131
|
-
`/events/view/${encodeId(eventId, "eventId")}`
|
|
132
|
-
);
|
|
133
|
-
return data.Event;
|
|
134
|
-
}
|
|
135
|
-
async createEvent(params) {
|
|
136
|
-
const eventData = {
|
|
137
|
-
info: params.info,
|
|
138
|
-
distribution: params.distribution,
|
|
139
|
-
threat_level_id: params.threat_level_id,
|
|
140
|
-
analysis: params.analysis
|
|
141
|
-
};
|
|
142
|
-
if (params.date) eventData.date = params.date;
|
|
143
|
-
const data = await this.request("POST", "/events/add", {
|
|
144
|
-
Event: eventData
|
|
145
|
-
});
|
|
146
|
-
if (params.tags && params.tags.length > 0 && data.Event.id) {
|
|
147
|
-
for (const tag of params.tags) {
|
|
148
|
-
await this.tagEvent(data.Event.id, tag);
|
|
149
|
-
}
|
|
150
|
-
return this.getEvent(data.Event.id);
|
|
151
|
-
}
|
|
152
|
-
return data.Event;
|
|
153
|
-
}
|
|
154
|
-
async updateEvent(eventId, params) {
|
|
155
|
-
const eventData = {};
|
|
156
|
-
if (params.info !== void 0) eventData.info = params.info;
|
|
157
|
-
if (params.threat_level_id !== void 0)
|
|
158
|
-
eventData.threat_level_id = params.threat_level_id;
|
|
159
|
-
if (params.analysis !== void 0) eventData.analysis = params.analysis;
|
|
160
|
-
const data = await this.request(
|
|
161
|
-
"POST",
|
|
162
|
-
`/events/edit/${encodeId(eventId, "eventId")}`,
|
|
163
|
-
{ Event: eventData }
|
|
164
|
-
);
|
|
165
|
-
return data.Event;
|
|
166
|
-
}
|
|
167
|
-
async publishEvent(eventId) {
|
|
168
|
-
return this.request(
|
|
169
|
-
"POST",
|
|
170
|
-
`/events/publish/${encodeId(eventId, "eventId")}`
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
async tagEvent(eventId, tag) {
|
|
174
|
-
return this.request("POST", "/events/addTag", {
|
|
175
|
-
event: eventId,
|
|
176
|
-
tag
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
async untagEvent(eventId, tag) {
|
|
180
|
-
return this.request("POST", "/events/removeTag", {
|
|
181
|
-
event: eventId,
|
|
182
|
-
tag
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
// --- Attribute methods ---
|
|
186
|
-
async searchAttributes(params) {
|
|
187
|
-
const body = {
|
|
188
|
-
returnFormat: "json",
|
|
189
|
-
limit: params.limit ?? 50
|
|
190
|
-
};
|
|
191
|
-
if (params.value) body.value = params.value;
|
|
192
|
-
if (params.type) body.type = params.type;
|
|
193
|
-
if (params.category) body.category = params.category;
|
|
194
|
-
if (params.tags) body.tags = params.tags;
|
|
195
|
-
if (params.to_ids !== void 0) body.to_ids = params.to_ids ? 1 : 0;
|
|
196
|
-
if (params.includeCorrelations)
|
|
197
|
-
body.includeCorrelations = 1;
|
|
198
|
-
if (params.last) body.last = params.last;
|
|
199
|
-
const data = await this.request(
|
|
200
|
-
"POST",
|
|
201
|
-
"/attributes/restSearch",
|
|
202
|
-
body
|
|
203
|
-
);
|
|
204
|
-
return data.response?.Attribute || [];
|
|
205
|
-
}
|
|
206
|
-
async addAttribute(eventId, params) {
|
|
207
|
-
const attrData = {
|
|
208
|
-
type: params.type,
|
|
209
|
-
value: params.value
|
|
210
|
-
};
|
|
211
|
-
if (params.category) attrData.category = params.category;
|
|
212
|
-
if (params.to_ids !== void 0) attrData.to_ids = params.to_ids;
|
|
213
|
-
if (params.comment) attrData.comment = params.comment;
|
|
214
|
-
if (params.distribution !== void 0)
|
|
215
|
-
attrData.distribution = params.distribution;
|
|
216
|
-
const data = await this.request(
|
|
217
|
-
"POST",
|
|
218
|
-
`/attributes/add/${encodeId(eventId, "eventId")}`,
|
|
219
|
-
attrData
|
|
220
|
-
);
|
|
221
|
-
if (params.tags && params.tags.length > 0 && data.Attribute?.id) {
|
|
222
|
-
for (const tag of params.tags) {
|
|
223
|
-
await this.request("POST", "/attributes/addTag", {
|
|
224
|
-
attribute: data.Attribute.id,
|
|
225
|
-
tag
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
return data.Attribute;
|
|
230
|
-
}
|
|
231
|
-
async deleteAttribute(attributeId, hard = false) {
|
|
232
|
-
const body = hard ? { hard: 1 } : {};
|
|
233
|
-
return this.request(
|
|
234
|
-
"POST",
|
|
235
|
-
`/attributes/delete/${encodeId(attributeId, "attributeId")}`,
|
|
236
|
-
body
|
|
237
|
-
);
|
|
238
|
-
}
|
|
239
|
-
// --- Describe types ---
|
|
240
|
-
async describeTypes() {
|
|
241
|
-
const data = await this.request(
|
|
242
|
-
"GET",
|
|
243
|
-
"/attributes/describeTypes"
|
|
244
|
-
);
|
|
245
|
-
return data.result;
|
|
246
|
-
}
|
|
247
|
-
// --- Tags ---
|
|
248
|
-
async listTags(search) {
|
|
249
|
-
const path = search ? `/tags/search/${encodeURIComponent(search)}` : "/tags";
|
|
250
|
-
const data = await this.request("GET", path);
|
|
251
|
-
return data.Tag || [];
|
|
252
|
-
}
|
|
253
|
-
// --- Sightings ---
|
|
254
|
-
async addSighting(params) {
|
|
255
|
-
const body = {
|
|
256
|
-
type: params.type
|
|
257
|
-
};
|
|
258
|
-
if (params.value) body.value = params.value;
|
|
259
|
-
if (params.source) body.source = params.source;
|
|
260
|
-
if (params.timestamp) body.timestamp = params.timestamp;
|
|
261
|
-
const path = params.attributeId ? `/sightings/add/${encodeId(params.attributeId, "attributeId")}` : "/sightings/add";
|
|
262
|
-
const data = await this.request("POST", path, body);
|
|
263
|
-
return data.Sighting;
|
|
264
|
-
}
|
|
265
|
-
// --- Warninglists ---
|
|
266
|
-
async checkWarninglists(value) {
|
|
267
|
-
return this.request(
|
|
268
|
-
"POST",
|
|
269
|
-
"/warninglists/checkValue",
|
|
270
|
-
[value]
|
|
271
|
-
);
|
|
272
|
-
}
|
|
273
|
-
// --- Statistics ---
|
|
274
|
-
async getStatistics() {
|
|
275
|
-
return this.request("GET", "/events/index");
|
|
276
|
-
}
|
|
277
|
-
// --- Taxonomies ---
|
|
278
|
-
async listTaxonomies() {
|
|
279
|
-
const data = await this.request("GET", "/taxonomies");
|
|
280
|
-
return (data || []).map((t) => t.Taxonomy);
|
|
281
|
-
}
|
|
282
|
-
// --- Exports ---
|
|
283
|
-
async exportEvents(params) {
|
|
284
|
-
const formatEndpoints = {
|
|
285
|
-
csv: "/events/csv/download",
|
|
286
|
-
stix: "/events/stix/download",
|
|
287
|
-
suricata: "/events/nids/suricata/download",
|
|
288
|
-
snort: "/events/nids/snort/download",
|
|
289
|
-
text: "/attributes/text/download",
|
|
290
|
-
rpz: "/attributes/rpz/download"
|
|
291
|
-
};
|
|
292
|
-
const endpoint = formatEndpoints[params.format];
|
|
293
|
-
if (!endpoint) {
|
|
294
|
-
throw new Error(
|
|
295
|
-
`Unsupported export format: ${params.format}. Supported: ${Object.keys(formatEndpoints).join(", ")}`
|
|
296
|
-
);
|
|
297
|
-
}
|
|
298
|
-
const body = {};
|
|
299
|
-
if (params.eventId) body.eventid = params.eventId;
|
|
300
|
-
if (params.type) body.type = params.type;
|
|
301
|
-
if (params.tags) body.tags = params.tags;
|
|
302
|
-
if (params.last) body.last = params.last;
|
|
303
|
-
return this.request("POST", endpoint, body, true);
|
|
304
|
-
}
|
|
305
|
-
async exportHashes(params) {
|
|
306
|
-
const validFormats = ["md5", "sha1", "sha256"];
|
|
307
|
-
if (!validFormats.includes(params.format)) {
|
|
308
|
-
throw new Error(
|
|
309
|
-
`Unsupported hash format: ${params.format}. Supported: ${validFormats.join(", ")}`
|
|
310
|
-
);
|
|
311
|
-
}
|
|
312
|
-
let path = `/events/hids/${params.format}/download`;
|
|
313
|
-
const queryParts = [];
|
|
314
|
-
if (params.last) queryParts.push(`last=${encodeURIComponent(params.last)}`);
|
|
315
|
-
if (params.tags) queryParts.push(`tags=${encodeURIComponent(params.tags.join(","))}`);
|
|
316
|
-
if (queryParts.length > 0) path += `?${queryParts.join("&")}`;
|
|
317
|
-
return this.request("GET", path, void 0, true);
|
|
318
|
-
}
|
|
319
|
-
// --- Objects ---
|
|
320
|
-
async listObjectTemplates() {
|
|
321
|
-
const data = await this.request("GET", "/objectTemplates");
|
|
322
|
-
return (data || []).map((t) => t.ObjectTemplate);
|
|
323
|
-
}
|
|
324
|
-
async getObjectTemplate(templateId) {
|
|
325
|
-
const data = await this.request(
|
|
326
|
-
"GET",
|
|
327
|
-
`/objectTemplates/view/${encodeId(templateId, "templateId")}`
|
|
328
|
-
);
|
|
329
|
-
return data.ObjectTemplate;
|
|
330
|
-
}
|
|
331
|
-
async addObject(eventId, params) {
|
|
332
|
-
const body = {
|
|
333
|
-
name: params.name,
|
|
334
|
-
Attribute: params.attributes.map((a) => ({
|
|
335
|
-
object_relation: a.object_relation,
|
|
336
|
-
type: a.type,
|
|
337
|
-
value: a.value,
|
|
338
|
-
to_ids: a.to_ids ?? false,
|
|
339
|
-
comment: a.comment
|
|
340
|
-
}))
|
|
341
|
-
};
|
|
342
|
-
if (params.comment) body.comment = params.comment;
|
|
343
|
-
if (params.distribution !== void 0)
|
|
344
|
-
body.distribution = params.distribution;
|
|
345
|
-
const data = await this.request(
|
|
346
|
-
"POST",
|
|
347
|
-
`/objects/add/${encodeId(eventId, "eventId")}`,
|
|
348
|
-
body
|
|
349
|
-
);
|
|
350
|
-
return data.Object;
|
|
351
|
-
}
|
|
352
|
-
async deleteObject(objectId, hard = false) {
|
|
353
|
-
const body = hard ? { hard: 1 } : {};
|
|
354
|
-
return this.request(
|
|
355
|
-
"POST",
|
|
356
|
-
`/objects/delete/${encodeId(objectId, "objectId")}`,
|
|
357
|
-
body
|
|
358
|
-
);
|
|
359
|
-
}
|
|
360
|
-
// --- Galaxies ---
|
|
361
|
-
async listGalaxies() {
|
|
362
|
-
const data = await this.request("GET", "/galaxies");
|
|
363
|
-
return (data || []).map((g) => g.Galaxy);
|
|
364
|
-
}
|
|
365
|
-
async getGalaxy(galaxyId) {
|
|
366
|
-
const data = await this.request("GET", `/galaxies/view/${encodeId(galaxyId, "galaxyId")}`);
|
|
367
|
-
return {
|
|
368
|
-
...data.Galaxy,
|
|
369
|
-
GalaxyCluster: data.GalaxyCluster
|
|
370
|
-
};
|
|
371
|
-
}
|
|
372
|
-
async searchGalaxyClusters(search, galaxyType) {
|
|
373
|
-
const body = {
|
|
374
|
-
searchall: search
|
|
375
|
-
};
|
|
376
|
-
if (galaxyType) body.context = galaxyType;
|
|
377
|
-
const data = await this.request("POST", "/galaxy_clusters/restSearch", body);
|
|
378
|
-
return (data || []).map((c) => c.GalaxyCluster);
|
|
379
|
-
}
|
|
380
|
-
async attachGalaxyCluster(targetType, targetId, galaxyClusterId) {
|
|
381
|
-
if (!ID_PATTERN.test(galaxyClusterId)) {
|
|
382
|
-
throw new Error(`Invalid galaxyClusterId: ${JSON.stringify(galaxyClusterId)}`);
|
|
383
|
-
}
|
|
384
|
-
return this.request(
|
|
385
|
-
"POST",
|
|
386
|
-
`/galaxies/attachCluster/${encodeId(targetId, "targetId")}/${targetType}`,
|
|
387
|
-
{ Galaxy: { target_id: galaxyClusterId } }
|
|
388
|
-
);
|
|
389
|
-
}
|
|
390
|
-
// --- Feeds ---
|
|
391
|
-
async listFeeds() {
|
|
392
|
-
const data = await this.request(
|
|
393
|
-
"GET",
|
|
394
|
-
"/feeds"
|
|
395
|
-
);
|
|
396
|
-
return (data || []).map((f) => f.Feed);
|
|
397
|
-
}
|
|
398
|
-
async toggleFeed(feedId, enable) {
|
|
399
|
-
return this.request(
|
|
400
|
-
"POST",
|
|
401
|
-
`/feeds/${enable ? "enable" : "disable"}/${encodeId(feedId, "feedId")}`
|
|
20
|
+
function requireDestructiveCliGate(options) {
|
|
21
|
+
const env = options.env ?? process.env;
|
|
22
|
+
if (!envEnabled(env.MISP_ALLOW_DESTRUCTIVE)) {
|
|
23
|
+
throw new CliGateError(
|
|
24
|
+
`${options.commandName} is disabled. Set MISP_ALLOW_DESTRUCTIVE=true and pass --confirm --destructive to run destructive CLI commands.`
|
|
402
25
|
);
|
|
403
26
|
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
`/feeds/fetchFromFeed/${encodeId(feedId, "feedId")}`
|
|
27
|
+
if (!options.confirm || !options.destructive) {
|
|
28
|
+
throw new CliGateError(
|
|
29
|
+
`${options.commandName} requires --confirm and --destructive for destructive CLI commands.`
|
|
408
30
|
);
|
|
409
31
|
}
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
// --- Organisations ---
|
|
417
|
-
async listOrganisations(scope = "all") {
|
|
418
|
-
const data = await this.request("GET", `/organisations/index/scope:${scope}`);
|
|
419
|
-
return (data || []).map((o) => o.Organisation);
|
|
420
|
-
}
|
|
421
|
-
async getOrganisation(orgId) {
|
|
422
|
-
const data = await this.request(
|
|
423
|
-
"GET",
|
|
424
|
-
`/organisations/view/${encodeId(orgId, "orgId")}`
|
|
425
|
-
);
|
|
426
|
-
return data.Organisation;
|
|
427
|
-
}
|
|
428
|
-
// --- Server ---
|
|
429
|
-
async getVersion() {
|
|
430
|
-
return this.request("GET", "/servers/getVersion");
|
|
431
|
-
}
|
|
432
|
-
async getServerSettings() {
|
|
433
|
-
try {
|
|
434
|
-
return await this.request(
|
|
435
|
-
"GET",
|
|
436
|
-
"/servers/serverSettings"
|
|
437
|
-
);
|
|
438
|
-
} catch (err) {
|
|
439
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
440
|
-
if (msg.startsWith("Insufficient permissions") || msg.startsWith("HTTP 403")) {
|
|
441
|
-
return {};
|
|
442
|
-
}
|
|
443
|
-
throw err;
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
async listSharingGroups() {
|
|
447
|
-
const data = await this.request("GET", "/sharing_groups");
|
|
448
|
-
return (data.response || []).map((g) => g.SharingGroup);
|
|
449
|
-
}
|
|
450
|
-
async deleteEvent(eventId) {
|
|
451
|
-
return this.request(
|
|
452
|
-
"POST",
|
|
453
|
-
`/events/delete/${encodeId(eventId, "eventId")}`
|
|
32
|
+
}
|
|
33
|
+
function requireHardDeleteCliGate(options) {
|
|
34
|
+
requireDestructiveCliGate(options);
|
|
35
|
+
if (!options.confirmHard) {
|
|
36
|
+
throw new CliGateError(
|
|
37
|
+
`${options.commandName} requires --confirm-hard for permanent hard deletes.`
|
|
454
38
|
);
|
|
455
39
|
}
|
|
456
|
-
};
|
|
457
|
-
|
|
458
|
-
// src/tools/events.ts
|
|
459
|
-
import { z } from "zod";
|
|
460
|
-
function registerEventTools(server2, client2) {
|
|
461
|
-
server2.tool(
|
|
462
|
-
"misp_search_events",
|
|
463
|
-
"Search MISP events by IOC value, type, tags, date range, or organization",
|
|
464
|
-
{
|
|
465
|
-
value: z.string().optional().describe("IOC value to search across all attributes"),
|
|
466
|
-
type: z.string().optional().describe("Attribute type filter (ip-src, ip-dst, domain, md5, sha256, url, email-src, etc.)"),
|
|
467
|
-
category: z.string().optional().describe("Category filter (Network activity, Payload delivery, External analysis, etc.)"),
|
|
468
|
-
tags: z.array(z.string()).optional().describe("Tag filters (e.g., tlp:white, misp-galaxy:mitre-attack-pattern)"),
|
|
469
|
-
eventId: z.string().optional().describe("Specific event ID"),
|
|
470
|
-
org: z.string().optional().describe("Organization filter"),
|
|
471
|
-
dateFrom: z.string().optional().describe("Start date (YYYY-MM-DD)"),
|
|
472
|
-
dateTo: z.string().optional().describe("End date (YYYY-MM-DD)"),
|
|
473
|
-
last: z.string().optional().describe("Relative time (e.g., 1d, 7d, 30d, 6m)"),
|
|
474
|
-
published: z.boolean().optional().describe("Only published events"),
|
|
475
|
-
limit: z.number().optional().describe("Max results (default 50)"),
|
|
476
|
-
page: z.number().optional().describe("Page number for pagination")
|
|
477
|
-
},
|
|
478
|
-
async (params) => {
|
|
479
|
-
try {
|
|
480
|
-
const events = await client2.searchEvents({
|
|
481
|
-
value: params.value,
|
|
482
|
-
type: params.type,
|
|
483
|
-
category: params.category,
|
|
484
|
-
tags: params.tags,
|
|
485
|
-
eventid: params.eventId,
|
|
486
|
-
org: params.org,
|
|
487
|
-
dateFrom: params.dateFrom,
|
|
488
|
-
dateTo: params.dateTo,
|
|
489
|
-
last: params.last,
|
|
490
|
-
published: params.published,
|
|
491
|
-
limit: params.limit,
|
|
492
|
-
page: params.page
|
|
493
|
-
});
|
|
494
|
-
if (events.length === 0) {
|
|
495
|
-
return {
|
|
496
|
-
content: [{ type: "text", text: "No events found matching the search criteria." }]
|
|
497
|
-
};
|
|
498
|
-
}
|
|
499
|
-
const summary = events.map((e) => ({
|
|
500
|
-
id: e.id,
|
|
501
|
-
info: e.info,
|
|
502
|
-
date: e.date,
|
|
503
|
-
threat_level: ["", "High", "Medium", "Low", "Undefined"][parseInt(e.threat_level_id) || 0],
|
|
504
|
-
analysis: ["Initial", "Ongoing", "Complete"][parseInt(e.analysis) || 0],
|
|
505
|
-
published: e.published,
|
|
506
|
-
org: e.Orgc?.name || "Unknown",
|
|
507
|
-
attribute_count: e.attribute_count,
|
|
508
|
-
tags: (e.Tag || []).map((t) => t.name)
|
|
509
|
-
}));
|
|
510
|
-
return {
|
|
511
|
-
content: [
|
|
512
|
-
{
|
|
513
|
-
type: "text",
|
|
514
|
-
text: JSON.stringify(summary, null, 2)
|
|
515
|
-
}
|
|
516
|
-
]
|
|
517
|
-
};
|
|
518
|
-
} catch (err) {
|
|
519
|
-
return {
|
|
520
|
-
content: [
|
|
521
|
-
{ type: "text", text: `Error searching events: ${err instanceof Error ? err.message : String(err)}` }
|
|
522
|
-
],
|
|
523
|
-
isError: true
|
|
524
|
-
};
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
);
|
|
528
|
-
server2.tool(
|
|
529
|
-
"misp_get_event",
|
|
530
|
-
"Get full details of a specific MISP event including all attributes, objects, tags, and related events",
|
|
531
|
-
{
|
|
532
|
-
eventId: z.string().describe("Event ID to retrieve")
|
|
533
|
-
},
|
|
534
|
-
async ({ eventId }) => {
|
|
535
|
-
try {
|
|
536
|
-
const event = await client2.getEvent(eventId);
|
|
537
|
-
const result = {
|
|
538
|
-
id: event.id,
|
|
539
|
-
uuid: event.uuid,
|
|
540
|
-
info: event.info,
|
|
541
|
-
date: event.date,
|
|
542
|
-
threat_level: ["", "High", "Medium", "Low", "Undefined"][parseInt(event.threat_level_id) || 0],
|
|
543
|
-
analysis: ["Initial", "Ongoing", "Complete"][parseInt(event.analysis) || 0],
|
|
544
|
-
distribution: ["Organization", "Community", "Connected communities", "All communities", "Sharing group"][parseInt(event.distribution) || 0],
|
|
545
|
-
published: event.published,
|
|
546
|
-
org: event.Orgc?.name || "Unknown",
|
|
547
|
-
tags: (event.Tag || []).map((t) => t.name),
|
|
548
|
-
attribute_count: event.attribute_count,
|
|
549
|
-
attributes: (event.Attribute || []).map((a) => ({
|
|
550
|
-
id: a.id,
|
|
551
|
-
type: a.type,
|
|
552
|
-
category: a.category,
|
|
553
|
-
value: a.value,
|
|
554
|
-
to_ids: a.to_ids,
|
|
555
|
-
comment: a.comment
|
|
556
|
-
})),
|
|
557
|
-
objects: (event.Object || []).map((o) => ({
|
|
558
|
-
id: o.id,
|
|
559
|
-
name: o.name,
|
|
560
|
-
meta_category: o.meta_category,
|
|
561
|
-
attributes: (o.Attribute || []).map((a) => ({
|
|
562
|
-
type: a.type,
|
|
563
|
-
value: a.value
|
|
564
|
-
}))
|
|
565
|
-
})),
|
|
566
|
-
galaxies: (event.Galaxy || []).map((g) => ({
|
|
567
|
-
name: g.name,
|
|
568
|
-
type: g.type,
|
|
569
|
-
clusters: (g.GalaxyCluster || []).map((c) => c.value)
|
|
570
|
-
})),
|
|
571
|
-
related_events: (event.RelatedEvent || []).map((r) => ({
|
|
572
|
-
id: r.Event.id,
|
|
573
|
-
info: r.Event.info,
|
|
574
|
-
date: r.Event.date
|
|
575
|
-
}))
|
|
576
|
-
};
|
|
577
|
-
return {
|
|
578
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
579
|
-
};
|
|
580
|
-
} catch (err) {
|
|
581
|
-
return {
|
|
582
|
-
content: [
|
|
583
|
-
{ type: "text", text: `Error getting event: ${err instanceof Error ? err.message : String(err)}` }
|
|
584
|
-
],
|
|
585
|
-
isError: true
|
|
586
|
-
};
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
);
|
|
590
|
-
server2.tool(
|
|
591
|
-
"misp_create_event",
|
|
592
|
-
"Create a new MISP event for documenting incidents or threat intelligence. Does not publish - use misp_publish_event separately.",
|
|
593
|
-
{
|
|
594
|
-
info: z.string().describe("Event description/title"),
|
|
595
|
-
distribution: z.union([z.literal(0), z.literal(1), z.literal(2), z.literal(3), z.literal(4)]).describe("0=Organization only, 1=Community, 2=Connected communities, 3=All communities, 4=Sharing group"),
|
|
596
|
-
threatLevel: z.union([z.literal(1), z.literal(2), z.literal(3), z.literal(4)]).describe("1=High, 2=Medium, 3=Low, 4=Undefined"),
|
|
597
|
-
analysis: z.union([z.literal(0), z.literal(1), z.literal(2)]).describe("0=Initial, 1=Ongoing, 2=Complete"),
|
|
598
|
-
date: z.string().optional().describe("Event date (YYYY-MM-DD)"),
|
|
599
|
-
tags: z.array(z.string()).optional().describe("Tags to apply")
|
|
600
|
-
},
|
|
601
|
-
async (params) => {
|
|
602
|
-
try {
|
|
603
|
-
const event = await client2.createEvent({
|
|
604
|
-
info: params.info,
|
|
605
|
-
distribution: params.distribution,
|
|
606
|
-
threat_level_id: params.threatLevel,
|
|
607
|
-
analysis: params.analysis,
|
|
608
|
-
date: params.date,
|
|
609
|
-
tags: params.tags
|
|
610
|
-
});
|
|
611
|
-
return {
|
|
612
|
-
content: [
|
|
613
|
-
{
|
|
614
|
-
type: "text",
|
|
615
|
-
text: JSON.stringify(
|
|
616
|
-
{
|
|
617
|
-
id: event.id,
|
|
618
|
-
uuid: event.uuid,
|
|
619
|
-
info: event.info,
|
|
620
|
-
date: event.date,
|
|
621
|
-
published: event.published,
|
|
622
|
-
tags: (event.Tag || []).map((t) => t.name)
|
|
623
|
-
},
|
|
624
|
-
null,
|
|
625
|
-
2
|
|
626
|
-
)
|
|
627
|
-
}
|
|
628
|
-
]
|
|
629
|
-
};
|
|
630
|
-
} catch (err) {
|
|
631
|
-
return {
|
|
632
|
-
content: [
|
|
633
|
-
{ type: "text", text: `Error creating event: ${err instanceof Error ? err.message : String(err)}` }
|
|
634
|
-
],
|
|
635
|
-
isError: true
|
|
636
|
-
};
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
);
|
|
640
|
-
server2.tool(
|
|
641
|
-
"misp_update_event",
|
|
642
|
-
"Update an existing MISP event's metadata (info, threat level, analysis status). Publishing is separate - use misp_publish_event.",
|
|
643
|
-
{
|
|
644
|
-
eventId: z.string().describe("Event ID to update"),
|
|
645
|
-
info: z.string().optional().describe("New event description"),
|
|
646
|
-
threatLevel: z.union([z.literal(1), z.literal(2), z.literal(3), z.literal(4)]).optional().describe("1=High, 2=Medium, 3=Low, 4=Undefined"),
|
|
647
|
-
analysis: z.union([z.literal(0), z.literal(1), z.literal(2)]).optional().describe("0=Initial, 1=Ongoing, 2=Complete")
|
|
648
|
-
},
|
|
649
|
-
async ({ eventId, info, threatLevel, analysis }) => {
|
|
650
|
-
try {
|
|
651
|
-
const event = await client2.updateEvent(eventId, {
|
|
652
|
-
info,
|
|
653
|
-
threat_level_id: threatLevel,
|
|
654
|
-
analysis
|
|
655
|
-
});
|
|
656
|
-
return {
|
|
657
|
-
content: [
|
|
658
|
-
{
|
|
659
|
-
type: "text",
|
|
660
|
-
text: JSON.stringify(
|
|
661
|
-
{
|
|
662
|
-
id: event.id,
|
|
663
|
-
info: event.info,
|
|
664
|
-
threat_level_id: event.threat_level_id,
|
|
665
|
-
analysis: event.analysis,
|
|
666
|
-
published: event.published
|
|
667
|
-
},
|
|
668
|
-
null,
|
|
669
|
-
2
|
|
670
|
-
)
|
|
671
|
-
}
|
|
672
|
-
]
|
|
673
|
-
};
|
|
674
|
-
} catch (err) {
|
|
675
|
-
return {
|
|
676
|
-
content: [
|
|
677
|
-
{ type: "text", text: `Error updating event: ${err instanceof Error ? err.message : String(err)}` }
|
|
678
|
-
],
|
|
679
|
-
isError: true
|
|
680
|
-
};
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
);
|
|
684
|
-
server2.tool(
|
|
685
|
-
"misp_publish_event",
|
|
686
|
-
"Publish a MISP event, triggering alerts and notifications to sharing partners",
|
|
687
|
-
{
|
|
688
|
-
eventId: z.string().describe("Event ID to publish")
|
|
689
|
-
},
|
|
690
|
-
async ({ eventId }) => {
|
|
691
|
-
try {
|
|
692
|
-
const result = await client2.publishEvent(eventId);
|
|
693
|
-
return {
|
|
694
|
-
content: [
|
|
695
|
-
{ type: "text", text: result.message || `Event ${eventId} published successfully.` }
|
|
696
|
-
]
|
|
697
|
-
};
|
|
698
|
-
} catch (err) {
|
|
699
|
-
return {
|
|
700
|
-
content: [
|
|
701
|
-
{ type: "text", text: `Error publishing event: ${err instanceof Error ? err.message : String(err)}` }
|
|
702
|
-
],
|
|
703
|
-
isError: true
|
|
704
|
-
};
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
);
|
|
708
|
-
server2.tool(
|
|
709
|
-
"misp_tag_event",
|
|
710
|
-
"Add or remove a tag from a MISP event (TLP, MITRE ATT&CK, custom tags)",
|
|
711
|
-
{
|
|
712
|
-
eventId: z.string().describe("Event ID to tag"),
|
|
713
|
-
tag: z.string().describe("Tag name (e.g., tlp:white, misp-galaxy:mitre-attack-pattern)"),
|
|
714
|
-
remove: z.boolean().optional().describe("Set to true to remove the tag instead of adding")
|
|
715
|
-
},
|
|
716
|
-
async ({ eventId, tag, remove }) => {
|
|
717
|
-
try {
|
|
718
|
-
if (remove) {
|
|
719
|
-
await client2.untagEvent(eventId, tag);
|
|
720
|
-
return {
|
|
721
|
-
content: [
|
|
722
|
-
{ type: "text", text: `Tag "${tag}" removed from event ${eventId}.` }
|
|
723
|
-
]
|
|
724
|
-
};
|
|
725
|
-
} else {
|
|
726
|
-
await client2.tagEvent(eventId, tag);
|
|
727
|
-
return {
|
|
728
|
-
content: [
|
|
729
|
-
{ type: "text", text: `Tag "${tag}" added to event ${eventId}.` }
|
|
730
|
-
]
|
|
731
|
-
};
|
|
732
|
-
}
|
|
733
|
-
} catch (err) {
|
|
734
|
-
return {
|
|
735
|
-
content: [
|
|
736
|
-
{ type: "text", text: `Error tagging event: ${err instanceof Error ? err.message : String(err)}` }
|
|
737
|
-
],
|
|
738
|
-
isError: true
|
|
739
|
-
};
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
);
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
// src/tools/attributes.ts
|
|
746
|
-
import { z as z2 } from "zod";
|
|
747
|
-
function registerAttributeTools(server2, client2) {
|
|
748
|
-
server2.tool(
|
|
749
|
-
"misp_search_attributes",
|
|
750
|
-
"Search for specific attributes (IOCs) across all MISP events",
|
|
751
|
-
{
|
|
752
|
-
value: z2.string().optional().describe("IOC value to search"),
|
|
753
|
-
type: z2.string().optional().describe("Attribute type (ip-src, ip-dst, domain, md5, sha256, url, email-src, hostname, etc.)"),
|
|
754
|
-
category: z2.string().optional().describe("Category filter"),
|
|
755
|
-
tags: z2.array(z2.string()).optional().describe("Tag filters"),
|
|
756
|
-
toIds: z2.boolean().optional().describe("Only IDS-flagged attributes"),
|
|
757
|
-
includeCorrelations: z2.boolean().optional().describe("Include correlation data"),
|
|
758
|
-
last: z2.string().optional().describe("Relative time filter (e.g., 1d, 7d, 30d)"),
|
|
759
|
-
limit: z2.number().optional().describe("Max results (default 50)")
|
|
760
|
-
},
|
|
761
|
-
async (params) => {
|
|
762
|
-
try {
|
|
763
|
-
const attributes = await client2.searchAttributes({
|
|
764
|
-
value: params.value,
|
|
765
|
-
type: params.type,
|
|
766
|
-
category: params.category,
|
|
767
|
-
tags: params.tags,
|
|
768
|
-
to_ids: params.toIds,
|
|
769
|
-
includeCorrelations: params.includeCorrelations,
|
|
770
|
-
last: params.last,
|
|
771
|
-
limit: params.limit
|
|
772
|
-
});
|
|
773
|
-
if (attributes.length === 0) {
|
|
774
|
-
return {
|
|
775
|
-
content: [{ type: "text", text: "No attributes found matching the search criteria." }]
|
|
776
|
-
};
|
|
777
|
-
}
|
|
778
|
-
const summary = attributes.map((a) => ({
|
|
779
|
-
id: a.id,
|
|
780
|
-
event_id: a.event_id,
|
|
781
|
-
type: a.type,
|
|
782
|
-
category: a.category,
|
|
783
|
-
value: a.value,
|
|
784
|
-
to_ids: a.to_ids,
|
|
785
|
-
comment: a.comment || void 0,
|
|
786
|
-
tags: (a.Tag || []).map((t) => t.name),
|
|
787
|
-
event_info: a.Event?.info,
|
|
788
|
-
correlations: a.RelatedAttribute ? a.RelatedAttribute.map((r) => ({
|
|
789
|
-
value: r.value,
|
|
790
|
-
type: r.type,
|
|
791
|
-
event_id: r.event_id
|
|
792
|
-
})) : void 0
|
|
793
|
-
}));
|
|
794
|
-
return {
|
|
795
|
-
content: [{ type: "text", text: JSON.stringify(summary, null, 2) }]
|
|
796
|
-
};
|
|
797
|
-
} catch (err) {
|
|
798
|
-
return {
|
|
799
|
-
content: [
|
|
800
|
-
{ type: "text", text: `Error searching attributes: ${err instanceof Error ? err.message : String(err)}` }
|
|
801
|
-
],
|
|
802
|
-
isError: true
|
|
803
|
-
};
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
);
|
|
807
|
-
server2.tool(
|
|
808
|
-
"misp_add_attribute",
|
|
809
|
-
"Add an IOC/attribute to a MISP event",
|
|
810
|
-
{
|
|
811
|
-
eventId: z2.string().describe("Event ID to add the attribute to"),
|
|
812
|
-
type: z2.string().describe("Attribute type (ip-src, ip-dst, domain, md5, sha256, sha1, url, email-src, hostname, filename, etc.)"),
|
|
813
|
-
value: z2.string().describe("The IOC value"),
|
|
814
|
-
category: z2.string().optional().describe("Category (auto-determined from type if omitted)"),
|
|
815
|
-
toIds: z2.boolean().optional().describe("Flag for IDS export (default true for applicable types)"),
|
|
816
|
-
comment: z2.string().optional().describe("Context/notes about this IOC"),
|
|
817
|
-
distribution: z2.number().optional().describe("Distribution level (0-4)"),
|
|
818
|
-
tags: z2.array(z2.string()).optional().describe("Tags to apply to the attribute")
|
|
819
|
-
},
|
|
820
|
-
async (params) => {
|
|
821
|
-
try {
|
|
822
|
-
const attribute = await client2.addAttribute(params.eventId, {
|
|
823
|
-
type: params.type,
|
|
824
|
-
value: params.value,
|
|
825
|
-
category: params.category,
|
|
826
|
-
to_ids: params.toIds,
|
|
827
|
-
comment: params.comment,
|
|
828
|
-
distribution: params.distribution,
|
|
829
|
-
tags: params.tags
|
|
830
|
-
});
|
|
831
|
-
return {
|
|
832
|
-
content: [
|
|
833
|
-
{
|
|
834
|
-
type: "text",
|
|
835
|
-
text: JSON.stringify(
|
|
836
|
-
{
|
|
837
|
-
id: attribute.id,
|
|
838
|
-
event_id: attribute.event_id,
|
|
839
|
-
type: attribute.type,
|
|
840
|
-
category: attribute.category,
|
|
841
|
-
value: attribute.value,
|
|
842
|
-
to_ids: attribute.to_ids
|
|
843
|
-
},
|
|
844
|
-
null,
|
|
845
|
-
2
|
|
846
|
-
)
|
|
847
|
-
}
|
|
848
|
-
]
|
|
849
|
-
};
|
|
850
|
-
} catch (err) {
|
|
851
|
-
return {
|
|
852
|
-
content: [
|
|
853
|
-
{ type: "text", text: `Error adding attribute: ${err instanceof Error ? err.message : String(err)}` }
|
|
854
|
-
],
|
|
855
|
-
isError: true
|
|
856
|
-
};
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
);
|
|
860
|
-
server2.tool(
|
|
861
|
-
"misp_add_attributes_bulk",
|
|
862
|
-
"Add multiple attributes (IOCs) to a MISP event at once",
|
|
863
|
-
{
|
|
864
|
-
eventId: z2.string().describe("Event ID to add attributes to"),
|
|
865
|
-
attributes: z2.array(
|
|
866
|
-
z2.object({
|
|
867
|
-
type: z2.string().describe("Attribute type"),
|
|
868
|
-
value: z2.string().describe("IOC value"),
|
|
869
|
-
category: z2.string().optional().describe("Category"),
|
|
870
|
-
toIds: z2.boolean().optional().describe("IDS flag"),
|
|
871
|
-
comment: z2.string().optional().describe("Comment")
|
|
872
|
-
})
|
|
873
|
-
).describe("Array of attributes to add")
|
|
874
|
-
},
|
|
875
|
-
async ({ eventId, attributes }) => {
|
|
876
|
-
try {
|
|
877
|
-
const results = [];
|
|
878
|
-
for (const attr of attributes) {
|
|
879
|
-
try {
|
|
880
|
-
const created = await client2.addAttribute(eventId, {
|
|
881
|
-
type: attr.type,
|
|
882
|
-
value: attr.value,
|
|
883
|
-
category: attr.category,
|
|
884
|
-
to_ids: attr.toIds,
|
|
885
|
-
comment: attr.comment
|
|
886
|
-
});
|
|
887
|
-
results.push({
|
|
888
|
-
value: attr.value,
|
|
889
|
-
type: attr.type,
|
|
890
|
-
id: created.id
|
|
891
|
-
});
|
|
892
|
-
} catch (err) {
|
|
893
|
-
results.push({
|
|
894
|
-
value: attr.value,
|
|
895
|
-
type: attr.type,
|
|
896
|
-
error: err instanceof Error ? err.message : String(err)
|
|
897
|
-
});
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
const succeeded = results.filter((r) => r.id);
|
|
901
|
-
const failed = results.filter((r) => r.error);
|
|
902
|
-
return {
|
|
903
|
-
content: [
|
|
904
|
-
{
|
|
905
|
-
type: "text",
|
|
906
|
-
text: JSON.stringify(
|
|
907
|
-
{
|
|
908
|
-
total: attributes.length,
|
|
909
|
-
succeeded: succeeded.length,
|
|
910
|
-
failed: failed.length,
|
|
911
|
-
results
|
|
912
|
-
},
|
|
913
|
-
null,
|
|
914
|
-
2
|
|
915
|
-
)
|
|
916
|
-
}
|
|
917
|
-
]
|
|
918
|
-
};
|
|
919
|
-
} catch (err) {
|
|
920
|
-
return {
|
|
921
|
-
content: [
|
|
922
|
-
{ type: "text", text: `Error adding attributes: ${err instanceof Error ? err.message : String(err)}` }
|
|
923
|
-
],
|
|
924
|
-
isError: true
|
|
925
|
-
};
|
|
926
|
-
}
|
|
927
|
-
}
|
|
928
|
-
);
|
|
929
|
-
server2.tool(
|
|
930
|
-
"misp_delete_attribute",
|
|
931
|
-
"Delete (soft or hard) an attribute from MISP",
|
|
932
|
-
{
|
|
933
|
-
attributeId: z2.string().describe("Attribute ID to delete"),
|
|
934
|
-
hard: z2.boolean().optional().describe("Hard delete (permanent) instead of soft delete")
|
|
935
|
-
},
|
|
936
|
-
async ({ attributeId, hard }) => {
|
|
937
|
-
try {
|
|
938
|
-
const result = await client2.deleteAttribute(attributeId, hard);
|
|
939
|
-
return {
|
|
940
|
-
content: [
|
|
941
|
-
{ type: "text", text: result.message || `Attribute ${attributeId} deleted successfully.` }
|
|
942
|
-
]
|
|
943
|
-
};
|
|
944
|
-
} catch (err) {
|
|
945
|
-
return {
|
|
946
|
-
content: [
|
|
947
|
-
{ type: "text", text: `Error deleting attribute: ${err instanceof Error ? err.message : String(err)}` }
|
|
948
|
-
],
|
|
949
|
-
isError: true
|
|
950
|
-
};
|
|
951
|
-
}
|
|
952
|
-
}
|
|
953
|
-
);
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
// src/tools/correlation.ts
|
|
957
|
-
import { z as z3 } from "zod";
|
|
958
|
-
function registerCorrelationTools(server2, client2) {
|
|
959
|
-
server2.tool(
|
|
960
|
-
"misp_correlate",
|
|
961
|
-
"Find correlations for a specific observable value across all MISP events",
|
|
962
|
-
{
|
|
963
|
-
value: z3.string().describe("Observable value to correlate (IP, domain, hash, etc.)")
|
|
964
|
-
},
|
|
965
|
-
async ({ value }) => {
|
|
966
|
-
try {
|
|
967
|
-
const attributes = await client2.searchAttributes({
|
|
968
|
-
value,
|
|
969
|
-
includeCorrelations: true
|
|
970
|
-
});
|
|
971
|
-
if (attributes.length === 0) {
|
|
972
|
-
return {
|
|
973
|
-
content: [{ type: "text", text: `No results found for "${value}" in MISP.` }]
|
|
974
|
-
};
|
|
975
|
-
}
|
|
976
|
-
const eventMap = /* @__PURE__ */ new Map();
|
|
977
|
-
for (const attr of attributes) {
|
|
978
|
-
const eid = attr.event_id;
|
|
979
|
-
if (!eventMap.has(eid)) {
|
|
980
|
-
eventMap.set(eid, {
|
|
981
|
-
event_id: eid,
|
|
982
|
-
event_info: attr.Event?.info || "Unknown",
|
|
983
|
-
attributes: []
|
|
984
|
-
});
|
|
985
|
-
}
|
|
986
|
-
eventMap.get(eid).attributes.push({
|
|
987
|
-
id: attr.id,
|
|
988
|
-
type: attr.type,
|
|
989
|
-
category: attr.category,
|
|
990
|
-
value: attr.value
|
|
991
|
-
});
|
|
992
|
-
}
|
|
993
|
-
const correlations = [];
|
|
994
|
-
for (const attr of attributes) {
|
|
995
|
-
if (attr.RelatedAttribute) {
|
|
996
|
-
for (const rel of attr.RelatedAttribute) {
|
|
997
|
-
correlations.push({
|
|
998
|
-
value: rel.value,
|
|
999
|
-
type: rel.type,
|
|
1000
|
-
event_id: rel.event_id
|
|
1001
|
-
});
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
const result = {
|
|
1006
|
-
searched_value: value,
|
|
1007
|
-
found_in_events: Array.from(eventMap.values()),
|
|
1008
|
-
total_events: eventMap.size,
|
|
1009
|
-
total_attributes: attributes.length,
|
|
1010
|
-
correlations: correlations.length > 0 ? correlations : void 0
|
|
1011
|
-
};
|
|
1012
|
-
return {
|
|
1013
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
1014
|
-
};
|
|
1015
|
-
} catch (err) {
|
|
1016
|
-
return {
|
|
1017
|
-
content: [
|
|
1018
|
-
{ type: "text", text: `Error correlating value: ${err instanceof Error ? err.message : String(err)}` }
|
|
1019
|
-
],
|
|
1020
|
-
isError: true
|
|
1021
|
-
};
|
|
1022
|
-
}
|
|
1023
|
-
}
|
|
1024
|
-
);
|
|
1025
|
-
server2.tool(
|
|
1026
|
-
"misp_get_related_events",
|
|
1027
|
-
"Get events related to a specific event through shared attributes and correlations",
|
|
1028
|
-
{
|
|
1029
|
-
eventId: z3.string().describe("Event ID to find related events for"),
|
|
1030
|
-
maxAttributes: z3.number().int().positive().optional().describe("Max number of to_ids attributes to correlate across (default 20). Higher values hit the MISP API more."),
|
|
1031
|
-
perAttributeLimit: z3.number().int().positive().optional().describe("Max matches to fetch per attribute value (default 100).")
|
|
1032
|
-
},
|
|
1033
|
-
async ({ eventId, maxAttributes, perAttributeLimit }) => {
|
|
1034
|
-
try {
|
|
1035
|
-
const attrCap = maxAttributes ?? 20;
|
|
1036
|
-
const matchLimit = perAttributeLimit ?? 100;
|
|
1037
|
-
const event = await client2.getEvent(eventId);
|
|
1038
|
-
const eventAttributes = event.Attribute || [];
|
|
1039
|
-
if (eventAttributes.length === 0) {
|
|
1040
|
-
return {
|
|
1041
|
-
content: [{ type: "text", text: `Event ${eventId} has no attributes to correlate.` }]
|
|
1042
|
-
};
|
|
1043
|
-
}
|
|
1044
|
-
const relatedMap = /* @__PURE__ */ new Map();
|
|
1045
|
-
if (event.RelatedEvent && event.RelatedEvent.length > 0) {
|
|
1046
|
-
for (const rel of event.RelatedEvent) {
|
|
1047
|
-
relatedMap.set(rel.Event.id, {
|
|
1048
|
-
event_id: rel.Event.id,
|
|
1049
|
-
event_info: rel.Event.info,
|
|
1050
|
-
overlapping_iocs: [],
|
|
1051
|
-
correlation_count: 0
|
|
1052
|
-
});
|
|
1053
|
-
}
|
|
1054
|
-
}
|
|
1055
|
-
const toIdsAttrs = eventAttributes.filter((a) => a.to_ids);
|
|
1056
|
-
const truncatedAttributes = toIdsAttrs.length > attrCap;
|
|
1057
|
-
const valuesToSearch = toIdsAttrs.slice(0, attrCap).map((a) => a.value);
|
|
1058
|
-
let truncatedMatches = false;
|
|
1059
|
-
for (const value of valuesToSearch) {
|
|
1060
|
-
const matches = await client2.searchAttributes({
|
|
1061
|
-
value,
|
|
1062
|
-
includeCorrelations: true,
|
|
1063
|
-
limit: matchLimit
|
|
1064
|
-
});
|
|
1065
|
-
if (matches.length >= matchLimit) {
|
|
1066
|
-
truncatedMatches = true;
|
|
1067
|
-
}
|
|
1068
|
-
for (const match of matches) {
|
|
1069
|
-
if (match.event_id !== eventId) {
|
|
1070
|
-
if (!relatedMap.has(match.event_id)) {
|
|
1071
|
-
relatedMap.set(match.event_id, {
|
|
1072
|
-
event_id: match.event_id,
|
|
1073
|
-
event_info: match.Event?.info || "Unknown",
|
|
1074
|
-
overlapping_iocs: [],
|
|
1075
|
-
correlation_count: 0
|
|
1076
|
-
});
|
|
1077
|
-
}
|
|
1078
|
-
const entry = relatedMap.get(match.event_id);
|
|
1079
|
-
if (!entry.overlapping_iocs.includes(value)) {
|
|
1080
|
-
entry.overlapping_iocs.push(value);
|
|
1081
|
-
}
|
|
1082
|
-
entry.correlation_count++;
|
|
1083
|
-
}
|
|
1084
|
-
}
|
|
1085
|
-
}
|
|
1086
|
-
const related = Array.from(relatedMap.values()).sort(
|
|
1087
|
-
(a, b) => b.correlation_count - a.correlation_count
|
|
1088
|
-
);
|
|
1089
|
-
return {
|
|
1090
|
-
content: [
|
|
1091
|
-
{
|
|
1092
|
-
type: "text",
|
|
1093
|
-
text: JSON.stringify(
|
|
1094
|
-
{
|
|
1095
|
-
event_id: eventId,
|
|
1096
|
-
event_info: event.info,
|
|
1097
|
-
related_events: related,
|
|
1098
|
-
total_related: related.length,
|
|
1099
|
-
truncated: truncatedAttributes || truncatedMatches,
|
|
1100
|
-
truncation_reason: truncatedAttributes ? `Only the first ${attrCap} of ${toIdsAttrs.length} to_ids attributes were correlated. Raise maxAttributes to scan more.` : truncatedMatches ? `At least one attribute hit the per-attribute match limit of ${matchLimit}. Raise perAttributeLimit to see more correlations.` : void 0
|
|
1101
|
-
},
|
|
1102
|
-
null,
|
|
1103
|
-
2
|
|
1104
|
-
)
|
|
1105
|
-
}
|
|
1106
|
-
]
|
|
1107
|
-
};
|
|
1108
|
-
} catch (err) {
|
|
1109
|
-
return {
|
|
1110
|
-
content: [
|
|
1111
|
-
{ type: "text", text: `Error finding related events: ${err instanceof Error ? err.message : String(err)}` }
|
|
1112
|
-
],
|
|
1113
|
-
isError: true
|
|
1114
|
-
};
|
|
1115
|
-
}
|
|
1116
|
-
}
|
|
1117
|
-
);
|
|
1118
|
-
server2.tool(
|
|
1119
|
-
"misp_describe_types",
|
|
1120
|
-
"Get all available MISP attribute types and categories with their mappings",
|
|
1121
|
-
{},
|
|
1122
|
-
async () => {
|
|
1123
|
-
try {
|
|
1124
|
-
const types = await client2.describeTypes();
|
|
1125
|
-
return {
|
|
1126
|
-
content: [{ type: "text", text: JSON.stringify(types, null, 2) }]
|
|
1127
|
-
};
|
|
1128
|
-
} catch (err) {
|
|
1129
|
-
return {
|
|
1130
|
-
content: [
|
|
1131
|
-
{ type: "text", text: `Error getting types: ${err instanceof Error ? err.message : String(err)}` }
|
|
1132
|
-
],
|
|
1133
|
-
isError: true
|
|
1134
|
-
};
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
);
|
|
1138
|
-
}
|
|
1139
|
-
|
|
1140
|
-
// src/tools/tags.ts
|
|
1141
|
-
import { z as z4 } from "zod";
|
|
1142
|
-
function registerTagTools(server2, client2) {
|
|
1143
|
-
server2.tool(
|
|
1144
|
-
"misp_list_tags",
|
|
1145
|
-
"List available MISP tags with usage statistics",
|
|
1146
|
-
{
|
|
1147
|
-
search: z4.string().optional().describe("Search filter for tag names"),
|
|
1148
|
-
limit: z4.number().optional().describe("Max results to return")
|
|
1149
|
-
},
|
|
1150
|
-
async ({ search, limit }) => {
|
|
1151
|
-
try {
|
|
1152
|
-
let tags = await client2.listTags(search);
|
|
1153
|
-
if (limit && limit > 0) {
|
|
1154
|
-
tags = tags.slice(0, limit);
|
|
1155
|
-
}
|
|
1156
|
-
if (tags.length === 0) {
|
|
1157
|
-
return {
|
|
1158
|
-
content: [{ type: "text", text: "No tags found." }]
|
|
1159
|
-
};
|
|
1160
|
-
}
|
|
1161
|
-
const summary = tags.map((t) => ({
|
|
1162
|
-
id: t.id,
|
|
1163
|
-
name: t.name,
|
|
1164
|
-
colour: t.colour,
|
|
1165
|
-
event_count: t.event_count,
|
|
1166
|
-
attribute_count: t.attribute_count
|
|
1167
|
-
}));
|
|
1168
|
-
return {
|
|
1169
|
-
content: [{ type: "text", text: JSON.stringify(summary, null, 2) }]
|
|
1170
|
-
};
|
|
1171
|
-
} catch (err) {
|
|
1172
|
-
return {
|
|
1173
|
-
content: [
|
|
1174
|
-
{ type: "text", text: `Error listing tags: ${err instanceof Error ? err.message : String(err)}` }
|
|
1175
|
-
],
|
|
1176
|
-
isError: true
|
|
1177
|
-
};
|
|
1178
|
-
}
|
|
1179
|
-
}
|
|
1180
|
-
);
|
|
1181
|
-
server2.tool(
|
|
1182
|
-
"misp_search_by_tag",
|
|
1183
|
-
"Search MISP events or attributes by tag (MITRE ATT&CK, TLP, custom tags)",
|
|
1184
|
-
{
|
|
1185
|
-
tag: z4.string().describe("Tag name to search for (e.g., tlp:white, mitre-attack:T1059)"),
|
|
1186
|
-
type: z4.enum(["event", "attribute"]).optional().describe("Search events or attributes (default: event)")
|
|
1187
|
-
},
|
|
1188
|
-
async ({ tag, type: searchType }) => {
|
|
1189
|
-
try {
|
|
1190
|
-
if (searchType === "attribute") {
|
|
1191
|
-
const attributes = await client2.searchAttributes({ tags: [tag] });
|
|
1192
|
-
if (attributes.length === 0) {
|
|
1193
|
-
return {
|
|
1194
|
-
content: [{ type: "text", text: `No attributes found with tag "${tag}".` }]
|
|
1195
|
-
};
|
|
1196
|
-
}
|
|
1197
|
-
const summary2 = attributes.map((a) => ({
|
|
1198
|
-
id: a.id,
|
|
1199
|
-
event_id: a.event_id,
|
|
1200
|
-
type: a.type,
|
|
1201
|
-
value: a.value,
|
|
1202
|
-
category: a.category,
|
|
1203
|
-
event_info: a.Event?.info
|
|
1204
|
-
}));
|
|
1205
|
-
return {
|
|
1206
|
-
content: [{ type: "text", text: JSON.stringify(summary2, null, 2) }]
|
|
1207
|
-
};
|
|
1208
|
-
}
|
|
1209
|
-
const events = await client2.searchEvents({ tags: [tag] });
|
|
1210
|
-
if (events.length === 0) {
|
|
1211
|
-
return {
|
|
1212
|
-
content: [{ type: "text", text: `No events found with tag "${tag}".` }]
|
|
1213
|
-
};
|
|
1214
|
-
}
|
|
1215
|
-
const summary = events.map((e) => ({
|
|
1216
|
-
id: e.id,
|
|
1217
|
-
info: e.info,
|
|
1218
|
-
date: e.date,
|
|
1219
|
-
threat_level: ["", "High", "Medium", "Low", "Undefined"][parseInt(e.threat_level_id) || 0],
|
|
1220
|
-
org: e.Orgc?.name || "Unknown",
|
|
1221
|
-
tags: (e.Tag || []).map((t) => t.name)
|
|
1222
|
-
}));
|
|
1223
|
-
return {
|
|
1224
|
-
content: [{ type: "text", text: JSON.stringify(summary, null, 2) }]
|
|
1225
|
-
};
|
|
1226
|
-
} catch (err) {
|
|
1227
|
-
return {
|
|
1228
|
-
content: [
|
|
1229
|
-
{ type: "text", text: `Error searching by tag: ${err instanceof Error ? err.message : String(err)}` }
|
|
1230
|
-
],
|
|
1231
|
-
isError: true
|
|
1232
|
-
};
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
);
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
// src/tools/exports.ts
|
|
1239
|
-
import { z as z5 } from "zod";
|
|
1240
|
-
function registerExportTools(server2, client2) {
|
|
1241
|
-
server2.tool(
|
|
1242
|
-
"misp_export_iocs",
|
|
1243
|
-
"Export IOCs from MISP in various formats (CSV, STIX, Suricata, Snort, text, RPZ)",
|
|
1244
|
-
{
|
|
1245
|
-
format: z5.enum(["csv", "stix", "suricata", "snort", "text", "rpz"]).describe("Export format"),
|
|
1246
|
-
eventId: z5.string().optional().describe("Specific event ID (or all events if omitted)"),
|
|
1247
|
-
type: z5.string().optional().describe("Filter by attribute type"),
|
|
1248
|
-
tags: z5.array(z5.string()).optional().describe("Filter by tags"),
|
|
1249
|
-
last: z5.string().optional().describe("Relative time filter (e.g., 1d, 7d)")
|
|
1250
|
-
},
|
|
1251
|
-
async (params) => {
|
|
1252
|
-
try {
|
|
1253
|
-
const output = await client2.exportEvents({
|
|
1254
|
-
format: params.format,
|
|
1255
|
-
eventId: params.eventId,
|
|
1256
|
-
type: params.type,
|
|
1257
|
-
tags: params.tags,
|
|
1258
|
-
last: params.last
|
|
1259
|
-
});
|
|
1260
|
-
if (!output || output.trim().length === 0) {
|
|
1261
|
-
return {
|
|
1262
|
-
content: [
|
|
1263
|
-
{ type: "text", text: `No IOCs found for the specified criteria in ${params.format} format.` }
|
|
1264
|
-
]
|
|
1265
|
-
};
|
|
1266
|
-
}
|
|
1267
|
-
return {
|
|
1268
|
-
content: [{ type: "text", text: output }]
|
|
1269
|
-
};
|
|
1270
|
-
} catch (err) {
|
|
1271
|
-
return {
|
|
1272
|
-
content: [
|
|
1273
|
-
{ type: "text", text: `Error exporting IOCs: ${err instanceof Error ? err.message : String(err)}` }
|
|
1274
|
-
],
|
|
1275
|
-
isError: true
|
|
1276
|
-
};
|
|
1277
|
-
}
|
|
1278
|
-
}
|
|
1279
|
-
);
|
|
1280
|
-
server2.tool(
|
|
1281
|
-
"misp_export_hashes",
|
|
1282
|
-
"Export file hashes from MISP for HIDS integration",
|
|
1283
|
-
{
|
|
1284
|
-
format: z5.enum(["md5", "sha1", "sha256"]).describe("Hash format to export"),
|
|
1285
|
-
last: z5.string().optional().describe("Relative time filter (e.g., 1d, 7d)"),
|
|
1286
|
-
tags: z5.array(z5.string()).optional().describe("Filter by tags")
|
|
1287
|
-
},
|
|
1288
|
-
async (params) => {
|
|
1289
|
-
try {
|
|
1290
|
-
const output = await client2.exportHashes({
|
|
1291
|
-
format: params.format,
|
|
1292
|
-
last: params.last,
|
|
1293
|
-
tags: params.tags
|
|
1294
|
-
});
|
|
1295
|
-
if (!output || output.trim().length === 0) {
|
|
1296
|
-
return {
|
|
1297
|
-
content: [
|
|
1298
|
-
{ type: "text", text: `No ${params.format} hashes found for the specified criteria.` }
|
|
1299
|
-
]
|
|
1300
|
-
};
|
|
1301
|
-
}
|
|
1302
|
-
return {
|
|
1303
|
-
content: [{ type: "text", text: output }]
|
|
1304
|
-
};
|
|
1305
|
-
} catch (err) {
|
|
1306
|
-
return {
|
|
1307
|
-
content: [
|
|
1308
|
-
{ type: "text", text: `Error exporting hashes: ${err instanceof Error ? err.message : String(err)}` }
|
|
1309
|
-
],
|
|
1310
|
-
isError: true
|
|
1311
|
-
};
|
|
1312
|
-
}
|
|
1313
|
-
}
|
|
1314
|
-
);
|
|
1315
|
-
}
|
|
1316
|
-
|
|
1317
|
-
// src/tools/sightings.ts
|
|
1318
|
-
import { z as z6 } from "zod";
|
|
1319
|
-
function registerSightingTools(server2, client2) {
|
|
1320
|
-
server2.tool(
|
|
1321
|
-
"misp_add_sighting",
|
|
1322
|
-
"Report a sighting of an IOC (confirms it was observed in the wild, marks as false positive, or sets expiration)",
|
|
1323
|
-
{
|
|
1324
|
-
attributeId: z6.string().optional().describe("Attribute ID to sight (use this or value)"),
|
|
1325
|
-
value: z6.string().optional().describe("Attribute value to sight (use this or attributeId)"),
|
|
1326
|
-
type: z6.union([z6.literal(0), z6.literal(1), z6.literal(2)]).describe("0=Sighting (seen in the wild), 1=False positive, 2=Expiration"),
|
|
1327
|
-
source: z6.string().optional().describe("Source of the sighting (e.g., organization name, sensor ID)"),
|
|
1328
|
-
timestamp: z6.string().optional().describe("Timestamp of the sighting (Unix timestamp)")
|
|
1329
|
-
},
|
|
1330
|
-
async (params) => {
|
|
1331
|
-
try {
|
|
1332
|
-
if (!params.attributeId && !params.value) {
|
|
1333
|
-
return {
|
|
1334
|
-
content: [
|
|
1335
|
-
{ type: "text", text: "Either attributeId or value must be provided." }
|
|
1336
|
-
],
|
|
1337
|
-
isError: true
|
|
1338
|
-
};
|
|
1339
|
-
}
|
|
1340
|
-
const sighting = await client2.addSighting({
|
|
1341
|
-
attributeId: params.attributeId,
|
|
1342
|
-
value: params.value,
|
|
1343
|
-
type: params.type,
|
|
1344
|
-
source: params.source,
|
|
1345
|
-
timestamp: params.timestamp
|
|
1346
|
-
});
|
|
1347
|
-
const typeLabels = ["Sighting", "False positive", "Expiration"];
|
|
1348
|
-
return {
|
|
1349
|
-
content: [
|
|
1350
|
-
{
|
|
1351
|
-
type: "text",
|
|
1352
|
-
text: JSON.stringify(
|
|
1353
|
-
{
|
|
1354
|
-
id: sighting.id,
|
|
1355
|
-
type: typeLabels[params.type],
|
|
1356
|
-
attribute_id: sighting.attribute_id,
|
|
1357
|
-
event_id: sighting.event_id,
|
|
1358
|
-
source: sighting.source,
|
|
1359
|
-
date_sighting: sighting.date_sighting
|
|
1360
|
-
},
|
|
1361
|
-
null,
|
|
1362
|
-
2
|
|
1363
|
-
)
|
|
1364
|
-
}
|
|
1365
|
-
]
|
|
1366
|
-
};
|
|
1367
|
-
} catch (err) {
|
|
1368
|
-
return {
|
|
1369
|
-
content: [
|
|
1370
|
-
{ type: "text", text: `Error adding sighting: ${err instanceof Error ? err.message : String(err)}` }
|
|
1371
|
-
],
|
|
1372
|
-
isError: true
|
|
1373
|
-
};
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1376
|
-
);
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1379
|
-
// src/tools/warninglists.ts
|
|
1380
|
-
import { z as z7 } from "zod";
|
|
1381
|
-
function registerWarninglistTools(server2, client2) {
|
|
1382
|
-
server2.tool(
|
|
1383
|
-
"misp_check_warninglists",
|
|
1384
|
-
"Check if an observable value appears on any MISP warninglists (known benign/false positive lists)",
|
|
1385
|
-
{
|
|
1386
|
-
value: z7.string().describe("Value to check against warninglists (IP, domain, hash, etc.)")
|
|
1387
|
-
},
|
|
1388
|
-
async ({ value }) => {
|
|
1389
|
-
try {
|
|
1390
|
-
const results = await client2.checkWarninglists(value);
|
|
1391
|
-
const matches = results[value] || [];
|
|
1392
|
-
if (matches.length === 0) {
|
|
1393
|
-
return {
|
|
1394
|
-
content: [
|
|
1395
|
-
{
|
|
1396
|
-
type: "text",
|
|
1397
|
-
text: `"${value}" does not appear on any warninglists. This does not confirm it is malicious, but it is not a known benign indicator.`
|
|
1398
|
-
}
|
|
1399
|
-
]
|
|
1400
|
-
};
|
|
1401
|
-
}
|
|
1402
|
-
const summary = matches.map((w) => ({
|
|
1403
|
-
name: w.name,
|
|
1404
|
-
category: w.category,
|
|
1405
|
-
description: w.description,
|
|
1406
|
-
type: w.type
|
|
1407
|
-
}));
|
|
1408
|
-
return {
|
|
1409
|
-
content: [
|
|
1410
|
-
{
|
|
1411
|
-
type: "text",
|
|
1412
|
-
text: JSON.stringify(
|
|
1413
|
-
{
|
|
1414
|
-
value,
|
|
1415
|
-
on_warninglists: true,
|
|
1416
|
-
match_count: matches.length,
|
|
1417
|
-
warninglists: summary,
|
|
1418
|
-
note: "This value appears on known benign/false positive lists. Exercise caution before treating it as malicious."
|
|
1419
|
-
},
|
|
1420
|
-
null,
|
|
1421
|
-
2
|
|
1422
|
-
)
|
|
1423
|
-
}
|
|
1424
|
-
]
|
|
1425
|
-
};
|
|
1426
|
-
} catch (err) {
|
|
1427
|
-
return {
|
|
1428
|
-
content: [
|
|
1429
|
-
{ type: "text", text: `Error checking warninglists: ${err instanceof Error ? err.message : String(err)}` }
|
|
1430
|
-
],
|
|
1431
|
-
isError: true
|
|
1432
|
-
};
|
|
1433
|
-
}
|
|
1434
|
-
}
|
|
1435
|
-
);
|
|
1436
|
-
}
|
|
1437
|
-
|
|
1438
|
-
// src/tools/objects.ts
|
|
1439
|
-
import { z as z8 } from "zod";
|
|
1440
|
-
function registerObjectTools(server2, client2) {
|
|
1441
|
-
server2.tool(
|
|
1442
|
-
"misp_list_object_templates",
|
|
1443
|
-
"List available MISP object templates (file, domain-ip, email, network-connection, etc.)",
|
|
1444
|
-
{
|
|
1445
|
-
search: z8.string().optional().describe("Filter templates by name"),
|
|
1446
|
-
limit: z8.number().optional().describe("Max results (default 50)")
|
|
1447
|
-
},
|
|
1448
|
-
async ({ search, limit }) => {
|
|
1449
|
-
try {
|
|
1450
|
-
const templates = await client2.listObjectTemplates();
|
|
1451
|
-
let filtered = templates;
|
|
1452
|
-
if (search) {
|
|
1453
|
-
const q = search.toLowerCase();
|
|
1454
|
-
filtered = templates.filter(
|
|
1455
|
-
(t) => t.name.toLowerCase().includes(q) || t.description.toLowerCase().includes(q)
|
|
1456
|
-
);
|
|
1457
|
-
}
|
|
1458
|
-
if (limit && limit > 0) {
|
|
1459
|
-
filtered = filtered.slice(0, limit);
|
|
1460
|
-
}
|
|
1461
|
-
if (filtered.length === 0) {
|
|
1462
|
-
return {
|
|
1463
|
-
content: [{ type: "text", text: "No object templates found." }]
|
|
1464
|
-
};
|
|
1465
|
-
}
|
|
1466
|
-
const summary = filtered.map((t) => ({
|
|
1467
|
-
id: t.id,
|
|
1468
|
-
uuid: t.uuid,
|
|
1469
|
-
name: t.name,
|
|
1470
|
-
description: t.description,
|
|
1471
|
-
version: t.version,
|
|
1472
|
-
meta_category: t.meta_category
|
|
1473
|
-
}));
|
|
1474
|
-
return {
|
|
1475
|
-
content: [{ type: "text", text: JSON.stringify(summary, null, 2) }]
|
|
1476
|
-
};
|
|
1477
|
-
} catch (err) {
|
|
1478
|
-
return {
|
|
1479
|
-
content: [
|
|
1480
|
-
{
|
|
1481
|
-
type: "text",
|
|
1482
|
-
text: `Error listing object templates: ${err instanceof Error ? err.message : String(err)}`
|
|
1483
|
-
}
|
|
1484
|
-
],
|
|
1485
|
-
isError: true
|
|
1486
|
-
};
|
|
1487
|
-
}
|
|
1488
|
-
}
|
|
1489
|
-
);
|
|
1490
|
-
server2.tool(
|
|
1491
|
-
"misp_get_object_template",
|
|
1492
|
-
"Get details of a specific MISP object template including required and optional attributes",
|
|
1493
|
-
{
|
|
1494
|
-
templateId: z8.string().describe("Object template ID or UUID")
|
|
1495
|
-
},
|
|
1496
|
-
async ({ templateId }) => {
|
|
1497
|
-
try {
|
|
1498
|
-
const template = await client2.getObjectTemplate(templateId);
|
|
1499
|
-
return {
|
|
1500
|
-
content: [{ type: "text", text: JSON.stringify(template, null, 2) }]
|
|
1501
|
-
};
|
|
1502
|
-
} catch (err) {
|
|
1503
|
-
return {
|
|
1504
|
-
content: [
|
|
1505
|
-
{
|
|
1506
|
-
type: "text",
|
|
1507
|
-
text: `Error getting object template: ${err instanceof Error ? err.message : String(err)}`
|
|
1508
|
-
}
|
|
1509
|
-
],
|
|
1510
|
-
isError: true
|
|
1511
|
-
};
|
|
1512
|
-
}
|
|
1513
|
-
}
|
|
1514
|
-
);
|
|
1515
|
-
server2.tool(
|
|
1516
|
-
"misp_add_object",
|
|
1517
|
-
"Add a MISP object (structured group of attributes) to an event",
|
|
1518
|
-
{
|
|
1519
|
-
eventId: z8.string().describe("Event ID to add the object to"),
|
|
1520
|
-
templateName: z8.string().describe(
|
|
1521
|
-
"Object template name (e.g., file, domain-ip, email, network-connection, url)"
|
|
1522
|
-
),
|
|
1523
|
-
attributes: z8.array(
|
|
1524
|
-
z8.object({
|
|
1525
|
-
object_relation: z8.string().describe(
|
|
1526
|
-
"Attribute relation within the object (e.g., filename, md5, ip, domain)"
|
|
1527
|
-
),
|
|
1528
|
-
type: z8.string().describe("Attribute type (ip-dst, domain, md5, filename, etc.)"),
|
|
1529
|
-
value: z8.string().describe("Attribute value"),
|
|
1530
|
-
to_ids: z8.boolean().optional().describe("Flag for IDS export"),
|
|
1531
|
-
comment: z8.string().optional().describe("Comment")
|
|
1532
|
-
})
|
|
1533
|
-
).describe("Attributes to include in the object"),
|
|
1534
|
-
comment: z8.string().optional().describe("Object-level comment"),
|
|
1535
|
-
distribution: z8.number().optional().describe("Distribution level (0-4)")
|
|
1536
|
-
},
|
|
1537
|
-
async ({ eventId, templateName, attributes, comment, distribution }) => {
|
|
1538
|
-
try {
|
|
1539
|
-
const result = await client2.addObject(eventId, {
|
|
1540
|
-
name: templateName,
|
|
1541
|
-
attributes,
|
|
1542
|
-
comment,
|
|
1543
|
-
distribution
|
|
1544
|
-
});
|
|
1545
|
-
return {
|
|
1546
|
-
content: [
|
|
1547
|
-
{
|
|
1548
|
-
type: "text",
|
|
1549
|
-
text: JSON.stringify(
|
|
1550
|
-
{
|
|
1551
|
-
id: result.id,
|
|
1552
|
-
name: result.name,
|
|
1553
|
-
event_id: result.event_id,
|
|
1554
|
-
meta_category: result.meta_category,
|
|
1555
|
-
description: result.description,
|
|
1556
|
-
attributes: (result.Attribute || []).map((a) => ({
|
|
1557
|
-
type: a.type,
|
|
1558
|
-
object_relation: a.object_relation,
|
|
1559
|
-
value: a.value
|
|
1560
|
-
}))
|
|
1561
|
-
},
|
|
1562
|
-
null,
|
|
1563
|
-
2
|
|
1564
|
-
)
|
|
1565
|
-
}
|
|
1566
|
-
]
|
|
1567
|
-
};
|
|
1568
|
-
} catch (err) {
|
|
1569
|
-
return {
|
|
1570
|
-
content: [
|
|
1571
|
-
{
|
|
1572
|
-
type: "text",
|
|
1573
|
-
text: `Error adding object: ${err instanceof Error ? err.message : String(err)}`
|
|
1574
|
-
}
|
|
1575
|
-
],
|
|
1576
|
-
isError: true
|
|
1577
|
-
};
|
|
1578
|
-
}
|
|
1579
|
-
}
|
|
1580
|
-
);
|
|
1581
|
-
server2.tool(
|
|
1582
|
-
"misp_delete_object",
|
|
1583
|
-
"Delete a MISP object from an event",
|
|
1584
|
-
{
|
|
1585
|
-
objectId: z8.string().describe("Object ID to delete"),
|
|
1586
|
-
hard: z8.boolean().optional().describe("Hard delete (permanent) instead of soft delete")
|
|
1587
|
-
},
|
|
1588
|
-
async ({ objectId, hard }) => {
|
|
1589
|
-
try {
|
|
1590
|
-
const result = await client2.deleteObject(objectId, hard);
|
|
1591
|
-
return {
|
|
1592
|
-
content: [
|
|
1593
|
-
{
|
|
1594
|
-
type: "text",
|
|
1595
|
-
text: result.message || `Object ${objectId} deleted successfully.`
|
|
1596
|
-
}
|
|
1597
|
-
]
|
|
1598
|
-
};
|
|
1599
|
-
} catch (err) {
|
|
1600
|
-
return {
|
|
1601
|
-
content: [
|
|
1602
|
-
{
|
|
1603
|
-
type: "text",
|
|
1604
|
-
text: `Error deleting object: ${err instanceof Error ? err.message : String(err)}`
|
|
1605
|
-
}
|
|
1606
|
-
],
|
|
1607
|
-
isError: true
|
|
1608
|
-
};
|
|
1609
|
-
}
|
|
1610
|
-
}
|
|
1611
|
-
);
|
|
1612
40
|
}
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
namespace: z9.string().optional().describe(
|
|
1623
|
-
"Filter by namespace (e.g., mitre-attack-pattern, mitre-intrusion-set, mitre-malware)"
|
|
1624
|
-
)
|
|
1625
|
-
},
|
|
1626
|
-
async ({ search, namespace }) => {
|
|
1627
|
-
try {
|
|
1628
|
-
const galaxies = await client2.listGalaxies();
|
|
1629
|
-
let filtered = galaxies;
|
|
1630
|
-
if (search) {
|
|
1631
|
-
const q = search.toLowerCase();
|
|
1632
|
-
filtered = filtered.filter(
|
|
1633
|
-
(g) => g.name.toLowerCase().includes(q) || g.type.toLowerCase().includes(q) || g.description.toLowerCase().includes(q)
|
|
1634
|
-
);
|
|
1635
|
-
}
|
|
1636
|
-
if (namespace) {
|
|
1637
|
-
const ns = namespace.toLowerCase();
|
|
1638
|
-
filtered = filtered.filter(
|
|
1639
|
-
(g) => g.type.toLowerCase().includes(ns)
|
|
1640
|
-
);
|
|
1641
|
-
}
|
|
1642
|
-
if (filtered.length === 0) {
|
|
1643
|
-
return {
|
|
1644
|
-
content: [{ type: "text", text: "No galaxies found matching the criteria." }]
|
|
1645
|
-
};
|
|
1646
|
-
}
|
|
1647
|
-
const summary = filtered.map((g) => ({
|
|
1648
|
-
id: g.id,
|
|
1649
|
-
name: g.name,
|
|
1650
|
-
type: g.type,
|
|
1651
|
-
description: g.description.length > 150 ? g.description.slice(0, 150) + "..." : g.description
|
|
1652
|
-
}));
|
|
1653
|
-
return {
|
|
1654
|
-
content: [{ type: "text", text: JSON.stringify(summary, null, 2) }]
|
|
1655
|
-
};
|
|
1656
|
-
} catch (err) {
|
|
1657
|
-
return {
|
|
1658
|
-
content: [
|
|
1659
|
-
{
|
|
1660
|
-
type: "text",
|
|
1661
|
-
text: `Error listing galaxies: ${err instanceof Error ? err.message : String(err)}`
|
|
1662
|
-
}
|
|
1663
|
-
],
|
|
1664
|
-
isError: true
|
|
1665
|
-
};
|
|
1666
|
-
}
|
|
1667
|
-
}
|
|
1668
|
-
);
|
|
1669
|
-
server2.tool(
|
|
1670
|
-
"misp_get_galaxy",
|
|
1671
|
-
"Get a specific galaxy with its clusters (e.g., MITRE ATT&CK techniques, threat actor profiles)",
|
|
1672
|
-
{
|
|
1673
|
-
galaxyId: z9.string().describe("Galaxy ID to retrieve")
|
|
1674
|
-
},
|
|
1675
|
-
async ({ galaxyId }) => {
|
|
1676
|
-
try {
|
|
1677
|
-
const galaxy = await client2.getGalaxy(galaxyId);
|
|
1678
|
-
const result = {
|
|
1679
|
-
id: galaxy.id,
|
|
1680
|
-
uuid: galaxy.uuid,
|
|
1681
|
-
name: galaxy.name,
|
|
1682
|
-
type: galaxy.type,
|
|
1683
|
-
description: galaxy.description,
|
|
1684
|
-
clusters: (galaxy.GalaxyCluster || []).map((c) => ({
|
|
1685
|
-
id: c.id,
|
|
1686
|
-
value: c.value,
|
|
1687
|
-
description: c.description && c.description.length > 200 ? c.description.slice(0, 200) + "..." : c.description,
|
|
1688
|
-
tag_name: c.tag_name
|
|
1689
|
-
})),
|
|
1690
|
-
cluster_count: (galaxy.GalaxyCluster || []).length
|
|
1691
|
-
};
|
|
1692
|
-
return {
|
|
1693
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
1694
|
-
};
|
|
1695
|
-
} catch (err) {
|
|
1696
|
-
return {
|
|
1697
|
-
content: [
|
|
1698
|
-
{
|
|
1699
|
-
type: "text",
|
|
1700
|
-
text: `Error getting galaxy: ${err instanceof Error ? err.message : String(err)}`
|
|
1701
|
-
}
|
|
1702
|
-
],
|
|
1703
|
-
isError: true
|
|
1704
|
-
};
|
|
1705
|
-
}
|
|
1706
|
-
}
|
|
1707
|
-
);
|
|
1708
|
-
server2.tool(
|
|
1709
|
-
"misp_search_galaxy_clusters",
|
|
1710
|
-
"Search galaxy clusters by keyword (find specific MITRE ATT&CK techniques, threat actors, malware, etc.)",
|
|
1711
|
-
{
|
|
1712
|
-
search: z9.string().describe(
|
|
1713
|
-
"Search term (e.g., 'phishing', 'APT28', 'ransomware', 'T1566')"
|
|
1714
|
-
),
|
|
1715
|
-
galaxyType: z9.string().optional().describe(
|
|
1716
|
-
"Limit to a specific galaxy type (e.g., mitre-attack-pattern, mitre-intrusion-set)"
|
|
1717
|
-
)
|
|
1718
|
-
},
|
|
1719
|
-
async ({ search, galaxyType }) => {
|
|
1720
|
-
try {
|
|
1721
|
-
const results = await client2.searchGalaxyClusters(search, galaxyType);
|
|
1722
|
-
if (results.length === 0) {
|
|
1723
|
-
return {
|
|
1724
|
-
content: [
|
|
1725
|
-
{
|
|
1726
|
-
type: "text",
|
|
1727
|
-
text: `No galaxy clusters found matching "${search}".`
|
|
1728
|
-
}
|
|
1729
|
-
]
|
|
1730
|
-
};
|
|
1731
|
-
}
|
|
1732
|
-
const summary = results.map((c) => ({
|
|
1733
|
-
id: c.id,
|
|
1734
|
-
galaxy_id: c.galaxy_id,
|
|
1735
|
-
value: c.value,
|
|
1736
|
-
description: c.description && c.description.length > 200 ? c.description.slice(0, 200) + "..." : c.description,
|
|
1737
|
-
tag_name: c.tag_name,
|
|
1738
|
-
type: c.type
|
|
1739
|
-
}));
|
|
1740
|
-
return {
|
|
1741
|
-
content: [{ type: "text", text: JSON.stringify(summary, null, 2) }]
|
|
1742
|
-
};
|
|
1743
|
-
} catch (err) {
|
|
1744
|
-
return {
|
|
1745
|
-
content: [
|
|
1746
|
-
{
|
|
1747
|
-
type: "text",
|
|
1748
|
-
text: `Error searching galaxy clusters: ${err instanceof Error ? err.message : String(err)}`
|
|
1749
|
-
}
|
|
1750
|
-
],
|
|
1751
|
-
isError: true
|
|
1752
|
-
};
|
|
1753
|
-
}
|
|
1754
|
-
}
|
|
1755
|
-
);
|
|
1756
|
-
server2.tool(
|
|
1757
|
-
"misp_attach_galaxy_cluster",
|
|
1758
|
-
"Attach a galaxy cluster (MITRE ATT&CK technique, threat actor, etc.) to an event or attribute",
|
|
1759
|
-
{
|
|
1760
|
-
targetType: z9.enum(["event", "attribute"]).describe("Attach to an event or attribute"),
|
|
1761
|
-
targetId: z9.string().describe("Event ID or attribute ID"),
|
|
1762
|
-
galaxyClusterId: z9.string().describe("Galaxy cluster ID to attach")
|
|
1763
|
-
},
|
|
1764
|
-
async ({ targetType, targetId, galaxyClusterId }) => {
|
|
1765
|
-
try {
|
|
1766
|
-
await client2.attachGalaxyCluster(targetType, targetId, galaxyClusterId);
|
|
1767
|
-
return {
|
|
1768
|
-
content: [
|
|
1769
|
-
{
|
|
1770
|
-
type: "text",
|
|
1771
|
-
text: `Galaxy cluster ${galaxyClusterId} attached to ${targetType} ${targetId}.`
|
|
1772
|
-
}
|
|
1773
|
-
]
|
|
1774
|
-
};
|
|
1775
|
-
} catch (err) {
|
|
1776
|
-
return {
|
|
1777
|
-
content: [
|
|
1778
|
-
{
|
|
1779
|
-
type: "text",
|
|
1780
|
-
text: `Error attaching galaxy cluster: ${err instanceof Error ? err.message : String(err)}`
|
|
1781
|
-
}
|
|
1782
|
-
],
|
|
1783
|
-
isError: true
|
|
1784
|
-
};
|
|
1785
|
-
}
|
|
1786
|
-
}
|
|
1787
|
-
);
|
|
1788
|
-
}
|
|
1789
|
-
|
|
1790
|
-
// src/tools/feeds.ts
|
|
1791
|
-
import { z as z10 } from "zod";
|
|
1792
|
-
function registerFeedTools(server2, client2) {
|
|
1793
|
-
server2.tool(
|
|
1794
|
-
"misp_list_feeds",
|
|
1795
|
-
"List configured MISP feeds (threat intel sources, IOC feeds, etc.)",
|
|
1796
|
-
{
|
|
1797
|
-
enabled: z10.boolean().optional().describe("Filter by enabled/disabled status")
|
|
1798
|
-
},
|
|
1799
|
-
async ({ enabled }) => {
|
|
1800
|
-
try {
|
|
1801
|
-
let feeds = await client2.listFeeds();
|
|
1802
|
-
if (enabled !== void 0) {
|
|
1803
|
-
feeds = feeds.filter((f) => f.enabled === enabled);
|
|
1804
|
-
}
|
|
1805
|
-
if (feeds.length === 0) {
|
|
1806
|
-
return {
|
|
1807
|
-
content: [{ type: "text", text: "No feeds found." }]
|
|
1808
|
-
};
|
|
1809
|
-
}
|
|
1810
|
-
const summary = feeds.map((f) => ({
|
|
1811
|
-
id: f.id,
|
|
1812
|
-
name: f.name,
|
|
1813
|
-
provider: f.provider,
|
|
1814
|
-
url: f.url,
|
|
1815
|
-
enabled: f.enabled,
|
|
1816
|
-
source_format: f.source_format,
|
|
1817
|
-
distribution: f.distribution,
|
|
1818
|
-
event_id: f.event_id,
|
|
1819
|
-
caching_enabled: f.caching_enabled
|
|
1820
|
-
}));
|
|
1821
|
-
return {
|
|
1822
|
-
content: [{ type: "text", text: JSON.stringify(summary, null, 2) }]
|
|
1823
|
-
};
|
|
1824
|
-
} catch (err) {
|
|
1825
|
-
return {
|
|
1826
|
-
content: [
|
|
1827
|
-
{
|
|
1828
|
-
type: "text",
|
|
1829
|
-
text: `Error listing feeds: ${err instanceof Error ? err.message : String(err)}`
|
|
1830
|
-
}
|
|
1831
|
-
],
|
|
1832
|
-
isError: true
|
|
1833
|
-
};
|
|
1834
|
-
}
|
|
1835
|
-
}
|
|
1836
|
-
);
|
|
1837
|
-
server2.tool(
|
|
1838
|
-
"misp_toggle_feed",
|
|
1839
|
-
"Enable or disable a MISP feed",
|
|
1840
|
-
{
|
|
1841
|
-
feedId: z10.string().describe("Feed ID"),
|
|
1842
|
-
enable: z10.boolean().describe("true to enable, false to disable")
|
|
1843
|
-
},
|
|
1844
|
-
async ({ feedId, enable }) => {
|
|
1845
|
-
try {
|
|
1846
|
-
await client2.toggleFeed(feedId, enable);
|
|
1847
|
-
return {
|
|
1848
|
-
content: [
|
|
1849
|
-
{
|
|
1850
|
-
type: "text",
|
|
1851
|
-
text: `Feed ${feedId} ${enable ? "enabled" : "disabled"} successfully.`
|
|
1852
|
-
}
|
|
1853
|
-
]
|
|
1854
|
-
};
|
|
1855
|
-
} catch (err) {
|
|
1856
|
-
return {
|
|
1857
|
-
content: [
|
|
1858
|
-
{
|
|
1859
|
-
type: "text",
|
|
1860
|
-
text: `Error toggling feed: ${err instanceof Error ? err.message : String(err)}`
|
|
1861
|
-
}
|
|
1862
|
-
],
|
|
1863
|
-
isError: true
|
|
1864
|
-
};
|
|
1865
|
-
}
|
|
1866
|
-
}
|
|
1867
|
-
);
|
|
1868
|
-
server2.tool(
|
|
1869
|
-
"misp_fetch_feed",
|
|
1870
|
-
"Trigger a fetch/pull of data from a specific MISP feed",
|
|
1871
|
-
{
|
|
1872
|
-
feedId: z10.string().describe("Feed ID to fetch")
|
|
1873
|
-
},
|
|
1874
|
-
async ({ feedId }) => {
|
|
1875
|
-
try {
|
|
1876
|
-
const result = await client2.fetchFeed(feedId);
|
|
1877
|
-
return {
|
|
1878
|
-
content: [
|
|
1879
|
-
{
|
|
1880
|
-
type: "text",
|
|
1881
|
-
text: result.message || `Feed ${feedId} fetch initiated.`
|
|
1882
|
-
}
|
|
1883
|
-
]
|
|
1884
|
-
};
|
|
1885
|
-
} catch (err) {
|
|
1886
|
-
return {
|
|
1887
|
-
content: [
|
|
1888
|
-
{
|
|
1889
|
-
type: "text",
|
|
1890
|
-
text: `Error fetching feed: ${err instanceof Error ? err.message : String(err)}`
|
|
1891
|
-
}
|
|
1892
|
-
],
|
|
1893
|
-
isError: true
|
|
1894
|
-
};
|
|
1895
|
-
}
|
|
1896
|
-
}
|
|
1897
|
-
);
|
|
1898
|
-
server2.tool(
|
|
1899
|
-
"misp_cache_feed",
|
|
1900
|
-
"Cache feed data locally for correlation without creating events",
|
|
1901
|
-
{
|
|
1902
|
-
feedId: z10.string().describe("Feed ID to cache")
|
|
1903
|
-
},
|
|
1904
|
-
async ({ feedId }) => {
|
|
1905
|
-
try {
|
|
1906
|
-
const result = await client2.cacheFeed(feedId);
|
|
1907
|
-
return {
|
|
1908
|
-
content: [
|
|
1909
|
-
{
|
|
1910
|
-
type: "text",
|
|
1911
|
-
text: result.message || `Feed ${feedId} cache initiated.`
|
|
1912
|
-
}
|
|
1913
|
-
]
|
|
1914
|
-
};
|
|
1915
|
-
} catch (err) {
|
|
1916
|
-
return {
|
|
1917
|
-
content: [
|
|
1918
|
-
{
|
|
1919
|
-
type: "text",
|
|
1920
|
-
text: `Error caching feed: ${err instanceof Error ? err.message : String(err)}`
|
|
1921
|
-
}
|
|
1922
|
-
],
|
|
1923
|
-
isError: true
|
|
1924
|
-
};
|
|
1925
|
-
}
|
|
1926
|
-
}
|
|
1927
|
-
);
|
|
1928
|
-
}
|
|
1929
|
-
|
|
1930
|
-
// src/tools/organisations.ts
|
|
1931
|
-
import { z as z11 } from "zod";
|
|
1932
|
-
function registerOrganisationTools(server2, client2) {
|
|
1933
|
-
server2.tool(
|
|
1934
|
-
"misp_list_organisations",
|
|
1935
|
-
"List MISP organisations (local and remote sharing partners)",
|
|
1936
|
-
{
|
|
1937
|
-
scope: z11.enum(["local", "external", "all"]).optional().describe("Filter by local, external, or all organisations")
|
|
1938
|
-
},
|
|
1939
|
-
async ({ scope }) => {
|
|
1940
|
-
try {
|
|
1941
|
-
const orgs = await client2.listOrganisations(scope || "all");
|
|
1942
|
-
if (orgs.length === 0) {
|
|
1943
|
-
return {
|
|
1944
|
-
content: [{ type: "text", text: "No organisations found." }]
|
|
1945
|
-
};
|
|
1946
|
-
}
|
|
1947
|
-
const summary = orgs.map((o) => ({
|
|
1948
|
-
id: o.id,
|
|
1949
|
-
name: o.name,
|
|
1950
|
-
uuid: o.uuid,
|
|
1951
|
-
description: o.description,
|
|
1952
|
-
nationality: o.nationality,
|
|
1953
|
-
sector: o.sector,
|
|
1954
|
-
type: o.type,
|
|
1955
|
-
local: o.local
|
|
1956
|
-
}));
|
|
1957
|
-
return {
|
|
1958
|
-
content: [{ type: "text", text: JSON.stringify(summary, null, 2) }]
|
|
1959
|
-
};
|
|
1960
|
-
} catch (err) {
|
|
1961
|
-
return {
|
|
1962
|
-
content: [
|
|
1963
|
-
{
|
|
1964
|
-
type: "text",
|
|
1965
|
-
text: `Error listing organisations: ${err instanceof Error ? err.message : String(err)}`
|
|
1966
|
-
}
|
|
1967
|
-
],
|
|
1968
|
-
isError: true
|
|
1969
|
-
};
|
|
1970
|
-
}
|
|
1971
|
-
}
|
|
1972
|
-
);
|
|
1973
|
-
server2.tool(
|
|
1974
|
-
"misp_get_organisation",
|
|
1975
|
-
"Get details of a specific MISP organisation",
|
|
1976
|
-
{
|
|
1977
|
-
orgId: z11.string().describe("Organisation ID")
|
|
1978
|
-
},
|
|
1979
|
-
async ({ orgId }) => {
|
|
1980
|
-
try {
|
|
1981
|
-
const org = await client2.getOrganisation(orgId);
|
|
1982
|
-
return {
|
|
1983
|
-
content: [{ type: "text", text: JSON.stringify(org, null, 2) }]
|
|
1984
|
-
};
|
|
1985
|
-
} catch (err) {
|
|
1986
|
-
return {
|
|
1987
|
-
content: [
|
|
1988
|
-
{
|
|
1989
|
-
type: "text",
|
|
1990
|
-
text: `Error getting organisation: ${err instanceof Error ? err.message : String(err)}`
|
|
1991
|
-
}
|
|
1992
|
-
],
|
|
1993
|
-
isError: true
|
|
1994
|
-
};
|
|
1995
|
-
}
|
|
1996
|
-
}
|
|
1997
|
-
);
|
|
1998
|
-
}
|
|
1999
|
-
|
|
2000
|
-
// src/tools/servers.ts
|
|
2001
|
-
import { z as z12 } from "zod";
|
|
2002
|
-
function registerServerTools(server2, client2) {
|
|
2003
|
-
server2.tool(
|
|
2004
|
-
"misp_server_status",
|
|
2005
|
-
"Get MISP server version, status, and diagnostic information",
|
|
2006
|
-
{},
|
|
2007
|
-
async () => {
|
|
2008
|
-
try {
|
|
2009
|
-
const version = await client2.getVersion();
|
|
2010
|
-
const settings = await client2.getServerSettings();
|
|
2011
|
-
return {
|
|
2012
|
-
content: [
|
|
2013
|
-
{
|
|
2014
|
-
type: "text",
|
|
2015
|
-
text: JSON.stringify(
|
|
2016
|
-
{
|
|
2017
|
-
version: version.version,
|
|
2018
|
-
pymisp_recommended: version.pymisp_recommended_version,
|
|
2019
|
-
permissions: {
|
|
2020
|
-
sync: version.perm_sync,
|
|
2021
|
-
sighting: version.perm_sighting,
|
|
2022
|
-
galaxy_editor: version.perm_galaxy_editor,
|
|
2023
|
-
analyst_data: version.perm_analyst_data
|
|
2024
|
-
},
|
|
2025
|
-
diagnostics: settings.diagnostics
|
|
2026
|
-
},
|
|
2027
|
-
null,
|
|
2028
|
-
2
|
|
2029
|
-
)
|
|
2030
|
-
}
|
|
2031
|
-
]
|
|
2032
|
-
};
|
|
2033
|
-
} catch (err) {
|
|
2034
|
-
return {
|
|
2035
|
-
content: [
|
|
2036
|
-
{
|
|
2037
|
-
type: "text",
|
|
2038
|
-
text: `Error getting server status: ${err instanceof Error ? err.message : String(err)}`
|
|
2039
|
-
}
|
|
2040
|
-
],
|
|
2041
|
-
isError: true
|
|
2042
|
-
};
|
|
2043
|
-
}
|
|
2044
|
-
}
|
|
2045
|
-
);
|
|
2046
|
-
server2.tool(
|
|
2047
|
-
"misp_list_sharing_groups",
|
|
2048
|
-
"List MISP sharing groups for controlled event distribution",
|
|
2049
|
-
{},
|
|
2050
|
-
async () => {
|
|
2051
|
-
try {
|
|
2052
|
-
const groups = await client2.listSharingGroups();
|
|
2053
|
-
if (groups.length === 0) {
|
|
2054
|
-
return {
|
|
2055
|
-
content: [
|
|
2056
|
-
{
|
|
2057
|
-
type: "text",
|
|
2058
|
-
text: "No sharing groups configured."
|
|
2059
|
-
}
|
|
2060
|
-
]
|
|
2061
|
-
};
|
|
2062
|
-
}
|
|
2063
|
-
const summary = groups.map((g) => ({
|
|
2064
|
-
id: g.id,
|
|
2065
|
-
name: g.name,
|
|
2066
|
-
description: g.description,
|
|
2067
|
-
uuid: g.uuid,
|
|
2068
|
-
releasability: g.releasability,
|
|
2069
|
-
active: g.active,
|
|
2070
|
-
org_count: g.org_count
|
|
2071
|
-
}));
|
|
2072
|
-
return {
|
|
2073
|
-
content: [{ type: "text", text: JSON.stringify(summary, null, 2) }]
|
|
2074
|
-
};
|
|
2075
|
-
} catch (err) {
|
|
2076
|
-
return {
|
|
2077
|
-
content: [
|
|
2078
|
-
{
|
|
2079
|
-
type: "text",
|
|
2080
|
-
text: `Error listing sharing groups: ${err instanceof Error ? err.message : String(err)}`
|
|
2081
|
-
}
|
|
2082
|
-
],
|
|
2083
|
-
isError: true
|
|
2084
|
-
};
|
|
2085
|
-
}
|
|
2086
|
-
}
|
|
2087
|
-
);
|
|
2088
|
-
server2.tool(
|
|
2089
|
-
"misp_delete_event",
|
|
2090
|
-
"Delete a MISP event (requires appropriate permissions)",
|
|
2091
|
-
{
|
|
2092
|
-
eventId: z12.string().describe("Event ID to delete")
|
|
2093
|
-
},
|
|
2094
|
-
async ({ eventId }) => {
|
|
2095
|
-
try {
|
|
2096
|
-
const result = await client2.deleteEvent(eventId);
|
|
2097
|
-
return {
|
|
2098
|
-
content: [
|
|
2099
|
-
{
|
|
2100
|
-
type: "text",
|
|
2101
|
-
text: result.message || `Event ${eventId} deleted.`
|
|
2102
|
-
}
|
|
2103
|
-
]
|
|
2104
|
-
};
|
|
2105
|
-
} catch (err) {
|
|
2106
|
-
return {
|
|
2107
|
-
content: [
|
|
2108
|
-
{
|
|
2109
|
-
type: "text",
|
|
2110
|
-
text: `Error deleting event: ${err instanceof Error ? err.message : String(err)}`
|
|
2111
|
-
}
|
|
2112
|
-
],
|
|
2113
|
-
isError: true
|
|
2114
|
-
};
|
|
2115
|
-
}
|
|
2116
|
-
}
|
|
2117
|
-
);
|
|
2118
|
-
}
|
|
2119
|
-
|
|
2120
|
-
// src/resources.ts
|
|
2121
|
-
function registerResources(server2, client2) {
|
|
2122
|
-
server2.resource(
|
|
2123
|
-
"types",
|
|
2124
|
-
"misp://types",
|
|
2125
|
-
{
|
|
2126
|
-
description: "All supported MISP attribute types and categories with their mappings",
|
|
2127
|
-
mimeType: "application/json"
|
|
2128
|
-
},
|
|
2129
|
-
async () => {
|
|
2130
|
-
const types = await client2.describeTypes();
|
|
2131
|
-
const summary = {
|
|
2132
|
-
types: types.types,
|
|
2133
|
-
categories: types.categories,
|
|
2134
|
-
category_type_mappings: types.category_type_mappings,
|
|
2135
|
-
type_defaults: Object.entries(types.sane_defaults).map(([type, info]) => ({
|
|
2136
|
-
type,
|
|
2137
|
-
default_category: info.default_category,
|
|
2138
|
-
to_ids: info.to_ids === 1
|
|
2139
|
-
}))
|
|
2140
|
-
};
|
|
2141
|
-
return {
|
|
2142
|
-
contents: [
|
|
2143
|
-
{
|
|
2144
|
-
uri: "misp://types",
|
|
2145
|
-
mimeType: "application/json",
|
|
2146
|
-
text: JSON.stringify(summary, null, 2)
|
|
2147
|
-
}
|
|
2148
|
-
]
|
|
2149
|
-
};
|
|
2150
|
-
}
|
|
2151
|
-
);
|
|
2152
|
-
server2.resource(
|
|
2153
|
-
"statistics",
|
|
2154
|
-
"misp://statistics",
|
|
2155
|
-
{
|
|
2156
|
-
description: "MISP instance capability summary (supported attribute types and categories). Use misp_search_events for actual counts.",
|
|
2157
|
-
mimeType: "application/json"
|
|
2158
|
-
},
|
|
2159
|
-
async () => {
|
|
2160
|
-
const types = await client2.describeTypes();
|
|
2161
|
-
const stats = {
|
|
2162
|
-
available_types: types.types.length,
|
|
2163
|
-
available_categories: types.categories.length,
|
|
2164
|
-
note: "This resource reports capability metadata, not event totals. Use misp_search_events with date/tag filters to count events."
|
|
2165
|
-
};
|
|
2166
|
-
return {
|
|
2167
|
-
contents: [
|
|
2168
|
-
{
|
|
2169
|
-
uri: "misp://statistics",
|
|
2170
|
-
mimeType: "application/json",
|
|
2171
|
-
text: JSON.stringify(stats, null, 2)
|
|
2172
|
-
}
|
|
2173
|
-
]
|
|
2174
|
-
};
|
|
2175
|
-
}
|
|
2176
|
-
);
|
|
2177
|
-
server2.resource(
|
|
2178
|
-
"taxonomies",
|
|
2179
|
-
"misp://taxonomies",
|
|
2180
|
-
{
|
|
2181
|
-
description: "Available MISP taxonomies (TLP, MITRE ATT&CK, etc.)",
|
|
2182
|
-
mimeType: "application/json"
|
|
2183
|
-
},
|
|
2184
|
-
async () => {
|
|
2185
|
-
const taxonomies = await client2.listTaxonomies();
|
|
2186
|
-
const summary = taxonomies.map((t) => ({
|
|
2187
|
-
namespace: t.namespace,
|
|
2188
|
-
description: t.description,
|
|
2189
|
-
version: t.version,
|
|
2190
|
-
enabled: t.enabled
|
|
2191
|
-
}));
|
|
2192
|
-
return {
|
|
2193
|
-
contents: [
|
|
2194
|
-
{
|
|
2195
|
-
uri: "misp://taxonomies",
|
|
2196
|
-
mimeType: "application/json",
|
|
2197
|
-
text: JSON.stringify(summary, null, 2)
|
|
2198
|
-
}
|
|
2199
|
-
]
|
|
2200
|
-
};
|
|
2201
|
-
}
|
|
2202
|
-
);
|
|
2203
|
-
}
|
|
2204
|
-
|
|
2205
|
-
// src/prompts.ts
|
|
2206
|
-
import { z as z13 } from "zod";
|
|
2207
|
-
function registerPrompts(server2) {
|
|
2208
|
-
server2.prompt(
|
|
2209
|
-
"investigate-ioc",
|
|
2210
|
-
"Deep investigation of an IOC across MISP - searches for the indicator, finds correlations, checks warninglists, and summarizes threat context",
|
|
2211
|
-
{
|
|
2212
|
-
ioc: z13.string().describe("The IOC value to investigate (IP, domain, hash, URL, email, etc.)"),
|
|
2213
|
-
iocType: z13.string().optional().describe("IOC type hint (ip-src, domain, md5, sha256, url, etc.)")
|
|
2214
|
-
},
|
|
2215
|
-
({ ioc, iocType }) => {
|
|
2216
|
-
const typeHint = iocType ? `The IOC type is "${iocType}".` : "Determine the IOC type from the value format.";
|
|
2217
|
-
return {
|
|
2218
|
-
messages: [
|
|
2219
|
-
{
|
|
2220
|
-
role: "user",
|
|
2221
|
-
content: {
|
|
2222
|
-
type: "text",
|
|
2223
|
-
text: `Investigate the following IOC in MISP: "${ioc}"
|
|
2224
|
-
|
|
2225
|
-
${typeHint}
|
|
2226
|
-
|
|
2227
|
-
Follow these steps:
|
|
2228
|
-
1. Use misp_search_attributes to search for this IOC value across all events. If you know the type, filter by it.
|
|
2229
|
-
2. Use misp_correlate to find all correlations for this value across events.
|
|
2230
|
-
3. Use misp_check_warninglists to check if this value appears on any known benign/false positive lists.
|
|
2231
|
-
4. For each event found, note the threat level, tags (especially TLP and MITRE ATT&CK), and related IOCs.
|
|
2232
|
-
5. If the IOC appears in multiple events, use misp_get_related_events on the most relevant event to discover additional related intelligence.
|
|
2233
|
-
|
|
2234
|
-
Provide a structured summary including:
|
|
2235
|
-
- Whether the IOC was found in MISP and in how many events
|
|
2236
|
-
- Threat level assessment based on event metadata
|
|
2237
|
-
- Related IOCs and correlations discovered
|
|
2238
|
-
- Whether it appears on any warninglists (potential false positive)
|
|
2239
|
-
- MITRE ATT&CK techniques associated with this IOC
|
|
2240
|
-
- Recommended next steps for the analyst`
|
|
2241
|
-
}
|
|
2242
|
-
}
|
|
2243
|
-
]
|
|
2244
|
-
};
|
|
2245
|
-
}
|
|
2246
|
-
);
|
|
2247
|
-
server2.prompt(
|
|
2248
|
-
"create-incident-event",
|
|
2249
|
-
"Guided workflow for creating a MISP event from an incident, including adding attributes, tagging, and publishing",
|
|
2250
|
-
{
|
|
2251
|
-
description: z13.string().describe("Description of the incident"),
|
|
2252
|
-
iocs: z13.string().optional().describe("Comma-separated list of IOCs to add (e.g., '192.168.1.1,evil.com,abc123hash')")
|
|
2253
|
-
},
|
|
2254
|
-
({ description, iocs }) => {
|
|
2255
|
-
const iocList = iocs ? `
|
|
2256
|
-
The following IOCs should be added: ${iocs}` : "\nAsk the analyst for any IOCs (IP addresses, domains, file hashes, URLs) associated with this incident.";
|
|
2257
|
-
return {
|
|
2258
|
-
messages: [
|
|
2259
|
-
{
|
|
2260
|
-
role: "user",
|
|
2261
|
-
content: {
|
|
2262
|
-
type: "text",
|
|
2263
|
-
text: `Create a MISP event for the following incident:
|
|
2264
|
-
|
|
2265
|
-
"${description}"
|
|
2266
|
-
${iocList}
|
|
2267
|
-
|
|
2268
|
-
Follow these steps:
|
|
2269
|
-
1. Use misp_create_event with:
|
|
2270
|
-
- An informative title based on the incident description
|
|
2271
|
-
- Appropriate threat level (1=High for active compromise, 2=Medium for suspicious activity, 3=Low for informational)
|
|
2272
|
-
- Analysis status: 0 (Initial)
|
|
2273
|
-
- Distribution: 0 (Organization only) to start - can be broadened later
|
|
2274
|
-
|
|
2275
|
-
2. For each IOC:
|
|
2276
|
-
- Determine the correct attribute type (ip-src, ip-dst, domain, md5, sha256, url, etc.)
|
|
2277
|
-
- Use misp_add_attribute (or misp_add_attributes_bulk for multiple) to add them
|
|
2278
|
-
- Use misp_check_warninglists to verify none are known false positives
|
|
2279
|
-
|
|
2280
|
-
3. Add appropriate tags using misp_tag_event:
|
|
2281
|
-
- TLP tag (tlp:white, tlp:green, tlp:amber, tlp:red)
|
|
2282
|
-
- Relevant MITRE ATT&CK technique tags if applicable
|
|
2283
|
-
- Any organization-specific tags
|
|
2284
|
-
|
|
2285
|
-
4. Summarize what was created:
|
|
2286
|
-
- Event ID and title
|
|
2287
|
-
- Number of attributes added
|
|
2288
|
-
- Tags applied
|
|
2289
|
-
- Ask if the analyst wants to publish (misp_publish_event) or keep as draft`
|
|
2290
|
-
}
|
|
2291
|
-
}
|
|
2292
|
-
]
|
|
2293
|
-
};
|
|
2294
|
-
}
|
|
2295
|
-
);
|
|
2296
|
-
server2.prompt(
|
|
2297
|
-
"threat-report",
|
|
2298
|
-
"Generate a threat intelligence report from MISP data by aggregating events, extracting IOC patterns, and summarizing the threat landscape",
|
|
2299
|
-
{
|
|
2300
|
-
eventId: z13.string().optional().describe("Specific event ID to report on"),
|
|
2301
|
-
tag: z13.string().optional().describe("Filter by tag (e.g., mitre-attack:T1059, tlp:amber)"),
|
|
2302
|
-
dateRange: z13.string().optional().describe("Date range or relative time (e.g., '7d', '30d', '2024-01-01 to 2024-01-31')")
|
|
2303
|
-
},
|
|
2304
|
-
({ eventId, tag, dateRange }) => {
|
|
2305
|
-
let scopeInstructions;
|
|
2306
|
-
if (eventId) {
|
|
2307
|
-
scopeInstructions = `Focus on event ID ${eventId}. Use misp_get_event to get full details, then misp_get_related_events for context.`;
|
|
2308
|
-
} else if (tag) {
|
|
2309
|
-
scopeInstructions = `Focus on events tagged with "${tag}". Use misp_search_by_tag to find matching events.`;
|
|
2310
|
-
} else if (dateRange) {
|
|
2311
|
-
const isRelative = /^\d+[dmhwy]$/.test(dateRange);
|
|
2312
|
-
if (isRelative) {
|
|
2313
|
-
scopeInstructions = `Focus on events from the last ${dateRange}. Use misp_search_events with last="${dateRange}".`;
|
|
2314
|
-
} else {
|
|
2315
|
-
scopeInstructions = `Focus on events in the date range: ${dateRange}. Use misp_search_events with appropriate dateFrom/dateTo.`;
|
|
2316
|
-
}
|
|
2317
|
-
} else {
|
|
2318
|
-
scopeInstructions = `Generate a report on recent threat activity. Use misp_search_events with last="7d" to get the latest events.`;
|
|
2319
|
-
}
|
|
2320
|
-
return {
|
|
2321
|
-
messages: [
|
|
2322
|
-
{
|
|
2323
|
-
role: "user",
|
|
2324
|
-
content: {
|
|
2325
|
-
type: "text",
|
|
2326
|
-
text: `Generate a threat intelligence report from MISP data.
|
|
2327
|
-
|
|
2328
|
-
${scopeInstructions}
|
|
2329
|
-
|
|
2330
|
-
Report structure:
|
|
2331
|
-
1. **Executive Summary**: Brief overview of the threat landscape for the specified scope
|
|
2332
|
-
2. **Key Events**: List the most significant events with threat levels and descriptions
|
|
2333
|
-
3. **IOC Summary**:
|
|
2334
|
-
- Use misp_search_attributes to aggregate IOC types and counts
|
|
2335
|
-
- List the most significant indicators by type (IPs, domains, hashes, URLs)
|
|
2336
|
-
4. **MITRE ATT&CK Coverage**: List any ATT&CK techniques observed across the events
|
|
2337
|
-
5. **Correlations**: Use misp_correlate on high-value IOCs to discover cross-event links
|
|
2338
|
-
6. **Recommendations**:
|
|
2339
|
-
- Immediate blocking actions (IPs, domains to block)
|
|
2340
|
-
- Detection rules needed
|
|
2341
|
-
- Areas requiring further investigation
|
|
2342
|
-
|
|
2343
|
-
Format the report in clear markdown with headers and tables where appropriate.`
|
|
2344
|
-
}
|
|
2345
|
-
}
|
|
2346
|
-
]
|
|
2347
|
-
};
|
|
2348
|
-
}
|
|
2349
|
-
);
|
|
2350
|
-
}
|
|
2351
|
-
|
|
2352
|
-
// src/index.ts
|
|
2353
|
-
var config = getConfig();
|
|
2354
|
-
var client = new MispClient(config);
|
|
2355
|
-
var server = new McpServer({
|
|
2356
|
-
name: "misp-mcp",
|
|
2357
|
-
version: "1.2.0",
|
|
2358
|
-
description: "MCP server for MISP threat intelligence platform - IOC lookups, event management, correlation discovery, and intelligence enrichment"
|
|
2359
|
-
});
|
|
2360
|
-
registerEventTools(server, client);
|
|
2361
|
-
registerAttributeTools(server, client);
|
|
2362
|
-
registerCorrelationTools(server, client);
|
|
2363
|
-
registerTagTools(server, client);
|
|
2364
|
-
registerExportTools(server, client);
|
|
2365
|
-
registerSightingTools(server, client);
|
|
2366
|
-
registerWarninglistTools(server, client);
|
|
2367
|
-
registerObjectTools(server, client);
|
|
2368
|
-
registerGalaxyTools(server, client);
|
|
2369
|
-
registerFeedTools(server, client);
|
|
2370
|
-
registerOrganisationTools(server, client);
|
|
2371
|
-
registerServerTools(server, client);
|
|
2372
|
-
registerResources(server, client);
|
|
2373
|
-
registerPrompts(server);
|
|
2374
|
-
var transport = new StdioServerTransport();
|
|
2375
|
-
server.connect(transport).catch((err) => {
|
|
2376
|
-
console.error("Failed to start MISP MCP server:", err);
|
|
2377
|
-
process.exit(1);
|
|
2378
|
-
});
|
|
41
|
+
export {
|
|
42
|
+
CliGateError,
|
|
43
|
+
MispClient,
|
|
44
|
+
createMispMcpServer,
|
|
45
|
+
getConfig,
|
|
46
|
+
requireDestructiveCliGate,
|
|
47
|
+
requireHardDeleteCliGate,
|
|
48
|
+
serveMcp
|
|
49
|
+
};
|
|
2379
50
|
//# sourceMappingURL=index.js.map
|