@vantageos/mcp-doctor 0.10.0 → 0.11.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,91 @@
3
3
  All notable changes to `@vantageos/mcp-doctor` are documented here.
4
4
  This project adheres to [Semantic Versioning](https://semver.org/).
5
5
 
6
+ ## 0.11.1 — 2026-10-29
7
+
8
+ Patch: a safety fix in the runtime introspector. No rule, verdict form or public type changes.
9
+
10
+ ### Fixed
11
+ - **The introspector never calls a tool that is not declared read-only.** With `--url` the doctor reaches a live
12
+ server, and the C-11 cursor probe sent `tools/call` to EVERY served tool whose `inputSchema` takes a `cursor`,
13
+ read-only or not. Every `tools/call` the introspector sends (the C-11 cursor probe and the S-2 safe call) is now
14
+ decided by one rule: the tool declares `annotations.readOnlyHint: true`, its `inputSchema` is an object, and its
15
+ `inputSchema.required` is absent or an array of strings naming nothing beyond the arguments the probe supplies.
16
+ Any other tool is recorded as `not-sent` with a reason naming the field (`not declared read-only
17
+ (annotations.readOnlyHint is not true)`, `inputSchema.required is malformed (<type>): the probe never guesses`,
18
+ `the tool requires <names> beside the cursor`), and no request is made. C-11 then reads `could-not-judge` for that
19
+ tool, naming the reason.
20
+ - S-2 safe call: a read-only tool whose `required` is malformed (a string, an object, `null`, an array with a
21
+ non-string member) or whose `inputSchema` is not an object was read as "no required argument" and called with `{}`.
22
+ It is no longer chosen.
23
+
24
+ ## 0.11.0 — 2026-10-29
25
+
26
+ Minor, not a patch: six rules that `--url` did not run now run, and rules that were `could-not-judge` or
27
+ `non-conforming` from a source-tree read are settled by what the running server serves or what is installed.
28
+ A new detector contract (`runServed`) is visible to library consumers.
29
+
30
+ ### Added
31
+ - **Served half (`runServed`)**: a detector may judge, from what the running server serves, the part of a rule the
32
+ tree could not decide. The runner reads the tree first; only a `could-not-judge` is settled from the wire, a
33
+ decisive static verdict stands, and a served `could-not-judge` keeps the static account and appends its own
34
+ (`<static reason> | served: <reason>`). Over `--url` (no tree) the served half is the verdict. `--url` now judges
35
+ 13 rules (was 7): S5 (g)(l), D3, D4, S10, S12, S23 added.
36
+ - **S-23** (`MCP-Protocol-Version`): two requests after initialize, one with the negotiated version (control) and
37
+ one with `1999-01-01`. Present only when the control is 2xx and the unsupported version is `400`; a 2xx on the
38
+ unsupported version is non-conforming; any other pair is `could-not-judge` naming both statuses.
39
+ - **D3 / D4** (S-2 / S-3): `resultType` is read on each served list response and on ONE tool-call response (a tool the
40
+ server itself declares `readOnlyHint: true` with no required argument, called with `{}`; only the keys of the
41
+ result are recorded, never its content; no such tool: no call is invented, and the verdict says so). `ttlMs` and
42
+ `cacheScope` are read on every served list. A field absent in a session negotiated BELOW revision 2026-07-28 (where
43
+ these are wire vocabulary) is `could-not-judge` naming the negotiated revision, not a violation; at or above it,
44
+ absent is non-conforming; a served field of the wrong type is non-conforming at any revision.
45
+ - **S-12**: `nextCursor` on each served list method. A served cursor must be a non-empty string and must be accepted
46
+ when presented back untouched (refused: non-conforming). A page with no `nextCursor` is the terminal page: stated
47
+ as such, with the note that pagination under growth is not exercised (the doctor invents no entries).
48
+ - **S-10**: with no subscription or events capability served (keys derived from the served capability names, a key
49
+ served as `false` excepted) the subscription probe has no object: `absent`, stated, with the capability keys it was
50
+ read from and, over `--url`, the note that the outbound-fetch half (a source-tree read) was not run. A declared
51
+ surface is `could-not-judge` (the probe needs a receiver the doctor does not stand up).
52
+ - **S-5 (g)(l), served**: the authorization-server metadata the PRM names (same origin only: the doctor never fetches
53
+ an origin a server names; no credential is sent to the public metadata URL). `client_id_metadata_document_supported`
54
+ and `authorization_response_iss_parameter_supported` must be the boolean true and the methods an array listing
55
+ `"none"`; a contradicted element is non-conforming, the rest of S-5 (f, h, i, j, k, and `iss` on every response)
56
+ is named as not read.
57
+ - **S-5 (g)(l), installed**: when the tree names the AS metadata route but does not write the document (the library
58
+ does), the declared dependencies are read in `node_modules` (comment-aware). An installed library can PROVE an
59
+ element (reported under `established:`); it can never prove an absence, so an element it does not state is owed
60
+ to the served metadata, never red. No `node_modules`, a declared dependency not installed, a file too large to read:
61
+ each is named.
62
+ - Programmatic: `Detector.runServed`, `ServedFacts`, `RuntimeContext.served`, `readServed`.
63
+
64
+ ### Fixed
65
+ - S-13 failed OPEN on outbound requests that do not go through a literal `fetch(`: a fetch routed through a local
66
+ wrapper (`boundedFetch`), an injected `fetchImpl` / `fetchWithToken`, or handed to an SDK client as its `fetch`
67
+ option read "no outbound request is emitted" -> present, whatever the timeout. The detector now reads the census of
68
+ outbound forms written in `s13OutboundSites.ts` (global fetch, axios / got / ky, http(s) / undici, injected fetch,
69
+ one-level wrappers and their call sites, SDK `fetch` option); every site proves a timeout or is non-conforming
70
+ naming `file:line`; a form it cannot follow (an HTTP client under another name, an alias of the global fetch, a
71
+ wrapper of a wrapper, an unreadable `fetch` option) is could-not-judge naming the site. "No outbound request is
72
+ emitted" is claimed only when every form finds zero sites, and a present verdict lists its sites.
73
+ Any other READ of the global `fetch` binding is also could-not-judge naming `file:line` and the form, never
74
+ dropped: `Reflect.apply(fetch, ..)`, `(0, fetch)(..)`, `fetch.call`, `globalThis["fetch"](..)`, `window.fetch`,
75
+ `self["fetch"]`, `Reflect.get(globalThis, "fetch")`, a destructure off the global object, an alias passed on, the bare
76
+ `globalThis` used as a value. Recognised and not flagged: a read inside a wrapper call, an SDK `fetch` option, an
77
+ injected-parameter default, `typeof fetch`. The census is written in the header of `s13OutboundSites.ts`.
78
+ A skip that says "another step judges it" now holds only when that step recorded the site at that place: a direct
79
+ call spelled `fetch` + newline + `(` or `fetch /* c */ (` (which the direct-call reader does not read) is judged on
80
+ its own options (non-conforming without a timeout, named could-not-judge when unclosed), and the same rule governs
81
+ an SDK `fetch: wrapper(..)` option whose wrapper call is not reached, `Reflect.get(globalThis)` without a key, and a
82
+ nested destructure off `globalThis`. The four hand-offs are listed in the header of `s13OutboundSites.ts`.
83
+ - S-5 (g): `token_endpoint_auth_methods_supported` written with a QUOTED key (`"token_endpoint_auth_methods_supported": [..]`,
84
+ the JSON-shaped literal) was not recognised, so a tree that lists `"none"` was reported non-conforming. The three
85
+ spellings of a property key (bare, double-quoted, single-quoted) are now read. A value that is not an array literal
86
+ (a constant, a spread) is owed to the served metadata instead of red.
87
+ - S-5: a tree that merely names `/.well-known/oauth-authorization-server` (to request it, or to mount a library that
88
+ serves it) was treated as one that writes the document, and reported (g)/(l) non-conforming for flags the library
89
+ states in `node_modules`.
90
+
6
91
  ## 0.10.0 — 2026-10-29
7
92
 
8
93
  ### Added
package/README.md CHANGED
@@ -59,7 +59,8 @@ usage: mcp-doctor <source-tree-path> [--mode=static|dynamic|both] [--backend=<co
59
59
  default: the nearest convex/ above the tree
60
60
  --url URL judge a REMOTE streamable-HTTP server the way a customer reaches it (implies
61
61
  dynamic; no launch target; https, or http on loopback only). Only the rules that
62
- judge what a running server serves run; source-tree rules are not run
62
+ judge what a running server serves run (incl. S5 (g)(l), D3, D4, S10, S12, S23);
63
+ source-tree rules are not run
63
64
  --bearer-env VAR send the token held in environment variable VAR as 'Authorization: Bearer'
64
65
  (the token never appears on a command line or in output)
65
66
  --header "Name: value" an extra request header (repeatable); values are never printed
@@ -252,6 +253,8 @@ bound or a typed error can now turn red on S-38 or S-39, where 0.8.x said nothin
252
253
 
253
254
  **C-11 (b)** dynamic: an invalid cursor is sent to each protocol list method (`-32602`) and as the cursor
254
255
  argument of each tool that takes one (`isError: true`, `structuredContent.error.code` = `invalid_cursor`).
256
+ A tool is called only when it declares `readOnlyHint: true` and its `inputSchema.required` is well-formed and
257
+ names nothing but `cursor`; any other tool is not called, and C-11 names why (could-not-judge for that tool).
255
258
  **C-9** accepts `prepare` (a read verb). **C-13** reads the ceiling from the server manifest's
256
259
  `contextCeiling` as well as from a source constant. **S-22** resolves an `allowedOrigins` element held by a
257
260
  same-file const. **DLocalIdentity** does not count a hash over local file content. **D3 / D4** attribute a
package/dist/doctor.d.ts CHANGED
@@ -181,6 +181,69 @@ interface CursorProbe {
181
181
  surface: "list-method" | "tool-argument";
182
182
  outcome: CursorProbeOutcome;
183
183
  }
184
+ /** One protocol list response as served (S-3 / S-12): what its `result` carries beside the page itself. */
185
+ interface ServedList {
186
+ /** The protocol list method (`tools/list`, `resources/list`, ...). */
187
+ method: string;
188
+ /** `answered`: a JSON-RPC result; `refused`: a JSON-RPC error; `no-answer`: nothing before the deadline. */
189
+ outcome: "answered" | "refused" | "no-answer";
190
+ /** The reason, for `refused` (the error) and `no-answer` (the cause). */
191
+ detail?: string;
192
+ /** Every key of the `result` object (the served wire shape, read, never assumed). */
193
+ resultKeys?: string[];
194
+ resultType?: unknown;
195
+ ttlMs?: unknown;
196
+ cacheScope?: unknown;
197
+ /** The `nextCursor` value as served (undefined when the key is absent). */
198
+ nextCursor?: unknown;
199
+ /** How many entries the page carried (the array named by the method). */
200
+ entries?: number;
201
+ /** When a `nextCursor` was served: the answer to presenting it back untouched. */
202
+ followUp?: {
203
+ outcome: "answered" | "refused" | "no-answer";
204
+ detail?: string;
205
+ entries?: number;
206
+ };
207
+ }
208
+ /** The `MCP-Protocol-Version` header probe (S-23): the status of a request per version sent. */
209
+ type VersionProbe = {
210
+ kind: "statuses";
211
+ supportedVersion: string;
212
+ supported: number;
213
+ unsupported: number;
214
+ } | {
215
+ kind: "not-run";
216
+ reason: string;
217
+ };
218
+ /** The authorization-server metadata as served (S-5 (g)(l)). */
219
+ type ServedAuthServer = {
220
+ kind: "document";
221
+ url: string;
222
+ status: number;
223
+ document: Record<string, unknown>;
224
+ } | {
225
+ kind: "not-run";
226
+ reason: string;
227
+ } | {
228
+ kind: "unavailable";
229
+ url: string;
230
+ reason: string;
231
+ };
232
+ /** What the running server SERVES that a source-tree read can only guess at. */
233
+ interface ServedFacts {
234
+ /** `capabilities` of the `initialize` response, as served. */
235
+ capabilities: Record<string, unknown>;
236
+ /** The protocol revision the server answered `initialize` with (unset when it named none). */
237
+ protocolVersion?: string;
238
+ lists: ServedList[];
239
+ /**
240
+ * The served tool-call response(s) (S-2): one call to a tool the server declares read-only that
241
+ * needs no argument. Empty when no tool qualifies (no call is invented).
242
+ */
243
+ calls: ServedList[];
244
+ versionProbe: VersionProbe;
245
+ authServer: ServedAuthServer;
246
+ }
184
247
  /**
185
248
  * What the RUNNING target server exposes, gathered by launching it and speaking
186
249
  * MCP over stdio (`initialize` -> `initialized` -> `tools/list`). This is the
@@ -242,6 +305,12 @@ interface RuntimeContext {
242
305
  * introspector recorded none (C-11 reads that as could-not-judge, never a pass).
243
306
  */
244
307
  cursorProbes?: CursorProbe[];
308
+ /**
309
+ * The served facts a source-tree read cannot see (list-response shape, capabilities, the
310
+ * protocol-version refusal, the authorization-server metadata). Unset when the introspector
311
+ * recorded none: a rule reading it says could-not-judge, naming that, never a pass.
312
+ */
313
+ served?: ServedFacts;
245
314
  }
246
315
  interface Detector {
247
316
  id: string;
@@ -265,6 +334,13 @@ interface Detector {
265
334
  * implements this; detectors without it run static-only in every mode.
266
335
  */
267
336
  runDynamic?(runtime: RuntimeContext): DetectorResult;
337
+ /**
338
+ * Optional SERVED half: judge from what the running server serves the part of the rule a source
339
+ * tree could not decide. It never replaces a decisive static verdict: the runner calls it only
340
+ * when the static run is could-not-judge (or, over `--url`, when there is no tree), passing that
341
+ * static result when there is one. A could-not-judge here keeps the static reason and appends this one.
342
+ */
343
+ runServed?(runtime: RuntimeContext, staticResult?: DetectorResult): DetectorResult;
268
344
  }
269
345
  /**
270
346
  * A minimal handle to a RUNNING MCP session — a live client the consumer has