misp-mcp 2.0.0 → 2.0.1

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.
Files changed (2) hide show
  1. package/README.md +79 -497
  2. package/package.json +13 -3
package/README.md CHANGED
@@ -1,545 +1,127 @@
1
- <p align="center">
2
- <img src="docs/assets/misp-mcp-social-preview.jpg" alt="misp-mcp banner" width="900">
3
- </p>
4
-
5
- <p align="center">
6
- <a href="https://lidless.dev"><img src="docs/assets/marks/misp-mcp-circle.png" width="48" alt="Lidless Labs"></a>
7
- </p>
8
- <h1 align="center">misp-mcp</h1>
9
-
10
- <p align="center"><strong>Query and manage your MISP threat-intelligence platform from any MCP client.</strong></p>
11
-
12
- <p align="center">
13
- <a href="https://lidless.dev/misp-mcp"><strong>Website &amp; docs &rarr; lidless.dev/misp-mcp</strong></a>
14
- </p>
15
-
16
- <p align="center">
17
- <img src="https://shieldcn.dev/github/ci/lidless-labs/misp-mcp.svg?branch=main&workflow=ci.yml" alt="CI">
18
- <img src="https://shieldcn.dev/npm/misp-mcp.svg" alt="npm version">
19
- <img src="https://shieldcn.dev/badge/MCP-server-8A2BE2.svg" alt="MCP server">
20
- <img src="https://shieldcn.dev/badge/license-MIT-green.svg" alt="MIT license">
21
- </p>
22
-
23
- misp-mcp is a [Model Context Protocol](https://modelcontextprotocol.io/) server for [MISP](https://www.misp-project.org/), the open-source threat-intelligence sharing platform. It lets an LLM client such as Claude run IOC lookups, manage events, discover cross-event correlations, and export indicators directly against your own MISP instance. Unlike a generic HTTP wrapper, it ships 42 purpose-built tools, MISP-aware resources and prompts, and a confirmation gate that refuses destructive writes (delete, publish, untag) unless you explicitly approve them.
1
+ # misp-mcp
24
2
 
25
3
  ## What it does
26
4
 
27
- misp-mcp connects an AI agent to a MISP (Malware Information Sharing Platform & Threat Intelligence Sharing) instance over MISP's REST API and exposes it as Model Context Protocol tools, resources, and prompts. Point it at your MISP server with an API key and an LLM can search threat-intelligence events, look up and add indicators of compromise (IOCs), correlate indicators across events, attach MITRE ATT&CK galaxy clusters, check warninglists for false positives, and export IOCs as Suricata, Snort, STIX, CSV, RPZ, or hash lists. The server is read-only by default: every tool that changes MISP state refuses to run until the operator names it in `MISP_ALLOWED_MUTATIONS`. Destructive and publishing operations (delete, publish, untag, disabling a feed, false-positive and expiration sightings) additionally need a per-call confirmation flag, and bulk writes need confirmation above a small size.
28
-
29
- - **42 MCP tools** covering events, attributes, correlations, tags, exports, sightings, warninglists, objects, galaxies, feeds, organisations, and server administration.
30
- - **3 MCP resources** for browsing attribute types, instance statistics, and available taxonomies.
31
- - **3 MCP prompts** for guided IOC investigation, incident event creation, and threat reporting.
32
- - **Read-only by default:** state-changing tools run only when listed in `MISP_ALLOWED_MUTATIONS`; each also accepts `dryRun: true` to preview a call without sending it.
33
- - **Confirmation-gated destructive actions:** delete, publish, untag, feed disable, and false-positive/expiration sightings refuse to run without `confirm: true` (and `confirmHard: true` for permanent deletes).
34
- - **Untrusted-data fencing:** MISP content returned to the model is wrapped in `<untrusted_misp_data>` markers, and every tool declares MCP annotations (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`).
35
- - **MITRE ATT&CK integration** via galaxy cluster search and attachment.
36
- - **Export formats** including CSV, STIX, Suricata, Snort, text, RPZ, and hash lists.
37
- - **SSL flexibility** for the self-signed certificates common in on-prem MISP deployments.
5
+ misp-mcp connects an MCP client to the MISP REST API. It can search events and indicators of compromise (IOCs), look up correlations, check warninglists, and export indicators. The MCP server starts in read-only mode. Operators can enable specific tools that change MISP data.
38
6
 
39
- ## Quickstart
7
+ ## Install
40
8
 
41
- No checkout required. With Node.js 20+ installed, register the published package with any MCP client. For [Claude Code](https://docs.anthropic.com/en/docs/claude-code):
9
+ The published package is `misp-mcp@2.0.0`. It requires Node.js 20.18.1 or later. The repository tests Node.js 20 and 22 in CI. The install and configuration below describe the npm release. The development commands run from a source checkout. [Package manifest](package.json) · [CI workflow](.github/workflows/ci.yml)
42
10
 
43
- ```bash
44
- claude mcp add misp \
45
- --env MISP_URL=https://misp.example.com \
46
- --env MISP_API_KEY=your-api-key-here \
47
- --env MISP_VERIFY_SSL=false \
48
- -- npx -y misp-mcp
11
+ ```sh
12
+ npm install --global misp-mcp@2.0.0
49
13
  ```
50
14
 
51
- Add `--scope user` to make it available from any directory instead of only the current project.
15
+ The package installs the `misp-mcp` server and two names for the same CLI, `mispctrl` and `mispctl`. The CLI can check the MISP connection and list or fetch events. Either alias starts the stdio server with the `mcp` subcommand. Run `mispctrl --help` for the command list. [CLI source](src/cli.ts)
52
16
 
53
- The server starts read-only. To let the agent write, add `--env MISP_ALLOWED_MUTATIONS=misp_create_event,misp_add_attribute` (the tools you want enabled) or `--env MISP_ALLOWED_MUTATIONS='*'`; see [Mutation gate and destructive action safety](#mutation-gate-and-destructive-action-safety).
17
+ ## Configure
54
18
 
55
- Before wiring a client, verify that the package can reach MISP with the same environment:
56
-
57
- ```bash
58
- MISP_URL=https://misp.example.com \
59
- MISP_API_KEY=your-api-key-here \
60
- MISP_VERIFY_SSL=false \
61
- npx -p misp-mcp mispctrl status
62
- ```
19
+ Set these variables in the server process environment.
63
20
 
64
- This calls `/servers/getVersion` and prints the MISP version, recommended PyMISP version, TLS setting, and target URL. If this fails, fix the URL, API key, or TLS setting before debugging the MCP client.
65
-
66
- ### MCP client config (copy-paste)
67
-
68
- For Claude Desktop, Cursor, or any client that reads a JSON `mcpServers` block, add:
69
-
70
- ```json
71
- {
72
- "mcpServers": {
73
- "misp": {
74
- "command": "npx",
75
- "args": ["-y", "misp-mcp"],
76
- "env": {
77
- "MISP_URL": "https://misp.example.com",
78
- "MISP_API_KEY": "your-api-key-here",
79
- "MISP_VERIFY_SSL": "false"
80
- }
81
- }
82
- }
83
- }
21
+ ```sh
22
+ export MISP_URL='https://misp.example'
23
+ export MISP_API_KEY='<misp-api-key>'
84
24
  ```
85
25
 
86
- Claude Desktop reads this from `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows). Restart the client after editing.
26
+ `MISP_URL` must be an absolute HTTPS base URL. Plain HTTP is accepted for loopback MISP instances. Supply credentials through `MISP_API_KEY` and leave credentials, query strings, and fragments out of the URL.
87
27
 
88
- ### Streamable HTTP
28
+ | Variable | Default | Behavior |
29
+ | --- | --- | --- |
30
+ | `MISP_VERIFY_SSL` | `true` | Verify the MISP TLS certificate. |
31
+ | `MISP_TIMEOUT` | `30` | Upstream request timeout in seconds, including the response body. Enter a whole number from 1 to 3600. |
32
+ | `MISP_MAX_RESPONSE_BYTES` | `16777216` | Maximum upstream response body size. Enter a whole number from 1024 to 268435456 bytes. |
33
+ | `MISP_ALLOWED_MUTATIONS` | Empty | Comma-separated MCP tool names. See Safety below. |
34
+ | `MISP_ALLOW_DESTRUCTIVE` | `false` | Pre-authorize the first confirmation for enabled tools that require it. |
89
35
 
90
- For a local HTTP MCP client such as Executor, start `npx -y misp-mcp --http` with the MISP configuration below and a separate `MISP_MCP_HTTP_TOKEN`. Generate a token with `openssl rand -hex 32`. Point the client at `http://127.0.0.1:3000/mcp` and set the `Authorization: Bearer <token>` header. The listener binds only to the IPv4 loopback interface. <!-- content-guard: allow infrastructure/loopback-ipv4 -->
36
+ Boolean environment variables accept `true`, `1`, `false`, or `0`, ignoring case and surrounding whitespace. Unset or blank values use the default. Other values stop startup. [Configuration](src/config.ts) · [Boolean parser](src/env.ts) · [API client](src/client.ts)
91
37
 
92
- Each HTTP POST shares one deadline across request parsing, MISP requests, and reply preparation. The deadline is the lesser of `MISP_TIMEOUT` and 55 seconds. The server checks it before handing the prepared reply to the MCP SDK and aborts upstream I/O on expiry, cancellation, or disconnect. Synchronous work runs until it yields, and socket delivery depends on the SDK and client. Check MISP before retrying a timed-out write because MISP may already have accepted it. HTTP tool results are capped at 90,000 serialized UTF-8 bytes. Oversized results include a fenced preview and truncation metadata, so use narrower filters or smaller pages for the full data.
38
+ ### Transports
93
39
 
94
- Run `npx -y misp-mcp` for stdio. Both transports use the same tool registry, mutation allowlist, and confirmation gates.
40
+ For **stdio**, configure the MCP client to launch `misp-mcp` with the environment above. To run the release without a global install, use this command.
95
41
 
96
- ### Prerequisites
97
-
98
- - Node.js 20 or later.
99
- - A running MISP instance with API access.
100
- - A MISP API key (MISP UI: Administration > List Auth Keys).
101
-
102
- ### Configuration
103
-
104
- | Variable | Required | Default | Description |
105
- |----------|----------|---------|-------------|
106
- | `MISP_URL` | Yes | - | MISP instance base URL. Must be `https://`; plain `http://` is accepted only for `localhost`, `127.0.0.1`, and `[::1]`. Credentials, query strings, and fragments are rejected. | <!-- content-guard: allow infrastructure/localhost-bare --> <!-- content-guard: allow infrastructure/loopback-ipv4 -->
107
- | `MISP_API_KEY` | Yes | - | API authentication key |
108
- | `MISP_VERIFY_SSL` | No | `true` | Set `false` (or `0`) for self-signed certs. Accepts `true`, `1`, `false`, `0`, case-insensitive. |
109
- | `MISP_TIMEOUT` | No | `30` | Request timeout in seconds (positive integer, 1–3600) |
110
- | `MISP_ALLOWED_MUTATIONS` | No | empty (read-only) | Comma-separated list of state-changing tools the server may run (for example `misp_create_event,misp_add_attribute`), or `*` for all of them. Unknown names fail at startup. |
111
- | `MISP_MAX_RESPONSE_BYTES` | No | `16777216` | Strict cap on one MISP response body, in bytes (1024–268435456). Larger responses are aborted. |
112
- | `MISP_ALLOW_DESTRUCTIVE` | No | `false` | Accepts `true`, `1`, `false`, `0`, case-insensitive; any other value stops the server at startup. Set `true` to pre-authorize destructive tools so the per-call `confirm` flag is not required for tools that are already enabled by `MISP_ALLOWED_MUTATIONS`. Permanent (`hard`) deletes still require `confirmHard`. |
113
- | `MISP_MCP_HTTP_TOKEN` | HTTP only | - | Bearer token of at least 32 characters. Use a different value from `MISP_API_KEY`. |
114
- | `MISP_MCP_HTTP_PORT` | No | `3000` | Loopback listener port in `--http` mode. |
115
-
116
- Boolean variables (`MISP_VERIFY_SSL`, `MISP_ALLOW_DESTRUCTIVE`) share one parser: `true`, `1`, `false`, `0`, case-insensitive after trimming; unset or empty means the default. Any other value is rejected at startup with an error that names the variable. The MCP guard and the CLI gate use the same parser, so `MISP_ALLOW_DESTRUCTIVE=1` means the same thing in both.
117
-
118
- ### Mutation gate and destructive action safety
119
-
120
- The server starts read-only. Read tools always work. A tool that changes MISP state returns a `Refused:` error and sends no request unless the operator lists it in `MISP_ALLOWED_MUTATIONS` (or sets it to `*`). The allowlist is read from the server's environment, so a model cannot change it.
121
-
122
- ```
123
- MISP_ALLOWED_MUTATIONS=misp_create_event,misp_add_attribute,misp_tag_event
42
+ ```sh
43
+ npm exec --yes --package=misp-mcp@2.0.0 -- misp-mcp
124
44
  ```
125
45
 
126
- **State-changing tools (gated by `MISP_ALLOWED_MUTATIONS`):** `misp_create_event`, `misp_update_event`, `misp_add_event_report`, `misp_publish_event`, `misp_tag_event`, `misp_delete_event`, `misp_add_attribute`, `misp_update_attribute`, `misp_add_attributes_bulk`, `misp_delete_attribute`, `misp_add_sighting`, `misp_add_object`, `misp_delete_object`, `misp_attach_galaxy_cluster`, `misp_toggle_feed`, `misp_fetch_feed`, `misp_cache_feed`.
46
+ For **Streamable HTTP**, set `MISP_MCP_HTTP_TOKEN` to a separate bearer token of at least 32 characters, distinct from `MISP_API_KEY`, then start `misp-mcp --http`. The server listens on IPv4 loopback over plain HTTP. Point the client at the listener's `/mcp` endpoint on port 3000, or set `MISP_MCP_HTTP_PORT` to use another port. Send the HTTP token in the `Authorization: Bearer <token>` header. [Server entry point](src/mcp-bin.ts) · [Transport setup](src/mcp-server.ts)
127
47
 
128
- Every one of them accepts `dryRun: true`. A dry run validates the arguments, reports whether the tool is currently allowed, and sends nothing to MISP, so it works in read-only mode too.
129
-
130
- **Also require `confirm: true` (or `MISP_ALLOW_DESTRUCTIVE=true`):**
131
-
132
- - `misp_delete_event`
133
- - `misp_delete_attribute`
134
- - `misp_delete_object`
135
- - `misp_publish_event`
136
- - `misp_tag_event` when `remove: true`
137
- - `misp_toggle_feed` when `enable: false`
138
- - `misp_add_sighting` with `type` 1 (false positive) or 2 (expiration)
139
- - `misp_add_attributes_bulk` with more than 10 attributes
140
-
141
- Setting `MISP_ALLOW_DESTRUCTIVE=true` pre-authorizes the confirmations above so the per-call `confirm` flag can be omitted (useful for trusted automation). It does not enable any tool by itself; the tool must also be in `MISP_ALLOWED_MUTATIONS`.
142
-
143
- Permanent **hard** deletes (`hard: true` on `misp_delete_attribute` / `misp_delete_object`) require a **second** confirmation, `confirmHard: true`, in addition to `confirm: true`. The env opt-in does **not** bypass `confirmHard`.
144
-
145
- Future destructive CLI commands use the same policy: `MISP_ALLOW_DESTRUCTIVE=true` plus `--confirm --destructive`, with `--confirm-hard` still required for permanent deletes.
146
-
147
- ### Untrusted MISP content
148
-
149
- Event titles, comments, IOC values, tags, export bodies, and similar fields are written by other organizations. Tool results wrap them in `<untrusted_misp_data>` markers, the JSON resources carry them under an `untrusted_misp_data` key beside a notice so they stay valid JSON, any marker-like text inside the content is escaped, and tool descriptions and the server instructions tell the model to treat the content as data. Prompt arguments are delimited the same way.
150
-
151
- ### Bounds
152
-
153
- - Responses are read through a strict byte cap (`MISP_MAX_RESPONSE_BYTES`) and the request timeout stays active until the body is fully read.
154
- - `misp_add_attributes_bulk` takes at most 100 attributes and stops after five consecutive failures; the result lists succeeded, failed, and skipped items and warns about partial updates.
155
- - Event and attribute searches take an integer `limit` from 1 to 500 and an integer `page` from 1 through the largest safe integer. Nonempty pages suggest checking the next page when one can be requested. MISP may apply a lower limit, so a short page can still have a continuation.
156
- - `misp_get_related_events` accepts `maxAttributes` up to 50 and `perAttributeLimit` up to 500. Tag lists are capped at 20 and object attribute lists at 100.
157
- - Upstream error bodies are not returned to the model. Errors carry the status class, and for 4xx responses a short, redacted `message` field. The API key is redacted from every error.
48
+ ```mermaid
49
+ flowchart LR
50
+ Client[MCP client] -->|stdio| Server[misp-mcp]
51
+ Client -->|Loopback HTTP with separate bearer token| Server
52
+ Server -->|REST requests with MISP API key| MISP[MISP API]
53
+ ```
158
54
 
159
- A guarded call returns an error (`isError: true`) with a `Refused:` message and performs no MISP request.
55
+ In 2.0.0 each HTTP POST has one deadline across request parsing, upstream calls, and reply preparation. It uses the lesser of `MISP_TIMEOUT` and 55 seconds. Expiry aborts upstream I/O. Check MISP before retrying a timed-out write because MISP may have accepted it. HTTP tool results over 90,000 serialized UTF-8 bytes return a truncated preview and size metadata. [HTTP deadline](src/mcp-server.ts) · [Result limit](src/tool-registry.ts)
160
56
 
161
57
  ## Tools
162
58
 
163
- Verified against the server source (42 tools, registered in `src/tools/`).
164
-
165
- ### Event tools (6)
166
-
167
- | Tool | Description |
168
- |------|-------------|
169
- | `misp_search_events` | Search events by IOC value, type, tags, date range, organization. `limit` 1-500, `page` from 1 |
170
- | `misp_get_event` | Get full event details including attributes, objects, galaxies, related events |
171
- | `misp_create_event` | Create a new event with threat level, distribution, and analysis status |
172
- | `misp_update_event` | Update event metadata (info, threat level, analysis, publish state) |
173
- | `misp_publish_event` | Publish an event to trigger alerts to sharing partners (requires `confirm:true`) |
174
- | `misp_tag_event` | Add or remove tags (TLP, MITRE ATT&CK, custom) from an event (removal requires `confirm:true`) |
175
-
176
- ### Event report tools (3)
177
-
178
- | Tool | Description |
179
- |------|-------------|
180
- | `misp_list_event_reports` | List the reports attached to an event (no content). The request is scoped to the event on the MISP side and the result is bounded by `limit` (default 50, max 500) |
181
- | `misp_get_event_report` | Read one report with its Markdown content (cut at 50,000 characters, and the result says so) |
182
- | `misp_add_event_report` | Add a Markdown report to an event (`name`, `content` up to 1 MB, optional `distribution` 0-3, or 5 to inherit from the event; omit it to use the server default). Additive, no `confirm` flag, runs only when enabled in `MISP_ALLOWED_MUTATIONS` |
183
-
184
- ### Attribute tools (6)
185
-
186
- | Tool | Description |
187
- |------|-------------|
188
- | `misp_search_attributes` | Search IOCs across all events with type, category, and correlation filters. `limit` 1-500, `page` from 1 |
189
- | `misp_get_attribute` | Get one attribute by ID with its tags, owning event summary, and up to 20 related attributes; reports when the correlation list is capped |
190
- | `misp_update_attribute` | Edit an attribute in place (`value`, `type`, `category`, `toIds`, `comment`, `disableCorrelation`, `distribution`); at least one field required, no `confirm` flag, runs only when enabled in `MISP_ALLOWED_MUTATIONS` |
191
- | `misp_add_attribute` | Add a single IOC to an event |
192
- | `misp_add_attributes_bulk` | Add multiple IOCs to an event in one operation |
193
- | `misp_delete_attribute` | Soft or hard delete an attribute (requires `confirm:true`; hard delete also requires `confirmHard:true`) |
194
-
195
- If optional tagging cannot finish after `misp_create_event` or `misp_add_attribute` succeeds, the tool returns the creation details and `tag_results` listing applied, failed, and skipped tags. Each distinct tag is attempted once, and tagging stops at the first failed request. A failed request has an unverified outcome. Check the tags in MISP and apply any missing ones to the existing record with `misp_tag_event` if enabled, or in the MISP UI. If MISP returns no created ID, all requested tags are skipped. If the event refresh fails after tagging succeeds, `tag_results.refresh_warning` explains why the response uses the original creation data.
196
-
197
- ### Correlation & intelligence tools (3)
198
-
199
- | Tool | Description |
200
- |------|-------------|
201
- | `misp_correlate` | Find all events and attributes matching a value, with cross-event correlations |
202
- | `misp_get_related_events` | Discover events related through shared IOCs |
203
- | `misp_describe_types` | Get all available attribute types and category mappings |
204
-
205
- ### Tag & taxonomy tools (2)
206
-
207
- | Tool | Description |
208
- |------|-------------|
209
- | `misp_list_tags` | List available tags with usage statistics |
210
- | `misp_search_by_tag` | Find events or attributes by tag |
211
-
212
- ### Export tools (2)
213
-
214
- | Tool | Description |
215
- |------|-------------|
216
- | `misp_export_iocs` | Export IOCs in CSV, STIX, Suricata, Snort, text, or RPZ format |
217
- | `misp_export_hashes` | Export file hashes (MD5, SHA1, SHA256) for HIDS integration |
218
-
219
- ### Sighting & warninglist tools (3)
220
-
221
- | Tool | Description |
222
- |------|-------------|
223
- | `misp_list_sightings` | List the sightings recorded on an event (`limit` default 100, max 500; the result says when it was truncated) |
224
- | `misp_add_sighting` | Report a sighting, false positive, or expiration for an IOC |
225
- | `misp_check_warninglists` | Check if a value appears on known benign/false positive lists |
226
-
227
- ### Object tools (4)
228
-
229
- | Tool | Description |
230
- |------|-------------|
231
- | `misp_list_object_templates` | List available MISP object templates (file, domain-ip, email, etc.) |
232
- | `misp_get_object_template` | Get template details with required/optional attributes |
233
- | `misp_add_object` | Add a structured object (grouped attributes) to an event |
234
- | `misp_delete_object` | Delete an object from an event (requires `confirm:true`; hard delete also requires `confirmHard:true`) |
235
-
236
- ### Galaxy tools (4)
237
-
238
- | Tool | Description |
239
- |------|-------------|
240
- | `misp_list_galaxies` | List galaxies (MITRE ATT&CK, threat actors, malware, tools, etc.) |
241
- | `misp_get_galaxy` | Get galaxy details with all clusters |
242
- | `misp_search_galaxy_clusters` | Search clusters by keyword (find ATT&CK techniques, threat actors) |
243
- | `misp_attach_galaxy_cluster` | Attach a cluster (ATT&CK technique, etc.) to an event or attribute |
244
-
245
- ### Feed tools (4)
246
-
247
- | Tool | Description |
248
- |------|-------------|
249
- | `misp_list_feeds` | List configured threat intel feeds |
250
- | `misp_toggle_feed` | Enable or disable a feed |
251
- | `misp_fetch_feed` | Trigger a fetch/pull from a feed |
252
- | `misp_cache_feed` | Cache feed data locally for correlation |
253
-
254
- ### Organisation tools (2)
255
-
256
- | Tool | Description |
257
- |------|-------------|
258
- | `misp_list_organisations` | List local and remote sharing partner organisations |
259
- | `misp_get_organisation` | Get organisation details |
260
-
261
- ### Server & admin tools (3)
262
-
263
- | Tool | Description |
264
- |------|-------------|
265
- | `misp_server_status` | Get MISP version, permissions, and diagnostics |
266
- | `misp_list_sharing_groups` | List sharing groups for controlled distribution |
267
- | `misp_delete_event` | Delete a MISP event (requires `confirm:true`) |
268
-
269
- ## Resources
270
-
271
- | Resource URI | Description |
272
- |-------------|-------------|
273
- | `misp://types` | All supported attribute types, categories, and their mappings |
274
- | `misp://statistics` | MISP instance statistics |
275
- | `misp://taxonomies` | Available taxonomies (TLP, MITRE ATT&CK, etc.) |
276
-
277
- ## Prompts
278
-
279
- | Prompt | Description |
280
- |--------|-------------|
281
- | `investigate-ioc` | Deep IOC investigation: search, correlate, check warninglists, summarize threat context |
282
- | `create-incident-event` | Guided event creation from an incident description with IOC ingestion |
283
- | `threat-report` | Generate a threat intelligence report from MISP data |
284
-
285
- ## Usage examples
286
-
287
- ### Search for an IOC
288
-
289
- > "Search MISP for the IP address 203.0.113.50"
290
-
291
- Uses `misp_search_events` and `misp_search_attributes` to find all events and attributes referencing this IP.
292
-
293
- ### Investigate a suspicious domain
294
-
295
- > "Investigate suspicious-domain.example in MISP"
59
+ The server identifies itself as `misp-mcp` version `2.0.0` and lists 42 tools over both transports. Read-only mode still lists mutation tools. See the [tool inventory](src/tool-specs.ts) for each tool's policy.
296
60
 
297
- Triggers the `investigate-ioc` prompt workflow: searches for the domain, checks correlations, queries warninglists, and provides a structured threat assessment.
61
+ | Tool | Operation |
62
+ | --- | --- |
63
+ | `misp_search_events` | Search MISP events. |
64
+ | `misp_search_attributes` | Search IOCs and other attributes. |
65
+ | `misp_get_attribute` | Fetch an attribute and, when available, up to 20 related attributes. |
66
+ | `misp_export_iocs` | Export indicators. |
67
+ | `misp_add_event_report` | Add an event report when the tool is enabled. |
298
68
 
299
- ### Create an incident event
69
+ The follow-up correlation lookup in `misp_get_attribute` gets up to five seconds within the remaining request budget. If that lookup fails, the tool still returns the attribute details. [Attribute handler](src/tools/attributes.ts)
300
70
 
301
- <!-- content-guard: allow email -->
302
- > "Create a MISP event for a phishing campaign targeting our finance team. The phishing emails came from attacker@phish.example and linked to https://harvest.phish.example/login"
71
+ ## Safety
303
72
 
304
- Uses `misp_create_event` followed by `misp_add_attributes_bulk` to create a fully populated event.
73
+ - Leave `MISP_ALLOWED_MUTATIONS` unset or empty for read-only operation. Set it to a comma-separated list of exact tool names, such as `misp_create_event,misp_add_attribute`, to enable those tools. Use `*` or `all` to enable every mutation.
74
+ - Each mutating tool accepts `dryRun: true` in read-only mode as well. The preview validates inputs and reports whether the allowlist permits the tool. It sends no request to MISP.
75
+ - Calls that require confirmation, such as publishing an event or removing a tag, require `confirm: true` unless the operator sets `MISP_ALLOW_DESTRUCTIVE=true`. The mutation allowlist applies in either case.
76
+ - Permanent attribute and object deletes (`hard: true`) always require `confirmHard: true` on the call, in addition to the first confirmation.
77
+ - Use a MISP API key with read-only permissions for read-only clients. Treat MISP content in results as data.
305
78
 
306
- ### Export Suricata rules
79
+ [Mutation policy](src/guards.ts) · [Tool dispatch](src/tool-registry.ts) · [Security guidance](SECURITY.md)
307
80
 
308
- > "Export all IOCs from the last 7 days as Suricata rules"
81
+ ## Why not raw PyMISP or direct REST calls?
309
82
 
310
- Uses `misp_export_iocs` with format "suricata" and last "7d".
83
+ | Approach | Agent safety | Warninglists and correlation | Local CLI included |
84
+ | --- | --- | --- | --- |
85
+ | **misp-mcp** | Gated writes, input validation, untrusted-data framing | Built-in search, correlation, warninglist check, and export tools | Yes (`mispctrl`) |
86
+ | Custom `PyMISP` scripts | Up to each script | Manual per script | No |
87
+ | MISP web UI | Human-only | Manual tab switching across events | No |
311
88
 
312
- ### Check for false positives
89
+ Use `PyMISP` directly when writing scheduled ETL pipelines. Use `misp-mcp` when you want an AI client or shell operator (`mispctrl`) to query events, check warninglists, and correlate IOCs with explicit write boundaries.
313
90
 
314
- > "Is 192.0.2.123 on any MISP warninglists?"
91
+ ## FAQ
315
92
 
316
- Uses `misp_check_warninglists` to verify if the value is a known benign indicator.
93
+ **Does `misp-mcp` work with Claude Code, Claude Desktop, Cursor, and Codex?**
94
+ Yes. Run `npx -y misp-mcp` over stdio, or enable loopback Streamable HTTP with bearer authentication.
317
95
 
318
- ### Find MITRE ATT&CK techniques
96
+ **Can an agent publish or delete MISP events by default?**
97
+ No. Destructive and state-changing actions stay gated behind explicit configuration and confirmation flags.
319
98
 
320
- > "Search for phishing techniques in MITRE ATT&CK"
99
+ **Does my MISP data leave the network?**
100
+ `misp-mcp` runs locally on your machine and connects straight to your configured `MISP_URL`. Only the tool output you return to your chosen LLM client leaves the host.
321
101
 
322
- Uses `misp_search_galaxy_clusters` to find relevant ATT&CK techniques, then `misp_attach_galaxy_cluster` to link them to events.
102
+ ## Part of Lidless Labs
323
103
 
324
- ### Add structured objects
104
+ `misp-mcp` is maintained by [Lidless Labs](https://lidless.dev) ([GitHub](https://github.com/lidless-labs)). Related SOC and threat-intel tools:
325
105
 
326
- > "Add a file object to event 1 with filename encrypt.exe, SHA256 hash, and file size"
106
+ - [soc-stack](https://github.com/lidless-labs/soc-stack) - one-command Proxmox SOC lab with Wazuh, TheHive, Cortex, MISP, Zeek, and Suricata
107
+ - [wazuh-mcp](https://github.com/lidless-labs/wazuh-mcp) - read-only Wazuh SIEM/XDR alerts, agents, and CVE queries over MCP
108
+ - [thehive-mcp](https://github.com/lidless-labs/thehive-mcp) - TheHive 5 case management and alert triage over MCP
109
+ - [cortex-mcp](https://github.com/lidless-labs/cortex-mcp) - Cortex observable analyzer detonation and verdicts over MCP
110
+ - [mitre-mcp](https://github.com/lidless-labs/mitre-mcp) - local MITRE ATT&CK technique mapping and threat group profiling
327
111
 
328
- Uses `misp_add_object` with the "file" template to create a structured group of related attributes.
112
+ ## Development
329
113
 
330
- ## Supported attribute types
114
+ Run these commands from the source checkout. The default test suite uses mocks.
331
115
 
332
- | Type | Category | Example |
333
- |------|----------|---------|
334
- | `ip-src` | Network activity | Source IP address |
335
- | `ip-dst` | Network activity | Destination IP address |
336
- | `domain` | Network activity | Domain name |
337
- | `hostname` | Network activity | Hostname |
338
- | `url` | Network activity | Full URL |
339
- | `email-src` | Payload delivery | Sender email address |
340
- | `md5` | Payload delivery | MD5 file hash |
341
- | `sha1` | Payload delivery | SHA1 file hash |
342
- | `sha256` | Payload delivery | SHA256 file hash |
343
- | `filename` | Payload delivery | File name |
344
-
345
- Use `misp_describe_types` for the complete list of supported types and categories.
346
-
347
- ## Other clients & local development
348
-
349
- <details>
350
- <summary>Run from a source checkout, or wire up OpenClaw, Codex CLI, Hermes, Docker, or standalone Node.</summary>
351
-
352
- ### From source
353
-
354
- ```bash
355
- git clone https://github.com/lidless-labs/misp-mcp.git
356
- cd misp-mcp
357
- npm install
116
+ ```sh
117
+ npm ci
118
+ npm run lint
119
+ npm test
358
120
  npm run build
359
121
  ```
360
122
 
361
- Then point any client's `command`/`args` at `node /absolute/path/to/misp-mcp/dist/mcp-bin.js` instead of `npx -y misp-mcp`.
362
-
363
- ### Claude Code (source checkout)
364
-
365
- ```bash
366
- claude mcp add misp \
367
- --env MISP_URL=https://misp.example.com \
368
- --env MISP_API_KEY=your-api-key-here \
369
- --env MISP_VERIFY_SSL=false \
370
- -- node /absolute/path/to/misp-mcp/dist/mcp-bin.js
371
- ```
372
-
373
- ### OpenClaw
374
-
375
- ```bash
376
- openclaw mcp set misp '{
377
- "command": "npx",
378
- "args": ["-y", "misp-mcp"],
379
- "env": {
380
- "MISP_URL": "https://misp.example.com",
381
- "MISP_API_KEY": "your-api-key-here",
382
- "MISP_VERIFY_SSL": "false"
383
- }
384
- }'
385
- ```
386
-
387
- For a source checkout, use `"command": "node"` with `"args": ["/absolute/path/to/misp-mcp/dist/mcp-bin.js"]`. Then restart the gateway and confirm registration:
388
-
389
- ```bash
390
- systemctl --user restart openclaw-gateway
391
- openclaw mcp list # confirm "misp" is registered
392
- ```
393
-
394
- ### Codex CLI
395
-
396
- ```bash
397
- codex mcp add misp \
398
- --env MISP_URL=https://misp.example.com \
399
- --env MISP_API_KEY=your-api-key-here \
400
- --env MISP_VERIFY_SSL=false \
401
- -- npx -y misp-mcp
402
- ```
403
-
404
- Codex writes the entry to `~/.codex/config.toml` under `[mcp_servers.misp]`. Verify with `codex mcp list`.
405
-
406
- ### Hermes Agent
407
-
408
- [Hermes Agent](https://github.com/NousResearch/hermes-agent) reads MCP config from `~/.hermes/config.yaml` under `mcp_servers`:
409
-
410
- ```yaml
411
- mcp_servers:
412
- misp:
413
- command: "npx"
414
- args: ["-y", "misp-mcp"]
415
- env:
416
- MISP_URL: "https://misp.example.com"
417
- MISP_API_KEY: "your-api-key-here"
418
- MISP_VERIFY_SSL: "false"
419
- ```
420
-
421
- Then `/reload-mcp` inside a Hermes session.
422
-
423
- ### Docker
424
-
425
- ```bash
426
- docker build -t misp-mcp .
427
- docker run -e MISP_URL=https://misp.example.com -e MISP_API_KEY=your-key -e MISP_VERIFY_SSL=false misp-mcp
428
- ```
429
-
430
- The image runs as the unprivileged `node` user. Application files under `/app` are owned by root and are read-only. Its writable home is `/run/misp-mcp`, and `/tmp` also remains writable. The image does not make the entire filesystem read-only.
431
-
432
- The build and runtime stages use the same official `node:22-slim` image pinned by digest.
433
-
434
- The Proxmox installer creates a `misp-mcp` system user with no login shell. The service runs with a read-only filesystem, a private temporary directory, and a writable `/run/misp-mcp` directory with mode `0700`. Application files in `/opt/misp-mcp` remain owned by root. Credentials are stored in `/etc/misp-mcp/environment` with root ownership and mode `0600`, inside a root-only directory. The systemd manager reads that file before starting the unprivileged service. Edit it as root and restart the service when credentials change.
435
-
436
- ### Reviewed Proxmox installer inputs
437
-
438
- Before running the installer, review a local copy of the script and set these
439
- immutable inputs. There are no defaults:
440
-
441
- - `MISP_SOURCE_COMMIT`: the full 40-character hexadecimal commit reviewed for
442
- installation from `https://github.com/lidless-labs/misp-mcp.git`.
443
- - `NODE_VERSION`: an exact Node 22 version at least `22.12.0`, without a `v` prefix.
444
- - `NODE_ARCH`: `x64` or `arm64`, matching the guest architecture.
445
- - `NODE_SHA256`: the 64-character SHA-256 of that version's
446
- `node-v<VERSION>-linux-<ARCH>.tar.xz` archive.
447
-
448
- Obtain the archive checksum from the official release's signed
449
- `SHASUMS256.txt.asc`. Verify its signature with a separately trusted Node release
450
- keyring using the [official binary verification instructions](https://github.com/nodejs/node#verifying-binaries)
451
- before supplying the checksum. Do not copy a checksum from the same unverified
452
- download as the archive.
453
-
454
- The installer rejects missing or malformed pins before any host command or LXC
455
- creation. It downloads only from `https://nodejs.org/dist/v<VERSION>/`, checks the
456
- archive against the supplied checksum before extraction, then fetches the reviewed
457
- source commit from the canonical repository and checks its exact hash before
458
- `npm ci --ignore-scripts` or the build. Node is installed in `/usr/local`, including
459
- the service executable `/usr/local/bin/node`. Ubuntu template and apt prerequisites
460
- still follow their upstream repositories. This does not freeze the whole OS or
461
- provide a reproducible apt snapshot. An interrupted install leaves its guest for
462
- operator inspection. A retry refuses an existing container ID.
463
-
464
- ### Standalone
465
-
466
- ```bash
467
- MISP_URL=https://misp.example.com MISP_API_KEY=your-key node dist/mcp-bin.js
468
- MISP_URL=https://misp.example.com MISP_API_KEY=your-key node dist/cli.js status
469
- ```
470
-
471
- ### Development
472
-
473
- ```bash
474
- MISP_URL=https://misp.example.com MISP_API_KEY=your-key npm run dev
475
- ```
476
-
477
- </details>
478
-
479
- ## Testing
480
-
481
- ```bash
482
- npm test # Unit tests (mocked)
483
- npm run test:integration # Integration tests against a live MISP instance
484
- npm run test:watch # Watch mode
485
- npm run lint # Type check
486
- ```
487
-
488
- Integration tests require `MISP_URL`, `MISP_API_KEY`, and optionally `MISP_VERIFY_SSL=false` environment variables.
489
-
490
- ## Project structure
491
-
492
- ```
493
- misp-mcp/
494
- src/
495
- cli.ts # mispctrl CLI entry point
496
- mcp-bin.ts # MCP stdio entry point
497
- mcp-server.ts # Shared MCP server factory
498
- index.ts # Library export surface
499
- config.ts # Environment config + validation
500
- client.ts # MISP REST API client
501
- guards.ts # Mutation allowlist + destructive-action confirmation guards
502
- tool-specs.ts # Per-tool annotations and mutation flags
503
- tool-registry.ts # Tool registration: gate, fence, error redaction
504
- untrusted.ts # <untrusted_misp_data> fencing helpers
505
- limits.ts # Bulk and fan-out maxima
506
- types.ts # MISP API type definitions
507
- resources.ts # MCP resources
508
- prompts.ts # MCP prompts
509
- tools/ # One module per tool family (events, attributes, ...)
510
- tests/ # Unit + integration tests
511
- Dockerfile
512
- package.json
513
- ```
514
-
515
- ## Contributing
516
-
517
- Issues and pull requests are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for the contribution path and [SECURITY.md](SECURITY.md) for how to report a vulnerability privately. By participating you agree to the [Code of Conduct](CODE_OF_CONDUCT.md).
518
-
519
- ## Why not the MISP web UI or raw API?
520
-
521
- The MISP web UI and PyMISP are excellent for analysts working a console. misp-mcp is for the case where the operator is an LLM agent, not a human at a browser. It gives the model a typed, named tool for each common MISP operation, validates inputs with Zod, and shapes responses so a model can reason over them, rather than handing the model a raw REST endpoint and an OpenAPI dump. It also adds a guardrail layer the bare API does not: destructive operations fail closed unless the caller opts in, so an over-eager agent cannot publish or delete intelligence by accident. If you want a human-driven console, use the MISP UI. If you want PyMISP scripting, use PyMISP. Use misp-mcp when you want a chat or agent client to drive MISP safely.
522
-
523
- ## What misp-mcp is not
524
-
525
- - **Not a MISP server.** It talks to an existing MISP instance over the REST API; it does not store, host, or replace MISP.
526
- - **Not a general HTTP proxy.** It exposes a curated set of MISP operations as MCP tools, not arbitrary passthrough to every MISP endpoint.
527
- - **Not a SIEM, EDR, or alerting system.** It reads and writes threat intelligence; it does not collect logs or generate alerts on its own.
528
- - **Not a credential vault.** It reads `MISP_URL` and `MISP_API_KEY` from the environment; manage and rotate those keys with your own secrets tooling.
529
- - **Not an autonomous deleter.** Destructive and publishing actions are confirmation-gated by design.
530
-
531
- ### Container root access
532
-
533
- The installer creates no guest root password and locks password login after starting the container. Manage the guest from its Proxmox host with `pct enter`. Service API credentials continue to use protected stdin delivery and root-only storage.
534
-
535
- ## License
536
-
537
- [MIT](LICENSE)
538
-
539
- ---
540
-
541
- <p align="center"><a href="https://lidless.dev">Part of <strong>Lidless Labs</strong></a> &middot; the eye does not close</p>
123
+ ### Publishing
542
124
 
543
- <p align="center"><sub><strong>Security / SOC:</strong> <a href="https://github.com/lidless-labs/soc-stack">soc-stack</a> &middot; <a href="https://github.com/lidless-labs/wazuh-mcp">wazuh-mcp</a> &middot; <a href="https://github.com/lidless-labs/suricata-mcp">suricata-mcp</a> &middot; <a href="https://github.com/lidless-labs/thehive-mcp">thehive-mcp</a> &middot; <a href="https://github.com/lidless-labs/cortex-mcp">cortex-mcp</a> &middot; <a href="https://github.com/lidless-labs/mitre-mcp">mitre-mcp</a> &middot; <a href="https://github.com/lidless-labs/zeek-mcp">zeek-mcp</a> &middot; <a href="https://github.com/lidless-labs/hotwash">hotwash</a></sub></p>
125
+ The npm workflow runs on a `v*.*.*` tag push or manual dispatch. It type-checks, tests, builds, audits dependencies, and checks the package payload before publishing with provenance. The `v2.0.0` tag used npm trusted publishing through GitHub Actions OIDC. The workflow uses token authentication when `NPM_TOKEN` is configured. [Publish workflow](.github/workflows/publish.yml) · [v2.0.0 publish run](https://github.com/lidless-labs/misp-mcp/actions/runs/46905160819)
544
126
 
545
- <p align="center"><sub><a href="https://lidless.dev">All tools</a> &middot; <a href="https://github.com/lidless-labs">Lidless Labs on GitHub</a></sub></p>
127
+ [Contributing](CONTRIBUTING.md) · [Changelog](CHANGELOG.md) · [MIT License](LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "misp-mcp",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "MCP server for MISP threat intelligence platform - IOC lookups, event management, correlation discovery, and intelligence enrichment",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -38,7 +38,16 @@
38
38
  "security",
39
39
  "ioc",
40
40
  "indicators-of-compromise",
41
- "malware-analysis"
41
+ "malware-analysis",
42
+ "misp-mcp",
43
+ "cti",
44
+ "blue-team",
45
+ "mcp-server",
46
+ "model-context-protocol",
47
+ "claude-code",
48
+ "cursor",
49
+ "ai-agents",
50
+ "lidless-labs"
42
51
  ],
43
52
  "engines": {
44
53
  "node": ">=20.18.1"
@@ -65,5 +74,6 @@
65
74
  "esbuild": "0.28.1",
66
75
  "hono": "4.13.16"
67
76
  },
68
- "packageManager": "npm@10.9.7"
77
+ "packageManager": "npm@10.9.7",
78
+ "mcpName": "io.github.lidless-labs/misp-mcp"
69
79
  }