@cognium/mcp-server 0.8.1 → 0.9.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 (104) hide show
  1. package/CHANGELOG.md +229 -0
  2. package/README.md +165 -5
  3. package/dist/bin.js +32 -3
  4. package/dist/bin.js.map +1 -1
  5. package/dist/deps/resolve.d.ts +70 -0
  6. package/dist/deps/resolve.d.ts.map +1 -0
  7. package/dist/deps/resolve.js +256 -0
  8. package/dist/deps/resolve.js.map +1 -0
  9. package/dist/deps/snapshot.d.ts +42 -0
  10. package/dist/deps/snapshot.d.ts.map +1 -0
  11. package/dist/deps/snapshot.js +104 -0
  12. package/dist/deps/snapshot.js.map +1 -0
  13. package/dist/deps/tycho-target.d.ts +31 -0
  14. package/dist/deps/tycho-target.d.ts.map +1 -0
  15. package/dist/deps/tycho-target.js +62 -0
  16. package/dist/deps/tycho-target.js.map +1 -0
  17. package/dist/index.d.ts +2 -0
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +2 -0
  20. package/dist/index.js.map +1 -1
  21. package/dist/modules.d.ts +14 -2
  22. package/dist/modules.d.ts.map +1 -1
  23. package/dist/modules.js +11 -3
  24. package/dist/modules.js.map +1 -1
  25. package/dist/roots.d.ts +146 -0
  26. package/dist/roots.d.ts.map +1 -0
  27. package/dist/roots.js +354 -0
  28. package/dist/roots.js.map +1 -0
  29. package/dist/server.d.ts +38 -4
  30. package/dist/server.d.ts.map +1 -1
  31. package/dist/server.js +131 -7
  32. package/dist/server.js.map +1 -1
  33. package/dist/startup.d.ts.map +1 -1
  34. package/dist/startup.js +3 -4
  35. package/dist/startup.js.map +1 -1
  36. package/dist/status.d.ts +43 -0
  37. package/dist/status.d.ts.map +1 -0
  38. package/dist/status.js +54 -0
  39. package/dist/status.js.map +1 -0
  40. package/dist/tools/analyze-dependencies.d.ts +377 -0
  41. package/dist/tools/analyze-dependencies.d.ts.map +1 -0
  42. package/dist/tools/analyze-dependencies.js +387 -0
  43. package/dist/tools/analyze-dependencies.js.map +1 -0
  44. package/dist/tools/attack-surface-summary.d.ts +11 -0
  45. package/dist/tools/attack-surface-summary.d.ts.map +1 -1
  46. package/dist/tools/attack-surface-summary.js +2 -0
  47. package/dist/tools/attack-surface-summary.js.map +1 -1
  48. package/dist/tools/check-sanitizer.d.ts +10 -0
  49. package/dist/tools/check-sanitizer.d.ts.map +1 -1
  50. package/dist/tools/check-sanitizer.js +2 -0
  51. package/dist/tools/check-sanitizer.js.map +1 -1
  52. package/dist/tools/describe-sink.d.ts +14 -0
  53. package/dist/tools/describe-sink.d.ts.map +1 -1
  54. package/dist/tools/describe-sink.js +2 -0
  55. package/dist/tools/describe-sink.js.map +1 -1
  56. package/dist/tools/describe-source.d.ts +8 -0
  57. package/dist/tools/describe-source.d.ts.map +1 -1
  58. package/dist/tools/describe-source.js +2 -0
  59. package/dist/tools/describe-source.js.map +1 -1
  60. package/dist/tools/explain-finding.d.ts +5 -0
  61. package/dist/tools/explain-finding.d.ts.map +1 -1
  62. package/dist/tools/explain-finding.js +2 -0
  63. package/dist/tools/explain-finding.js.map +1 -1
  64. package/dist/tools/find-similar.d.ts +10 -0
  65. package/dist/tools/find-similar.d.ts.map +1 -1
  66. package/dist/tools/find-similar.js +2 -0
  67. package/dist/tools/find-similar.js.map +1 -1
  68. package/dist/tools/graph-facts.d.ts +829 -0
  69. package/dist/tools/graph-facts.d.ts.map +1 -0
  70. package/dist/tools/graph-facts.js +735 -0
  71. package/dist/tools/graph-facts.js.map +1 -0
  72. package/dist/tools/list-entry-points.d.ts +11 -0
  73. package/dist/tools/list-entry-points.d.ts.map +1 -1
  74. package/dist/tools/list-entry-points.js +2 -0
  75. package/dist/tools/list-entry-points.js.map +1 -1
  76. package/dist/tools/list-reachable-sinks.d.ts +11 -0
  77. package/dist/tools/list-reachable-sinks.d.ts.map +1 -1
  78. package/dist/tools/list-reachable-sinks.js +2 -0
  79. package/dist/tools/list-reachable-sinks.js.map +1 -1
  80. package/dist/tools/navigation.d.ts +22 -0
  81. package/dist/tools/navigation.d.ts.map +1 -1
  82. package/dist/tools/navigation.js +3 -0
  83. package/dist/tools/navigation.js.map +1 -1
  84. package/dist/tools/output-shapes.d.ts +159 -0
  85. package/dist/tools/output-shapes.d.ts.map +1 -0
  86. package/dist/tools/output-shapes.js +153 -0
  87. package/dist/tools/output-shapes.js.map +1 -0
  88. package/dist/tools/refresh.d.ts +7 -0
  89. package/dist/tools/refresh.d.ts.map +1 -1
  90. package/dist/tools/refresh.js +2 -0
  91. package/dist/tools/refresh.js.map +1 -1
  92. package/dist/tools/scan.d.ts +18 -0
  93. package/dist/tools/scan.d.ts.map +1 -1
  94. package/dist/tools/scan.js +2 -0
  95. package/dist/tools/scan.js.map +1 -1
  96. package/dist/tools/taint-paths.d.ts +10 -0
  97. package/dist/tools/taint-paths.d.ts.map +1 -1
  98. package/dist/tools/taint-paths.js +2 -0
  99. package/dist/tools/taint-paths.js.map +1 -1
  100. package/dist/tools/types.d.ts +17 -5
  101. package/dist/tools/types.d.ts.map +1 -1
  102. package/dist/tools/types.js +9 -0
  103. package/dist/tools/types.js.map +1 -1
  104. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -6,6 +6,235 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.9.1] - 2026-11-15
10
+
11
+ Tested against `circle-ir` **4.21.0** (was 4.20.0). The optional module to pair
12
+ it with is `circle-ir-ai` **4.32.0**, built on 4.21.0 (the release train:
13
+ `npm run check:train`). A patch from the 0.9.0 release commit: the pin moves
14
+ and nothing else, so the tool list and every schema are the same as 0.9.0.
15
+ `analyze_dependencies` reading npm projects (#52, on `main`) is not in this
16
+ release.
17
+
18
+ ### Changed
19
+
20
+ - **`circle-ir` pin 4.20.0 → 4.21.0** (exact). The engine's public API change
21
+ is additive. Answers change with it (circle-ir CHANGELOG [4.21.0]): new JS/TS
22
+ passes (`csrf-samesite-none-session`, CWE-352; `sensitive-data-in-log`,
23
+ CWE-532), Java and JS taint fixes that add true positives and clear false
24
+ positives, Maven reactor and Gradle multi-project resolved sets per module,
25
+ and `facts@2` as the default fact schema. `@cognium/code-facts` 0.1.0 needs `circle-ir` `>=4.18.0`, so a
26
+ single `circle-ir` is still installed. circle-ir 4.21.0's optional
27
+ dependency is `apache-arrow` 21.2.0 (was 21.1.0).
28
+ - **Optional peer `circle-ir-ai` `>=4.31.0` → `>=4.32.0`.** A module built on
29
+ another `circle-ir` minor is refused at load, so circle-ir-ai 4.31.0 (on
30
+ 4.20.0) would silently drop the module's tools. **Upgrade circle-ir-ai to
31
+ 4.32.0 together with the server.**
32
+
33
+ ## [0.9.0] - 2026-11-08
34
+
35
+ Tested against `circle-ir` **4.20.0** (was 4.18.1; 4.19.0 is skipped). The
36
+ optional module to pair it with is `circle-ir-ai` **4.31.0**, built on 4.20.0
37
+ (the release train: `npm run check:train`). A minor: three new tools
38
+ (`analyze_dependencies`, `find_dead_code`, `removal_reach`), an `outputSchema`
39
+ and `structuredContent` on every tool, and path confinement by default (a
40
+ changed default, see Security). 4.20.0 still carries the advisory matcher,
41
+ Maven version order and declared-version reader that `analyze_dependencies`
42
+ uses.
43
+
44
+ ### Changed
45
+
46
+ - **`circle-ir` pin 4.18.1 → 4.20.0** (exact). The engine's public API change is
47
+ additive. Answers change with it: circle-ir 4.19.0 and 4.20.0 clear many
48
+ false-positive classes and add true positives (circle-ir CHANGELOG), Java
49
+ dead code is narrower (cognium-dev #1092, #1093), and `fileTimeoutMs` is now
50
+ checked after each extraction phase (#1007), so a file that used to finish
51
+ can time out. `@cognium/code-facts` 0.1.0 needs `circle-ir` `>=4.18.0`, so a
52
+ single `circle-ir` is still installed. circle-ir 4.20.0 also declares an
53
+ optional dependency, `apache-arrow` 21.1.0, so a default install now pulls it
54
+ and its dependencies too; `npm install --omit=optional` leaves it out.
55
+ - **Optional peer `circle-ir-ai` `>=4.30.0` → `>=4.31.0`.** A module built on
56
+ another `circle-ir` minor is refused at load, so circle-ir-ai 4.30.0 (on
57
+ 4.18.1) would silently drop the module's tools. **Upgrade circle-ir-ai to
58
+ 4.31.0 together with the server.**
59
+
60
+ ### Security
61
+
62
+ - **Every path argument is confined to allowed roots, by default** (#37).
63
+ Before, every path-taking tool read any absolute directory on the host and
64
+ followed a symlink out of a project; mounted over HTTP with
65
+ `createHandler()`, a token holder could read text from any directory on the
66
+ server's host. Now every path argument of every tool, floor and module, is
67
+ checked before the tool runs: a `..` segment is refused, a Windows-style path
68
+ on a POSIX host (a UNC path on Windows) is refused, and everything else is
69
+ resolved with `realpath` and refused outside the roots, so a symlink cannot
70
+ escape. The roots are the client's MCP roots and `allowedRoots` (on
71
+ `buildServer`, `createServer`, `createHandler`), else
72
+ `COGNIUM_MCP_ALLOWED_ROOTS` — never the working directory (next entry).
73
+ `'*'` as either is the explicit opt-out. `ToolContext.allowedRoots` carries
74
+ the real roots to modules.
75
+
76
+ **This changes a default.** A call that used to read a directory outside the
77
+ allowed roots is now refused with `isError` and one line naming
78
+ `COGNIUM_MCP_ALLOWED_ROOTS`. `buildServer()` with no options is confined
79
+ too; it used to be unconfined. `dependency_calls` no longer reads
80
+ `~/.m2/repository` unless that is inside a root (its `note` says so). Clients
81
+ that send no MCP roots, such as those that start servers in `/` (Claude
82
+ Desktop on macOS), must set `COGNIUM_MCP_ALLOWED_ROOTS`.
83
+
84
+ - **Every file read is confined, there is no implicit root, and the client's
85
+ MCP roots are honoured** (S5). The confinement above had gaps before it
86
+ shipped. `analyze_dependencies`' `resolved[].applies_to` was not checked, so
87
+ the tool read build files (`pom.xml`, `effective-pom.xml`, Gradle lockfiles,
88
+ `dependency-*.txt`) in any directory on the host. Files the tool finds on its
89
+ own inside a tree (those, advisory records and the default `advisory_db`)
90
+ were read through symlinks that led out of it. With no root configured, the
91
+ server fell back to the working directory, which some clients set to `/` or
92
+ `$HOME`, so it confined nothing. And the client's MCP `roots` were ignored.
93
+ Now:
94
+
95
+ - **Every file read stays inside the roots.** `applies_to` is checked like
96
+ every other path argument and must lie inside its own tree. A nested
97
+ relative path is checked against every tree of the call, so a
98
+ baseline-side `resolved[].path` is checked against `baseline_root` too. A
99
+ file a tool finds inside a tree is read only when its real path is still
100
+ inside that tree; one that is a symlink out reads as no file.
101
+ - **The allowed roots are the client's MCP roots** when it declares the
102
+ `roots` capability. They are asked for on every call: `roots/list` on a
103
+ 2025-era connection; on the 2026-07-28 revision, an `input_required`
104
+ result whose `inputRequests["cognium/roots"]` is a `roots/list` request.
105
+ Where roots are also configured (`allowedRoots`, else
106
+ `COGNIUM_MCP_ALLOWED_ROOTS`), the client's roots only narrow them, to the
107
+ part inside both. Client roots never widen configured roots. Over HTTP
108
+ (`createHandler()`) they never stand in for them, because a remote
109
+ client's roots name its own machine's directories.
110
+ - **No implicit root.** With no configured root and no client roots, every
111
+ path-taking tool refuses with one line naming `COGNIUM_MCP_ALLOWED_ROOTS`,
112
+ whatever directory the server was started in. A client that declares
113
+ `roots` but fails `roots/list` gets the configured roots, or that refusal.
114
+ - New option `clientRoots: 'narrow' | 'establish'` on `buildServer`,
115
+ `createServer` and `createHandler`. The default is `'narrow'`; the stdio
116
+ binary uses `'establish'`, where the client's roots are the roots by
117
+ themselves. `ToolContext.allowedRoots` is the roots of the call in
118
+ progress, and is `undefined` only when that call is unconfined.
119
+ `resolveAllowedRoots()` takes no working directory and returns
120
+ `undefined` when nothing is configured. `rootPathsFromList()` and
121
+ `effectiveGuard()` are exported.
122
+
123
+ **Consumer Impact.**
124
+ - A client that sends no MCP roots, run without
125
+ `COGNIUM_MCP_ALLOWED_ROOTS`, now gets `isError` from every path-taking
126
+ tool. Before this change, those tools read the working directory. Set
127
+ the variable in the client's `env`.
128
+ - On a tree where a build file, lockfile, `dependency-*.txt`,
129
+ `effective-pom.xml` or advisory record is a symlink that leads out of the
130
+ tree, `analyze_dependencies` answers as if that file were absent. Before
131
+ this change, it read the file. The answer has fewer `dependencies[]` and
132
+ `matches[]`, and a `resolution[]` row comes from the next input in order.
133
+ An `applies_to` outside its tree, or a default `advisory_db` that is a
134
+ symlink out of the tree, is now an error.
135
+ - A module that reads `ctx.allowedRoots` while registering gets the
136
+ configured roots, not those of a call. Read it at call time.
137
+
138
+ ### Added
139
+
140
+ - **`analyze_dependencies` reads Eclipse/Tycho target platforms** (`*.target`).
141
+ On a Tycho build the third-party versions are `<location type="Maven">`
142
+ entries of a target definition, not pom `<dependency>` rows, so a tree such
143
+ as iDempiere's `org.idempiere.p2.targetplatform` resolved to no third-party
144
+ coordinate and matched no advisory. Every `*.target` file with a Maven
145
+ location is now a manifest of its own in `resolution[]` (`kind: "declared"`,
146
+ `transitive: false`); its coordinates (flat and `<dependencies>` forms) carry
147
+ `declared.origin: "target-location"` with the target file as `file`. Comments
148
+ and CDATA are ignored, other location types are skipped, and a `${…}`
149
+ version is `unknown` (counted in `unresolved`, never matched). The rules are
150
+ circle-ir's `parseTychoTargetDependencies` (cognium-dev #1077), read here
151
+ until a released `circle-ir` exports it.
152
+
153
+ **Consumer Impact.** On a tree with `*.target` files, `resolution[]` gains
154
+ one row per target file, `dependencies[]` and `matches[]` gain the target's
155
+ coordinates, and `declared.origin` takes the new value `"target-location"`.
156
+ A consumer that lists the known `origin` values should add it. Trees without
157
+ a `*.target` file answer as before, byte for byte.
158
+
159
+ - **`analyze_dependencies`**, a new built-in tool (deterministic, offline,
160
+ read-only, closed-world, with an `outputSchema`). Resolves a Java project's
161
+ manifests (Maven, Gradle) to their dependency sets — from a Gradle lockfile
162
+ or Maven `dependency:tree` / `dependency:list` output when present, else the
163
+ build file — and matches them against an OSV advisory snapshot the caller
164
+ supplies (default `<project_root>/.cognium/advisory/osv-maven`). With
165
+ `baseline_root`, adds the advisories a change removed, added and left, and
166
+ the dependency drift. The snapshot is indexed once per content (digest) per
167
+ process. Its path arguments (`project_root`, `baseline_root`, `advisory_db`,
168
+ `resolved[].path`, `resolved[].applies_to`) are confined to the allowed roots
169
+ like every other tool's, and so is every file it finds in a tree (S5).
170
+ Fifteen built-in tools.
171
+
172
+ - **Every tool declares an `outputSchema` and returns `structuredContent`**
173
+ (#38). `dependency_calls`, `analyze_dependencies`, `find_dead_code` and
174
+ `removal_reach` already did; the other thirteen now do too (`src/tools/output-shapes.ts`). `textResult` builds
175
+ `structuredContent` by parsing the JSON text it just wrote, so the two are
176
+ the same object and a field left `undefined` is absent from both. The schemas pin each tool's
177
+ top-level envelope and leave nested engine objects open. Error results are
178
+ unchanged: text only, `isError: true`.
179
+
180
+ **A minor, not a major.** No tool's `inputSchema` changed and the text
181
+ result is byte-identical; a client that ignores `outputSchema` sees only the
182
+ new `structuredContent` field. The install check counts a first
183
+ `outputSchema` on a tool that had none as an addition (#47). The install
184
+ check also reads `tools/list` across several stdout chunks now: with every
185
+ schema declared the reply is past the 64 KiB pipe buffer. From here on
186
+ these envelopes are API: removing or changing one is a major.
187
+
188
+ - **A refused optional module is visible to the MCP client** (#26), not only on
189
+ stderr. `capabilities.experimental["cognium/modules"]` lists the installed
190
+ `circle-ir`, the modules that loaded and the modules that were refused, each
191
+ refusal with its reason and, for a version-skew refusal, the `circle-ir` the
192
+ module was built against (`builtAgainst`) next to the one the server pins
193
+ (`installed`). When anything was refused, `instructions` says so in one
194
+ paragraph. Both are in the `initialize` result and in `server/discover`. A
195
+ module that throws while registering is reported the same way.
196
+ `buildServer()` takes `refusals`; `createServer()`, `createHandler()` and the
197
+ stdio binary pass the loader's. No tool or schema changed.
198
+
199
+ - **`find_dead_code`** — per declaration, the engine's `dead-code@0.1` fact:
200
+ `live`, `may-be-live` (with reasons) or `dead`, the shortest strong and weak
201
+ paths from an entry, unresolved sites, `partialFiles`, and `reachedByTest`.
202
+ Inputs `project_root`, `language`, `root_kinds[]`, `verdicts[]`, `limit`.
203
+ - **`removal_reach`** — for two checked-out trees (`project_root` = head,
204
+ `baseline_root` = base), every removed declaration with what reached it at
205
+ the base (`removal-reach@0.1`); moves and renames listed apart in `moved[]`;
206
+ `partial[]` and `partialFiles` for files that did not parse at either pin.
207
+ - Both build the engine's graph for **TypeScript / JavaScript, Java, Python or
208
+ Go** (`buildTsCallGraph`, `buildJavaGraph`, `buildPythonGraph`,
209
+ `buildGoGraph`), in one output shape. `language` picks the graph; by default
210
+ the only family present is used, and a tree holding more than one is asked
211
+ to say which (C4 0.4.0).
212
+ - Both apply **the rule `no-inferred-edge-decides@0.1`**. Each fact gets a
213
+ `decision`, and an inferred edge neither proves code live nor proves it
214
+ dead:
215
+ - `reachable` on a strong path;
216
+ - `unreachable` only with no path of any kind from a non-empty root set,
217
+ nothing unresolved and no unparsed file that could reach it;
218
+ - `undecided` otherwise.
219
+
220
+ `because` lists the facts the outcome rests on. `removal_reach` also leaves
221
+ a removal `undecided` when its file did not parse at the head, and sums the
222
+ change up in `decisions.allUnreachable`: `true`, `false` or `null`.
223
+ - Both return the evidence the decisions are read against. `entrySet` holds
224
+ the roots used: kinds, certainty, places and a digest. `scope` holds the
225
+ files read and the directories skipped.
226
+ - Both validate their input and answer with one line and `isError` for:
227
+ - an empty `root_kinds` or `verdicts`;
228
+ - a language with no files under a root;
229
+ - overlapping or identical roots (`removal_reach`);
230
+ - a tree of 50,000 files or more.
231
+ - Both carry `engine: { package: "circle-ir", version }`, because the engine's
232
+ schemes do not name the version that computed them. Every field the engine
233
+ returns is passed through unchanged; the envelope, `decision`, `entrySet`,
234
+ `scope`, `decisions` and truncation are the server's. Both declare an
235
+ `outputSchema` and return `structuredContent`; both are read-only and local.
236
+ The `META-INF/services` walk does not follow symlinks.
237
+
9
238
  ## [0.8.1] - 2026-11-01
10
239
 
11
240
  Tested against `circle-ir` **4.18.1** (was 4.16.1). The optional module to pair
package/README.md CHANGED
@@ -79,8 +79,38 @@ The same stdio config is bundled in the [Cognium SAST plugin](../../plugins/cogn
79
79
  | `find_callers` | Who calls a method, with a resolution tier on every answer and a reason on every site it could not resolve. Java. |
80
80
  | `find_callees` | What a method calls, with the same tiers and reasons. Java. |
81
81
  | `dependency_calls` | For a Maven dependency bump: every call into the artifact, the tests that reach each one, and the sites that cannot be ruled in or out. Java. Computed by `@cognium/code-facts` 0.1.0, installed with the server. |
82
+ | `find_dead_code` | Per declaration, the engine's `dead-code@0.1` fact (`live`, `may-be-live` with reasons, or `dead`, with the paths from an entry and the first test that reaches it), and a `decision` under the rule "no inferred edge decides", against the roots listed in `entrySet`. TypeScript, JavaScript, Java, Python, Go. |
83
+ | `removal_reach` | For two checked-out trees, every removed declaration with what reached it at the base (`removal-reach@0.1`; moves and renames listed apart), each with the same `decision`, and `allUnreachable` over the change. TypeScript, JavaScript, Java, Python, Go. |
84
+ | `analyze_dependencies` | Known advisories in a Java project's resolved dependencies (Maven, Gradle), matched against an OSV advisory snapshot you supply; with `baseline_root`, what a change removed and added. See below. |
82
85
  | `refresh` | Manually invalidate the cache for one project or every project. |
83
86
 
87
+ ### `analyze_dependencies`
88
+
89
+ Resolves each manifest directory to its dependency set from the best input
90
+ present, and says which: a caller-named file (`resolved`), `gradle.lockfile`,
91
+ the `dependency-tree.txt` / `dependency-list.txt` a build writes
92
+ (`mvn dependency:tree -DoutputFile=dependency-tree.txt`), or else the build
93
+ file itself (`kind: "declared"`, direct dependencies only). It then matches
94
+ every coordinate against the advisory snapshot at `advisory_db` — a directory
95
+ of OSV records, as `unzip Maven/all.zip` from OSV.dev leaves it; default
96
+ `<project_root>/.cognium/advisory/osv-maven`.
97
+
98
+ It never downloads a snapshot and never runs a build: the answer depends only
99
+ on the tree, the snapshot and this version, and carries the snapshot's
100
+ `digest` and `snapshotDate` (the newest record in it) so the caller can pin
101
+ both. Each match gives the advisory id and aliases (CVE), the affected ranges,
102
+ the later fixed versions, the record's own severity fields (copied, never
103
+ ranked), the dependency's path from a direct dependency, and the version the
104
+ POMs declare for it with where that comes from (`direct`, `property`,
105
+ `dependencyManagement`, a parent's, a BOM, an external parent). Withdrawn
106
+ records are listed by id and never matched. Test-only dependencies are left
107
+ out unless `include_dev` is true.
108
+
109
+ With `baseline_root` (the same project at an earlier commit), the answer adds
110
+ `delta` — advisories `removed`, `added` and `persisting`, each with the
111
+ versions seen on both sides, and the dependency drift — and the baseline's
112
+ `resolution`, both under the one snapshot.
113
+
84
114
  ## Resources
85
115
 
86
116
  | URI | Content |
@@ -128,10 +158,50 @@ tests reaching each (covered when `tests[0].class` is `strong`), `covered`,
128
158
  `counts` and truncation. The contract is C4 0.5.0 §11c.
129
159
 
130
160
  It is computed by `@cognium/code-facts` 0.1.0, an exact dependency of the
131
- server since 0.8.1, on the same `circle-ir` (4.18.1) the server pins, so one
161
+ server since 0.8.1, on the same `circle-ir` (4.21.0) the server pins, so one
132
162
  `circle-ir` is installed. If the package cannot be loaded, the tool answers
133
163
  with one line saying so, and every other tool keeps serving.
134
164
 
165
+ ## Dead code and removals
166
+
167
+ `find_dead_code` takes `project_root`; `removal_reach` takes `project_root`
168
+ (the head) and `baseline_root` (the base), two separate checkouts. Both take
169
+ `language` (`typescript` · `javascript` · `java` · `python` · `go`; by default
170
+ the one family present), `root_kinds` (default every entry kind except `test`)
171
+ and `limit`. The engine's answer is passed through unchanged; the contract is
172
+ C4 0.3.0 §11, with `language` from 0.4.0.
173
+
174
+ Each declaration also carries a `decision` under one rule,
175
+ `no-inferred-edge-decides@0.1`. An inferred edge neither proves code live nor
176
+ proves it dead:
177
+
178
+ | `decision.outcome` | When | `because` |
179
+ | ---- | ---- | ---- |
180
+ | `reachable` | a strong path: from a `declared` or `conventional` entry over `exact` or `polymorphic` calls | `strong-path` |
181
+ | `unreachable` | no path of any kind from any root, no unresolved site that could bind to it, no unparsed file that could reach it | all four of `no-strong-path`, `no-weak-path`, `no-unresolved-site`, `no-partial-file` |
182
+ | `undecided` | anything else: a person decides | any of `inferred-entry`, `inferred-call`, `reference`, `unresolved-site`, `partial-file`, `partial-at-head` (its file did not parse at the head, so it may not be removed at all), `no-entries` |
183
+
184
+ Read a decision against the evidence next to it:
185
+
186
+ - `entrySet` lists the roots the walk started from: their kinds, their
187
+ certainty, where they are, and a digest.
188
+ - `scope` gives how many files were read, and which directories were skipped.
189
+
190
+ With no roots, nothing is `unreachable`. `removal_reach` sums the change up in
191
+ `decisions.allUnreachable`:
192
+
193
+ - `true` when something was removed and every removal is `unreachable`;
194
+ - `false` when any removal is `reachable`;
195
+ - `null` otherwise.
196
+
197
+ The tools refuse these with one line:
198
+
199
+ - an empty `root_kinds`;
200
+ - a language with no files under a root;
201
+ - two roots that are the same directory or overlap;
202
+ - a tree of 50,000 files or more, since an answer over part of a tree could
203
+ call live code dead.
204
+
135
205
  ## Reading a navigation answer
136
206
 
137
207
  `find_callers` and `find_callees` report a **tier** on every answer and a
@@ -231,9 +301,74 @@ await server.connect(myTransport); // serves the 2025-era protocol only
231
301
  `buildServer(options)` is the synchronous form: it registers exactly what you
232
302
  pass and resolves nothing.
233
303
 
304
+ ## Which directories a tool may read
305
+
306
+ Every path argument of every tool — `scan.path`, every `project_root`,
307
+ `dependency_calls`' `jar_path` and `maven_repo_dir`, nested paths such as
308
+ `site.file` and `analyze_dependencies`' `resolved[].path` and
309
+ `resolved[].applies_to`, and the path arguments of an optional module's tools
310
+ — is **confined to the allowed roots** before the tool runs (0.9.0, #37, S5):
311
+
312
+ - a path with a `..` segment is refused, wherever it would land;
313
+ - on a POSIX host a Windows-style path (backslashes, `C:`) is refused; on
314
+ Windows a UNC path (`\\server\share`) is;
315
+ - everything else is resolved with `realpath`, so a symlink is judged by where
316
+ it points, and refused unless that lies inside a root. A tree argument inside
317
+ a root reaches the tool as its real path; a nested relative path is checked
318
+ against every tree of the call.
319
+
320
+ The files a tool then finds on its own inside a tree — a build file, a
321
+ lockfile, `dependency-tree.txt`, `effective-pom.xml`, an advisory record — are
322
+ read only when their real path is still inside that tree, so a symlink planted
323
+ in a project cannot lead a read out of it either.
324
+
325
+ **The allowed roots** are:
326
+
327
+ - **the client's MCP roots**, when the client declares the `roots` capability
328
+ (asked for on every call, so a folder the user opens counts from the next
329
+ call). On the stdio binary they are the roots by themselves; wherever roots
330
+ are also configured, they only narrow them — a tool may read the part of the
331
+ client's roots that lies inside a configured root;
332
+ - **the configured roots**: `allowedRoots` passed to `buildServer()`,
333
+ `createServer()` or `createHandler()`, else `COGNIUM_MCP_ALLOWED_ROOTS`
334
+ (directories separated by `:`, or `;` on Windows);
335
+ - **nothing else.** With no configured root and no client roots, every path is
336
+ refused, with one line naming `COGNIUM_MCP_ALLOWED_ROOTS`. The working
337
+ directory is never a root: clients start servers in `/` (Claude Desktop on
338
+ macOS) or in `$HOME`.
339
+
340
+ The opt-out is explicit: `allowedRoots: '*'` or `COGNIUM_MCP_ALLOWED_ROOTS=*`
341
+ (the client's roots, if it sends any, still narrow it). The stdio binary says
342
+ on stderr which applies.
343
+
344
+ A client that sends no MCP roots — or declares the capability and does not
345
+ answer `roots/list` — needs `COGNIUM_MCP_ALLOWED_ROOTS` in its `env`:
346
+
347
+ ```json
348
+ "cognium": {
349
+ "command": "npx",
350
+ "args": ["-y", "@cognium/mcp-server"],
351
+ "env": { "COGNIUM_MCP_ALLOWED_ROOTS": "/Users/me/src" }
352
+ }
353
+ ```
354
+
355
+ Over HTTP, a client's MCP roots name directories on the client's machine, so
356
+ on `createHandler()` they can only narrow the roots the host configures, never
357
+ stand in for them: a host that names no roots serves no path. A host that
358
+ connects `buildServer()` to a transport of its own gets the same rule unless it
359
+ passes `clientRoots: 'establish'`. On the 2026-07-28 revision, where a server
360
+ cannot send a request to the client, a client that declares `roots` is asked
361
+ for them with an `input_required` result (`inputRequests["cognium/roots"]`, a
362
+ `roots/list` request) and the call goes on when it retries with the answer.
363
+
364
+ `dependency_calls` reads the local Maven repository (`~/.m2/repository`) only
365
+ when it lies inside a root; otherwise the artifact's packages come from the
366
+ built-in table and the answer's `note` says so. Add the repository to
367
+ `COGNIUM_MCP_ALLOWED_ROOTS`, or pass `jar_path`, to have the jar read.
368
+
234
369
  ## Optional tool modules
235
370
 
236
- The fourteen tools above are always present. A separate package may add more by
371
+ The seventeen tools above are always present. A separate package may add more by
237
372
  exporting a `ToolModule`:
238
373
 
239
374
  ```ts
@@ -246,6 +381,11 @@ export default {
246
381
  // ctx.cache — the server's analysis cache, shared with every tool
247
382
  // ctx.enablement — what this install may offer; the module decides what
248
383
  // to register, and checks again at call time
384
+ // ctx.allowedRoots — the real paths tools may read in the call in
385
+ // progress (read it at call time: it follows the
386
+ // client's MCP roots). The server has already checked
387
+ // the tool's path arguments; hold any further path the
388
+ // module reads to the same roots
249
389
  },
250
390
  };
251
391
  ```
@@ -255,11 +395,25 @@ what is looked for, or to `none` to look for nothing.
255
395
 
256
396
  **The server comes up either way.** A module that is absent, broken, wrongly
257
397
  shaped or built against a different `circle-ir` minor is refused on one line of
258
- stderr, and the fourteen built-in tools serve as normal.
398
+ stderr, and the seventeen built-in tools serve as normal.
399
+
400
+ A refusal is also visible to the MCP client, on both protocol eras (the
401
+ `initialize` result and `server/discover`):
402
+
403
+ - `capabilities.experimental["cognium/modules"]` is always present:
404
+ `{ circleIr, loaded: [{ id, version, licence, circleIrRange }], refused:
405
+ [{ specifier, reason, id?, version?, builtAgainst?, installed? }] }`. On a
406
+ version-skew refusal, `builtAgainst` is the `circle-ir` the module declares
407
+ and `installed` the one this server pins.
408
+ - `instructions` carries the same facts as one paragraph when, and only when,
409
+ something was refused.
410
+
411
+ A module that throws while registering is reported the same way.
259
412
 
260
413
  | Variable | Effect |
261
414
  |---|---|
262
415
  | `COGNIUM_MCP_MODULES` | Which module specifiers to look for. `none` disables. |
416
+ | `COGNIUM_MCP_ALLOWED_ROOTS` | The directories tools may read, `:`-separated (`;` on Windows), narrowed to the client's MCP roots when it sends them. Unset: only the client's MCP roots, and with none every path is refused (never the working directory). `*` turns confinement off. |
263
417
  | `COGNIUM_ENDPOINT` | An opaque endpoint passed through to modules. The server never parses or connects to it. |
264
418
  | `COGNIUM_LICENSE` | A licence token, verified offline. Also read from `$COGNIUM_CONFIG_DIR/license`, default `~/.cognium/license`. |
265
419
  | `COGNIUM_LICENSE_PUBKEY` | Extra verification keys as `kid=key[,kid=key]`, base64url raw Ed25519, merged over the published ones. A bare key with no `kid=` matches any token, which is a development convenience and not for production. |
@@ -282,9 +436,15 @@ decides what is *listed*, and the terms carry the grant.
282
436
  ## What a response and a tool tell you
283
437
 
284
438
  - **`provenance`** is the last field of every successful response:
285
- `"deterministic"` for all fourteen built-in tools. A tool from an optional module
439
+ `"deterministic"` for all seventeen built-in tools. A tool from an optional module
286
440
  that used a model says `llm: <model>`.
287
- - **Annotations** are declared on every tool in `tools/list`. Ten are
441
+ - **`outputSchema` and `structuredContent`.** Every built-in tool declares an
442
+ `outputSchema` in `tools/list`, and every successful response carries
443
+ `structuredContent`: the same object as the JSON in `content[0].text`. The
444
+ schema pins the top-level envelope; nested engine objects are open, so the
445
+ engine may add a field inside them in a minor. An `isError` result carries
446
+ text only.
447
+ - **Annotations** are declared on every tool in `tools/list`. Thirteen are
288
448
  `readOnlyHint: true`; none reaches the network (`openWorldHint: false`) or
289
449
  deletes anything (`destructiveHint: false`). `refresh` is not read-only: it
290
450
  writes no file, but it clears the server's in-memory cache.
package/dist/bin.js CHANGED
@@ -15,7 +15,9 @@
15
15
  * cost.
16
16
  */
17
17
  import { serveStdio } from '@modelcontextprotocol/server/stdio';
18
- import { buildServer, discoverModules } from './server.js';
18
+ import { buildServer, discoverModules, SERVER_NAME } from './server.js';
19
+ import { parse, resolve } from 'node:path';
20
+ import { resolveAllowedRoots, ENV_ALLOWED_ROOTS, UNCONFINED } from './roots.js';
19
21
  import { startupLines } from './startup.js';
20
22
  async function main() {
21
23
  // Modules and the licence state are resolved once, before anything is
@@ -24,12 +26,39 @@ async function main() {
24
26
  for (const line of startupLines(discovery)) {
25
27
  process.stderr.write(`${line}\n`);
26
28
  }
29
+ // Tools read only under the allowed roots (issue #37, S5): the client's
30
+ // MCP roots, narrowed to COGNIUM_MCP_ALLOWED_ROOTS when that is set. The
31
+ // working directory is never a root: clients start servers in `/` or in
32
+ // `$HOME`. Opting out is allowed, and said out loud.
33
+ const roots = resolveAllowedRoots(undefined);
34
+ if (roots === UNCONFINED) {
35
+ process.stderr.write(`[${SERVER_NAME}] paths unconfined (${ENV_ALLOWED_ROOTS}=*): tools may read any directory on this host, ` +
36
+ "or only the client's MCP roots when it sends them\n");
37
+ }
38
+ else if (roots === undefined) {
39
+ process.stderr.write(`[${SERVER_NAME}] paths confined to the client's MCP roots; none are configured, ` +
40
+ `so a client that sends none is refused every path (set ${ENV_ALLOWED_ROOTS})\n`);
41
+ }
42
+ else {
43
+ const whole = roots.some((r) => resolve(r) === parse(resolve(r)).root);
44
+ process.stderr.write(`[${SERVER_NAME}] paths confined to ${roots.length} allowed root${roots.length === 1 ? '' : 's'} (${ENV_ALLOWED_ROOTS})` +
45
+ ", narrowed to the client's MCP roots when it sends them" +
46
+ (whole ? '; one is the filesystem root, so a client that sends no roots may read the whole disk' : '') +
47
+ '\n');
48
+ }
27
49
  // `serveStdio` owns the transport and decides, from the client's opening
28
50
  // message, which protocol era the connection speaks. A client that opens
29
51
  // with `initialize` is served exactly as before; one that speaks the
30
52
  // 2026-07-28 revision is served that. Either way it gets one server,
31
- // built here, for the life of the connection.
32
- serveStdio(() => buildServer({ modules: discovery.modules, enablement: discovery.enablement }));
53
+ // built here, for the life of the connection. The client on the other
54
+ // end of stdio is the user's own, so its MCP roots may stand in for
55
+ // configured ones.
56
+ serveStdio(() => buildServer({
57
+ modules: discovery.modules,
58
+ refusals: discovery.refusals,
59
+ enablement: discovery.enablement,
60
+ clientRoots: 'establish',
61
+ }));
33
62
  }
34
63
  main().catch((err) => {
35
64
  // stderr is safe for stdio-transport servers (stdout is reserved for MCP
package/dist/bin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,YA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AU,CAAC,GAAG,EAAE,CACd,WAAW,CAAC;QACV,OAAO,EAAE,SAAS,CAAC,OAAO;QAC1B,QAAQ,EAAE,SAAS,CAAC,QAAQ;QAC5B,UAAU,EAAE,SAAS,CAAC,UAAU;QAChC,WAAW,EAAE,WAAW;KACzB,CAAC,CACH,CAAC;AACJ,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,yEAAyE;IACzE,aAAa;IACb,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,gCAAiC,GAAa,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC,CAAC;IACtF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Resolve one source tree to its Maven-coordinate dependency set.
3
+ *
4
+ * Per directory holding a build file, the best input wins, and the answer
5
+ * says which one it was:
6
+ *
7
+ * 1. an explicit `resolved` input for that directory (caller-named file);
8
+ * 2. `gradle.lockfile`, or `gradle/dependency-locks/*.lockfile` → `lockfile`;
9
+ * 3. `dependency-tree.txt`, then `dependency-list.txt` written by a build
10
+ * run (`mvn dependency:tree|list -DoutputFile=…`) → `resolved`;
11
+ * 4. the build file itself (`pom.xml`, `build.gradle[.kts]`) → `declared`.
12
+ *
13
+ * Besides, every Eclipse PDE / Tycho target definition (`*.target`) with a
14
+ * `<location type="Maven">` is a manifest of its own, `declared`: on a Tycho
15
+ * build the third-party versions live there, not in pom rows (cognium-dev
16
+ * #1077). Its entries carry `declared.origin: "target-location"`.
17
+ *
18
+ * Nothing here runs a build or opens a connection: every input is a file
19
+ * already in the tree (or named by the caller). A file found in the tree is
20
+ * read only when its real path is still in the tree (S5): a symlinked
21
+ * `pom.xml`, lockfile or `effective-pom.xml` that leads out of it reads as
22
+ * no file, and a caller-named `applies_to` directory outside it is skipped
23
+ * (the tool refuses one before it gets here).
24
+ */
25
+ import { type DeclaredVersion, type Dependency } from 'circle-ir';
26
+ export type ResolvedKind = 'maven-dependency-tree' | 'maven-dependency-list' | 'gradle-lockfile' | 'cyclonedx-json';
27
+ export interface ResolvedInput {
28
+ path: string;
29
+ kind: ResolvedKind;
30
+ /** The manifest directory it applies to, relative to the tree root (default: the root). */
31
+ applies_to?: string;
32
+ side?: 'head' | 'baseline';
33
+ }
34
+ export interface ResolutionEntry {
35
+ manifest: string;
36
+ kind: 'resolved' | 'lockfile' | 'declared';
37
+ input: string;
38
+ dependencies: number;
39
+ unresolved: number;
40
+ excludedDev: number;
41
+ transitive: boolean;
42
+ }
43
+ /** `declared` as the tool reports it; Gradle literals are added beside the Maven origins. */
44
+ export type Declared = (Omit<DeclaredVersion, 'origin'> & {
45
+ origin: DeclaredVersion['origin'] | 'gradle-literal' | 'target-location';
46
+ }) | null;
47
+ /** One coordinate as found in one manifest. */
48
+ export interface ManifestDep {
49
+ dep: Dependency;
50
+ manifest: string;
51
+ declared: Declared;
52
+ }
53
+ export interface TreeResolution {
54
+ root: string;
55
+ resolution: ResolutionEntry[];
56
+ deps: ManifestDep[];
57
+ coverage: {
58
+ ecosystemsSeen: string[];
59
+ ecosystemsCovered: string[];
60
+ notCovered: string[];
61
+ };
62
+ }
63
+ export interface ResolveOptions {
64
+ includeDev: boolean;
65
+ side: 'head' | 'baseline';
66
+ resolved?: ResolvedInput[];
67
+ }
68
+ /** Resolve the tree at `root`. Paths in the answer are relative to it. */
69
+ export declare function resolveTree(rootIn: string, opts: ResolveOptions): TreeResolution;
70
+ //# sourceMappingURL=resolve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/deps/resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,OAAO,EAOL,KAAK,eAAe,EACpB,KAAK,UAAU,EAEhB,MAAM,WAAW,CAAC;AAKnB,MAAM,MAAM,YAAY,GAAG,uBAAuB,GAAG,uBAAuB,GAAG,i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