sentinel-ir-mcp 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -25,6 +25,18 @@ of safety. Other languages are not supported yet. What is detected in Python
25
25
  (and what is not) is listed in the
26
26
  [sentinel-ir README](https://gitlab.com/jakubrojicek11/sentinel-ir#python).
27
27
 
28
+ **0.4.0** uses `sentinel-ir` 0.4.2:
29
+
30
+ - **Native code:** `ctypes` / `cffi`, `process.dlopen`, `*.node` addons and
31
+ FFI packages (`koffi`, `ffi-napi`, `bun:ffi`, ...) are `critical`, with
32
+ `native_code` in `forbidden` and `nativeCode` in `facts.operations`.
33
+ - **Long sessions:** older versions never freed the WebAssembly parser
34
+ memory. After roughly 87 MB of analyzed source in one server process every
35
+ later result became `"incomplete"` (text fallback) without an error. With
36
+ `sentinel-ir-mcp` 0.3.0 + `sentinel-ir` 0.3.1 over stdio, `analyze_code` on
37
+ an 18 KB file went `incomplete` from call 4,918 on; 0.4.0 stays `complete`
38
+ (measurement below).
39
+
28
40
  ## Tools
29
41
 
30
42
  | tool | input | returns |
@@ -68,9 +80,9 @@ nothing to compile (the parser is WebAssembly).
68
80
  Run it in your project folder:
69
81
 
70
82
  ```bash
71
- npx -y sentinel-ir-mcp@0.3 setup --client cursor # or windsurf, claude-desktop, vscode, claude-code
72
- npx -y sentinel-ir-mcp@0.3 doctor --client cursor # after restarting the client
73
- npx -y sentinel-ir-mcp@0.3 guide # optional: text for AGENTS.md / client rules
83
+ npx -y sentinel-ir-mcp@0.4 setup --client cursor # or windsurf, claude-desktop, vscode, claude-code
84
+ npx -y sentinel-ir-mcp@0.4 doctor --client cursor # after restarting the client
85
+ npx -y sentinel-ir-mcp@0.4 guide # optional: text for AGENTS.md / client rules
74
86
  ```
75
87
 
76
88
  `setup` (without `--client` it asks which client):
@@ -84,7 +96,7 @@ npx -y sentinel-ir-mcp@0.3 guide # optional: text for AGENTS
84
96
  touched;
85
97
  - gives the agent one folder (`--project`, default: the current folder) and
86
98
  refuses your home folder or a whole disk;
87
- - writes `sentinel-ir-mcp@0.3`, so clients get 0.3.x fixes but no unexpected
99
+ - writes `sentinel-ir-mcp@0.4`, so clients get 0.4.x fixes but no unexpected
88
100
  new features;
89
101
  - for VS Code and Claude Code it writes nothing and prints their own install
90
102
  command (`code --add-mcp ...`, `claude mcp add ...`) instead.
@@ -97,7 +109,7 @@ npx -y sentinel-ir-mcp@0.3 guide # optional: text for AGENTS
97
109
  | `vscode`, `claude-code` | nothing; prints the command to run |
98
110
 
99
111
  On Windows the entry is `"command": "cmd", "args": ["/c", "npx", "-y",
100
- "sentinel-ir-mcp@0.3", "<folder>"]`: there `npx` is `npx.cmd`, and starting it
112
+ "sentinel-ir-mcp@0.4", "<folder>"]`: there `npx` is `npx.cmd`, and starting it
101
113
  without a shell failed with `ENOENT` on a real Windows runner. For VS Code and
102
114
  Claude Code, `setup` prints a PowerShell and a Command Prompt version of the
103
115
  command. What was measured on which system: [COMPATIBILITY.md](COMPATIBILITY.md).
@@ -138,12 +150,14 @@ To get the newest 0.2.x:
138
150
  A folder that is literally named `setup`, `doctor` or `guide` must now be
139
151
  passed as `./setup` (or an absolute path); the bare word is the command.
140
152
 
141
- ### Upgrading from 0.2.x
153
+ ### Upgrading from 0.3.x or older
142
154
 
143
- Configs written by 0.2.x pin `sentinel-ir-mcp@0.2` and keep running 0.2.x,
144
- which has no Python support. Run `setup` again for your client (it replaces
145
- only the `"sentinel-ir"` entry); `doctor` warns about an entry that still pins
146
- 0.2 or older. If the client still starts an old version, see
155
+ Configs written by older versions pin `sentinel-ir-mcp@0.3` (or `@0.2`) and
156
+ keep running that line. 0.3.x has no native-code detection, and its parser
157
+ stops working in long sessions (see 0.4.0 below); 0.2.x also has no Python
158
+ support. Run `setup` again for your client (it replaces only the
159
+ `"sentinel-ir"` entry); `doctor` warns about an entry that still pins 0.3 or
160
+ older. If the client still starts an old version, see
147
161
  [Getting a newer version](#getting-a-newer-version).
148
162
 
149
163
  ### One-click install links
@@ -173,7 +187,7 @@ Settings → Developer → Edit Config opens `claude_desktop_config.json`
173
187
  "mcpServers": {
174
188
  "sentinel-ir": {
175
189
  "command": "npx",
176
- "args": ["-y", "sentinel-ir-mcp@0.3", "/Users/you/projects/my-app"]
190
+ "args": ["-y", "sentinel-ir-mcp@0.4", "/Users/you/projects/my-app"]
177
191
  }
178
192
  }
179
193
  }
@@ -192,7 +206,7 @@ project entry has to be switched on once in Cursor Settings → Customize → MC
192
206
  "mcpServers": {
193
207
  "sentinel-ir": {
194
208
  "command": "npx",
195
- "args": ["-y", "sentinel-ir-mcp@0.3", "${workspaceFolder}"]
209
+ "args": ["-y", "sentinel-ir-mcp@0.4", "${workspaceFolder}"]
196
210
  }
197
211
  }
198
212
  }
@@ -208,8 +222,8 @@ with your project's absolute path.
208
222
  #### Other clients
209
223
 
210
224
  Any MCP client that starts stdio servers works with
211
- `command: "npx"`, `args: ["-y", "sentinel-ir-mcp@0.3", "<folder>"]`
212
- (on Windows: `command: "cmd"`, `args: ["/c", "npx", "-y", "sentinel-ir-mcp@0.3", "<folder>"]`).
225
+ `command: "npx"`, `args: ["-y", "sentinel-ir-mcp@0.4", "<folder>"]`
226
+ (on Windows: `command: "cmd"`, `args: ["/c", "npx", "-y", "sentinel-ir-mcp@0.4", "<folder>"]`).
213
227
  Without folder arguments the server uses the client's
214
228
  [MCP roots](https://modelcontextprotocol.io/specification/latest/client/roots)
215
229
  if the client offers them; if it offers none, only `analyze_code` works.
@@ -227,7 +241,7 @@ sentinel-ir-mcp [--max-file-bytes <n>] [--max-files <n>] [folder ...]
227
241
 
228
242
  - **Reads only.** The MCP server never writes files, runs commands or opens
229
243
  network connections (only the separate `setup` command writes, and only the
230
- client config file you confirm; `doctor` starts this package's own server). The only files it opens are `.js`/`.mjs`/`.cjs`/`.ts`/`.mts`/`.cts`/`.tsx` files up to
244
+ client config file you confirm; `doctor` starts this package's own server). The only files it opens are `.js`/`.mjs`/`.cjs`/`.ts`/`.mts`/`.cts`/`.tsx`/`.py`/`.pyi` files up to
231
245
  `--max-file-bytes`.
232
246
  - **Only inside the allowed folders.** Every path is resolved to its real path
233
247
  (symlinks followed) and must lie inside a folder given on the command line,
@@ -264,13 +278,22 @@ very small files. `analyze_file` on `src/ast-facts.js` took about 160 ms per
264
278
  call (average of 10, Node 24, Linux cloud VM); the first call also loads the
265
279
  WebAssembly parser.
266
280
 
281
+ Long session (one server process over stdio, 6,000 `analyze_code` calls on
282
+ the same 17.8 KB JavaScript file, about 107 MB in total, Node 24):
283
+
284
+ | version | calls with a different `analysisStatus` than the first | first such call |
285
+ |---|---:|---:|
286
+ | 0.3.0 + `sentinel-ir` 0.3.1 | 1,083 | 4,918 |
287
+ | 0.4.0 + `sentinel-ir` 0.4.2 | 0 | — |
288
+
267
289
  ## Dependencies
268
290
 
269
291
  Three runtime dependencies: the official
270
292
  [`@modelcontextprotocol/sdk`](https://www.npmjs.com/package/@modelcontextprotocol/sdk),
271
293
  `zod` (its schema peer dependency) and `sentinel-ir`. With their own
272
294
  dependencies that is about 100 packages in `node_modules`; `npm audit`
273
- reported 0 vulnerabilities at release time. Unlike `sentinel-ir` itself,
295
+ reported 0 vulnerabilities at release time (0.4.0: after updating
296
+ `body-parser` to 2.4.0 in the lock file). Unlike `sentinel-ir` itself,
274
297
  this package is not dependency-free.
275
298
 
276
299
  ## Development
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sentinel-ir-mcp",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "MCP server for sentinel-ir: lets AI agents (Claude Desktop, Cursor, Windsurf, ...) read a compact structural IR of JavaScript, TypeScript and Python files instead of the raw source. Read-only, sandboxed to allowed folders.",
5
5
  "main": "src/server.js",
6
6
  "bin": {
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@modelcontextprotocol/sdk": "^1.32.1",
22
- "sentinel-ir": "^0.3.0",
22
+ "sentinel-ir": "^0.4.2",
23
23
  "zod": "^4.1.0"
24
24
  },
25
25
  "keywords": [
package/src/clients.js CHANGED
@@ -4,7 +4,7 @@ const os = require("os");
4
4
  const path = require("path");
5
5
 
6
6
  const SERVER_NAME = "sentinel-ir";
7
- const PACKAGE_SPEC = "sentinel-ir-mcp@0.3";
7
+ const PACKAGE_SPEC = "sentinel-ir-mcp@0.4";
8
8
  const WORKSPACE_VAR = "${workspaceFolder}";
9
9
 
10
10
  function homeOf(env) {
package/src/doctor.js CHANGED
@@ -67,8 +67,8 @@ function checkConfig(client, file, explicit, project, add, platform) {
67
67
  const runs = `${label}: "${SERVER_NAME}" runs ${entry.command} ${args.join(" ")}`;
68
68
  if (entry.command === "npx" && platform === "win32") {
69
69
  add("warn", `${client}.entry`, runs, `On Windows a client may not find "npx" without a shell. Run: npx -y ${PACKAGE_SPEC} setup --client ${client}`);
70
- } else if (args.some(a => /^sentinel-ir-mcp@0\.[0-2](\.|$)/.test(a))) {
71
- add("warn", `${client}.entry`, runs, `This entry stays on an older version without Python support. Run: npx -y ${PACKAGE_SPEC} setup --client ${client}`);
70
+ } else if (args.some(a => /^sentinel-ir-mcp@0\.[0-3](\.|$)/.test(a))) {
71
+ add("warn", `${client}.entry`, runs, `This entry stays on an older version without native-code detection, whose parser stops working in long sessions. Run: npx -y ${PACKAGE_SPEC} setup --client ${client}`);
72
72
  } else if (entry.command === "npx" || isWindowsNpxWrapper(entry)) {
73
73
  add("ok", `${client}.entry`, runs);
74
74
  } else {