@vantageos/mcp-doctor 0.16.0 → 0.18.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/CHANGELOG.md +44 -0
- package/README.md +398 -2
- package/dist/doctor.d.ts +257 -4
- package/dist/doctor.js +8248 -945
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,50 @@ All notable changes to `@vantageos/mcp-doctor` are documented here.
|
|
|
4
4
|
This project adheres to [Semantic Versioning](https://semver.org/).
|
|
5
5
|
Unreleased changes live as one fragment per pull request in `changelog.d/`, folded in here at release time.
|
|
6
6
|
|
|
7
|
+
## 0.18.0 — 2026-11-02
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **`--url URL --events-ready` probes a live server's MCP events contract (S-29 to S-33, the dynamic halves the static detectors owed).** The probe starts its own HTTPS receiver (self-signed certificate generated in memory at run time) and a loopback SSRF canary, then drives discover, `events/list`, `events/subscribe`, callback verification, signed delivery and `events/unsubscribe`. Ten checks, each present / non-conforming / could-not-judge: capability declared exactly when the methods answer (S-29); unauthenticated subscribe -32012, `http:` callback and malformed secrets -32602, the same subscription in another key order keeps its id (S-31); a signed verification envelope with a fresh challenge first, a non-echoing receiver refused with -32015 and a categorical `data.reason` without its body, no data before verification (S-32); five headers, `webhook-id` = `eventId`, `standardwebhooks` signature over the raw bytes, at most 262144 bytes, a retry with a new timestamp and signature, no replay after 410 / 413 (S-33); loopback callbacks refused and redirects never followed. With no public callback (`--events-callback-base`) or no trigger tool (`--events-trigger`) the checks that need them are could-not-judge, named. Proof: a fixture server conforming on every check and one mutation per check form (19), each red on its own check only. Adds the `standardwebhooks` dependency (MIT). (README: #added-in-0180--events-ready-probe-s-29-to-s-33-dynamic)
|
|
11
|
+
- **`--gate [--owed <file>]`: the publish gate a server's `prepublishOnly` calls.** It decides from the report's rows and a committed `mcp-doctor.owed.json` only: any `non-conforming` row refuses, even when declared (a declaration never waives a violation); any `could-not-judge` row whose id is not declared with its own reason refuses; a declared id that is no longer `could-not-judge`, or that no detector produced, refuses as stale; an unreadable or malformed owed file (bad JSON, a blank or shared reason, a duplicate id, an unknown key) refuses and is never read as empty. Exit 0 passed, 1 refused, 2 the gate could not run. The table gains a `gate:` block and `--json` a `gate` object (`passed`, `exitCode`, `refusals[{id, kind, reason}]`, `declared`). `--gate` with `--url` is refused. Proof: each case red-then-green (tests/publish-gate.test.ts) and a foreign-material probe on modelcontextprotocol/servers @ 76d64c82 (scripts/gate-foreign-bite-probe.sh: pass, undeclared, stale, violation, landing asserted, restore proven). (README: #publish-gate---gate)
|
|
12
|
+
- **DToolRoles checks agent tool roles (mcp-server-standard "Agent tool roles", rule 7).** On a server with an authenticated tier (a calling agent; a public or stdio-only server reads absent, the section does not apply), every registered tool must declare a non-empty `domain` and a `mode` of exactly `read` or `write`, in its `annotations` or its `_meta`. A tool declaring in neither place, declaring different values in the two, or with `mode: read` and no `readOnlyHint: true` (or `write` with `readOnlyHint: true`) is non-conforming, named. `decideToolRole` / `filterGrantedTools` from `@vantageos/cloud-identity` must be called by the `registerTool` wrapper or the `tools/call` handler, and by a `tools/list` handler; a tool registered before the gate is installed is non-conforming, and so is any tool the gate exempts from the decision other than the identity tool (C-33) — the exempt set is followed to its `new Set([...])`, an exemption the reader cannot follow is could-not-judge. A declaration the reader cannot resolve, and a registration in a function that does not install the gate, are could-not-judge, named. When the static half holds, the verdict is could-not-judge naming the owed scoped-identity reads: rule 7 says a run with no role fixture is never a green. The section has no rule id, so the detector declares `noNumberedRule`. Proof: one mutation per form on the vendored vantage-mcp-boilerplate 0.7.0, which is present unmutated. `withCallees` no longer treats `async (` or `function (` as a function name, so it no longer pulls in an unrelated handler body. (README: #added-in-0180--agent-tool-roles-standard-1c66e11c-mcp-server-standard-agent-tool-roles-unnumbered)
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
- **C-29 no longer reports an unreadable skill file as missing.** In the folder comparison of a plugin package's skill copy, a file that could not be read was dropped from the listing and so reported "missing" (red) although it is there; a folder that could not be listed made every file under it "missing" too. An unread file is now kept and named could-not-judge, never compared; an unlisted folder suppresses the missing / extra verdicts on its side. A package's `SKILL.md` is called missing only when its absence is seen (the nearest existing folder above it lists); an unlistable skill folder, skills root or package folder is could-not-judge, named, and so is an unlistable served skill folder, which was skipped silently. The README already promised could-not-judge for an unreadable file; this makes it true. (README: #c-29-reports-a-plugin-package-that-does-not-ship-the-served-skills)
|
|
16
|
+
- **C-34 decides the const-bound reader.** A script that names a plugin family file and writes only to ANOTHER fixed path through a `const` (`const out = "report.json"; writeFileSync(out, …)`) was read as an unresolved write (could-not-judge); it is a reader, so the file is red when no other script writes it. A write that stays unresolved (`writeFileSync(pick(), …)`, `join(root, rel)` over a map's keys) keeps the script could-not-judge. A name bound by `const` more than once in a file (`const path = …` in two functions) is no longer resolved to its first binding: it has no single value at the write. (README: #c-34-reports-a-plugin-family-that-is-not-generated-from-one-source)
|
|
17
|
+
- **D2 declares no numbered rule, as the standard says.** mcp-standard §5.2 names D2 (the `mcp-session-id` session signal) alongside D7 as guarding a protocol property without being a numbered rule; D2 still declared `rule: "S-1"`. It now carries `noNumberedRule` citing §5.2. S-1 stays judged by D12. (README: #detectors-without-a-row-in-the-release-tables-back-filled)
|
|
18
|
+
- **Every detector declares the rule it judges.** DExt7 (extension eval coverage) carried no `rule`; it now names `C-5`, where the extension standard sends the eval suite and its "extension absente" case. D7 (protocol-kit adoption) carries `noNumberedRule` instead, citing mcp-standard §5.2, which declares it an implementation vector of S-2/S-3/S-4 rather than a numbered rule. `tests/detector-rule-declared.test.ts` refuses a registered detector with neither, both, or a blank value, naming it. (README: #detectors-without-a-row-in-the-release-tables-back-filled)
|
|
19
|
+
- **DToolRoles reads a compound gate exemption per disjunct.** `exempt.has(name) || name === "list_items"` was read as one unknown condition (could-not-judge) although its second disjunct alone exempts a non-identity tool. Each top-level `||` disjunct is now read on its own: a non-identity name in any readable disjunct is red, named, with an unread disjunct beside it noted; a top-level `&&` (which narrows) is could-not-judge, named. (README: #detectors-without-a-row-in-the-release-tables-back-filled)
|
|
20
|
+
- **A detector named only in a "Changes in" release note no longer counts as documented.** `tests/readme-detector-table.test.ts` now reads the kind of each table from the heading above it: rows under `## What it checks`, `### Detectors added in`, `### Added in` and `### Detectors without a row` describe a detector and cover it; rows under `### Changes in` record a release and do not; a detector row under any other heading fails, naming it. Eight detectors were covered only by a release note (S-35 to S-41, C-36) and now have a description row. (README: #detectors-without-a-row-in-the-release-tables-back-filled)
|
|
21
|
+
- **Every registered detector has a README row, and `npm test` keeps it so.** 42 detectors (D8–D12, C7–C22, C25, C26, A2, A7, S12, the DServer / DExt families, DDebugOptIn, DAppI18n, S42, S44) were registered with no row in any README detector table; each now has one, its rule, what the static run reads and the verdicts taken from its own source. `tests/readme-detector-table.test.ts` derives the registered ids from the registry and fails naming each id without a row, each row naming an id the registry does not hold, and any first-cell form it cannot read (single, `**A**..**B**` range and hyphenated `S-28` forms are read). (README: #detectors-without-a-row-in-the-release-tables-back-filled)
|
|
22
|
+
- **The Public Suffix List generator's refusals are tested.** `scripts/regen-psl-private.ts` refuses to write on a non-2xx answer, a missing VERSION, COMMIT, BEGIN or END marker, END before BEGIN, or a source older than the vendored data; each was proven only by hand. `tests/regen-psl-private.test.ts` runs the real script on a fixture for each, against a data file in a temp dir (`REGEN_PSL_OUT`, new; `REGEN_PSL_SOURCE` points the fetch at a local server for the non-2xx case), asserting exit 2 and the file untouched; the happy path and `--allow-older` prove it writes. `--allow-older` given before the file is now read as a flag, not as the source file. (README: #s-45-reports-a-distributed-server-on-a-platform-host-with-no-streamable-http-route-or-without-a-declared-hosts-verification-path)
|
|
23
|
+
- **The Public Suffix List generator reads the vendored version, never assumes it.** A vendored data file that existed but could not be read, or carried no `PSL_VERSION`, left the version unknown and silently disabled the older-source refusal. Now only a missing file (a first generation) has no version; an unreadable file or one without `PSL_VERSION` exits 2 naming it, unless `--allow-older`. Tested per state of the vendored file. (README: #s-45-reports-a-distributed-server-on-a-platform-host-with-no-streamable-http-route-or-without-a-declared-hosts-verification-path)
|
|
24
|
+
- **DServer14 reads the 401 challenge where the header is set.** Element 1 was a co-occurrence of `WWW-Authenticate`, `resource_metadata=`, `401` and `Bearer` over the whole tree. It stayed present on vantage-peers with the six lines that send the challenge commented out. It is now present only when one live site sets `WWW-Authenticate` to a Bearer `resource_metadata=` challenge with a `401` on its path. The value is read at the site (a literal, or an identifier bound once in the file to a literal). Eight set forms are read: `.header`, `.set`, `.append`, `.setHeader`, `.appendHeader`, a headers-object key, a `[name, v]` tuple, and a subscript assignment. A `Basic` challenge is not Element 1. A header name outside these forms and reads, or an unreadable value with no other challenge, is could-not-judge naming the site. (README: #dserver14-reads-the-401-challenge-where-the-header-is-set)
|
|
25
|
+
- **The report states how many source files and registered tools it read.** A `coverage:` line under `surface:` (and a `coverage` object in `--json`) gives the number of source files the scan read and the number of registered tools the shared tool reader read. It also names unread product-looking files and registration sites whose name could not be read. A tool count that could not be read is printed as `registered tools: NOT READ — <why>`, never as 0. (README: #the-report-states-how-many-source-files-and-registered-tools-it-read)
|
|
26
|
+
|
|
27
|
+
## 0.17.0 — 2026-11-02
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
- **C-34: every plugin family is generated from one source.** For each Agent Plugins, Claude or Cursor plugin file the repository ships: a script that names and writes it, a drift check (a test importing that script, or a `--check` run in package.json or CI), and no credential (the C-31 shapes). The boilerplate: present (its four plugin files written by `scripts/sync-plugin-version.mjs`, drift-checked by `tests/pluginManifests.test.ts`). VantagePeers and Lojii ship no plugin files: absent. (README: #c-34-reports-a-plugin-family-that-is-not-generated-from-one-source)
|
|
31
|
+
- **C-35: a directory listing kit is derived from the server, never typed.** `listing/listing.json` (pinned by mcp-standard v2.10) is checked field by field: the description equals a generated plugin manifest's; tools[] lists every registered tool, with titles and hints equal to the registration's literals or, in the served half, to the served `tools/list`; test prompts link to `evals/evals.json` with at least 5 positive and 3 negative existing ids; the reviewer note is `howToObtain` only. A plugin family without a kit is red. The runtime now records each served tool's title and its two hints. The boilerplate's kit (boilerplate #42): present in the served half. (README: #c-35-reports-a-directory-listing-kit-that-is-typed-rather-than-derived-from-the-server)
|
|
32
|
+
- **S-45: a distributed server is served from an origin we own, over Streamable HTTP, with each declared host's verification path from configuration.** Scope: the hosts declared in `mcp-server.json` `distribution.targets` (none = absent, said so). Red: a platform default host as the public origin, no Streamable HTTP route, a literal verification token, or a declared host's path not served. Measured: Lojii and the boilerplate declare no targets yet (absent); Lojii with `chatgpt` declared reads non-conforming (no `/.well-known/openai-apps-challenge`). (README: #s-45-reports-a-distributed-server-on-a-platform-host-with-no-streamable-http-route-or-without-a-declared-hosts-verification-path)
|
|
33
|
+
- **S-46: a server that authenticates people offers both CIMD and DCR, and each declared host's redirect is named.** Scope: the declared targets (shared reader with S-45) and an authorization server in the tree or installed (the installed reader now also reads `registration_endpoint` / `/register`). A missing method is red. Redirect acceptance per declared host is could-not-judge until the served half exists; a host with no stated callback is could-not-judge, named. Measured on the boilerplate with `claude` and `vscode` declared: CIMD (authorizationServer.ts:439) and DCR (:407) found; both redirects left to the served half. (README: #s-46-reports-a-server-that-offers-only-one-client-registration-method-and-names-each-declared-hosts-redirect)
|
|
34
|
+
- **S-46 served half: the served authorization server is read, and a sign-in is started as each known client.** Over `--url` (with `--source` for the declared targets), S-46 reads both registration methods from the served metadata and, for VS Code (whose client document is public), starts one sign-in per redirect URI that document lists: 2xx and a 3xx onward to sign-in (or back to the redirect URI) accepted; a 4xx, or a 3xx to an error page carrying `error=`, refused and quoted. No credential is sent and the answer is never followed. The metadata and sign-in reads are public, so they run even when the MCP endpoint answers 401 without a token, and the verdict names the refused handshake. Measured: Lojii accepts both VS Code redirects (302 to sign-in); VantagePeers Cloud answers 400 `invalid_client` / `unknown-client` and announces no CIMD. (README: #s-46-reports-a-server-that-offers-only-one-client-registration-method-and-names-each-declared-hosts-redirect)
|
|
35
|
+
- **S-47: a server that serves events delivers them by signed webhook, never by polling or streaming alone.** Read in the tree: an outbound call to the subscriber's callback URL, the three Standard Webhooks headers (`webhook-id`, `webhook-timestamp`, `webhook-signature`) set on that delivery, and a `verification` envelope with a challenge sent to the subscriber before the first delivery. Each missing property is red and named; an outbound call with no recognised callback, or an imported events package, is could-not-judge. VantagePeers, Lojii and the boilerplate serve no events: absent. (README: #s-47-reports-a-server-whose-events-are-not-delivered-by-signed-webhook)
|
|
36
|
+
- **S-48: a server force-installed for a member serves that member as themself.** Read in the product source: no shared credential used as a fallback in any form (`??`, `||`, `??=`, `||=`, a ternary, a destructuring or parameter default, a guarded assignment), keyed on the credential-named value, and a 401 with a `WWW-Authenticate` challenge for a member who arrives with none. Each match counts only where its operator is code. VantagePeers, Lojii and the boilerplate: present (no fallback; a 401 challenge at server-http.ts:1022, src/app.ts:279, src/httpApp.ts:171). (README: #s-48-reports-a-server-that-serves-a-member-without-their-own-sign-in)
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
- **C-29 (amended): every plugin package ships the served skills.** When the Skills extension is declared, each plugin package (`.claude-plugin/`, `.cursor-plugin/`, or an Agent Plugins `plugin.json`) must carry `skills/<name>/SKILL.md` for every skill, byte-equal to the served copy; a missing or differing copy is red, named. A root package whose `skills/` is the served folder satisfies it. (README: #c-29-reports-a-plugin-package-that-does-not-ship-the-served-skills)
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
- **C-29 compares a plugin package's skill copy folder to folder.** Only `SKILL.md` was compared, so a package copy missing the skill's `references/` or `scripts/` stayed green. Every file of the served skill folder must now be present and byte-equal in each package copy, and a file the served skill does not carry is red too. (README: #c-29-reports-a-plugin-package-that-does-not-ship-the-served-skills)
|
|
43
|
+
- **C-34 follows a path held in a `const`.** `const pluginPath = ".claude-plugin/plugin.json"; writeFileSync(pluginPath, …)`, the common real generator, read could-not-judge. A write's path now resolves each identifier bound by `const` to a string literal or a join / resolve, one level; a `let`, or a const bound to any other call, is not followed. (README: #c-34-reports-a-plugin-family-that-is-not-generated-from-one-source)
|
|
44
|
+
- **Authorization-server metadata is read only where it is declared, never from a string that quotes it.** S-5 (g)/(l), S-46 and the installed-server reader took `client_id_metadata_document_supported: true`, `authorization_response_iss_parameter_supported: true`, `token_endpoint_auth_methods_supported`, `registration_endpoint` and the `resource:` member wherever the words appeared — including inside a refusal message — so a string could hide a real red. A match now counts only where its separator (the property's `:`, the route call's `(`) is code. A "/register" literal outside a route call (a loop over proxied prefixes) is no longer DCR: S-46 names it and does not decide DCR on it. Where a CORS `.use` and a `.post` handler both sit on `/register`, the handler is the cited site. (README: #s-46-reports-a-server-that-offers-only-one-client-registration-method-and-names-each-declared-hosts-redirect)
|
|
45
|
+
- **S-17 reads dynamic registration and CIMD only where they are declared.** The class closed for S-5, S-46 and the installed reader in the previous release also reached S-17: `registration_endpoint` and `client_id_metadata_document_supported: true` were matched anywhere, so a message string quoting the CIMD flag hid the "registration without CIMD" red, and a "/register" literal in an array counted as registration. Both are now read at a code separator with the shared forms; a "/register" literal outside a route call, with no CIMD, is could-not-judge naming it, never absent. (README: #s-46-reports-a-server-that-offers-only-one-client-registration-method-and-names-each-declared-hosts-redirect)
|
|
46
|
+
- **S-45 no longer reads an environment-variable name as a token.** The "literal token" pattern matched any 12-character string of letters, digits and underscores, so `process.env["OPENAI_APPS_CHALLENGE"]`, or a handler naming the variable in its message, was red although it reads configuration. An UPPER_SNAKE name (at least one underscore) is now a name; a real token stays red, beside a configuration read too. (README: #s-45-reports-a-distributed-server-on-a-platform-host-with-no-streamable-http-route-or-without-a-declared-hosts-verification-path)
|
|
47
|
+
- **S-45 no longer counts a localhost default as an owned origin.** A tree whose only declared origin was `PUBLIC_BASE_URL ?? "http://localhost:8787"` read "owned origin (localhost)". A loopback host (localhost, 127.0.0.0/8, ::1, 0.0.0.0) is now a development address: alone, the public origin is undeclared (could-not-judge, naming it); beside a public URL, the public URL decides. (README: #s-45-reports-a-distributed-server-on-a-platform-host-with-no-streamable-http-route-or-without-a-declared-hosts-verification-path)
|
|
48
|
+
- **S-46 served half: a sign-in is accepted only on evidence.** A 200 page, a same-origin redirect whose path names no sign-in step, or a redirect with only `error_description` was graded accepted, though an authorization server may show its refusal that way. Accepted now means back to the redirect URI, or onward to a sign-in step (sign-in, login, consent, authorize, sso in the path); anything else is could-not-judge, naming the status and Location. Lojii live stays present (both VS Code redirects 302 to accounts.vantagepeers.com/sign-in). (README: #s-46-reports-a-server-that-offers-only-one-client-registration-method-and-names-each-declared-hosts-redirect)
|
|
49
|
+
- **S-47 reads the signature on the callback call itself.** Headers set on another call in the same function (an audit log request) certified an unsigned callback POST. The delivery is now each outbound call whose target is the subscriber callback, and its headers are read from that call's options or the object it is passed; the least-signed callback call is judged. The options are read in source order, last write wins (a `headers` key after a signed spread replaces it), and a spread is followed up to three levels; a spread or headers value the reader cannot follow is could-not-judge, named. (README: #s-47-reports-a-server-whose-events-are-not-delivered-by-signed-webhook)
|
|
50
|
+
|
|
7
51
|
## 0.16.0 — 2026-11-01
|
|
8
52
|
|
|
9
53
|
### Added
|
package/README.md
CHANGED
|
@@ -28,6 +28,7 @@ npx @vantageos/mcp-doctor ./mcp-server
|
|
|
28
28
|
|
|
29
29
|
```
|
|
30
30
|
surface: ./mcp-server
|
|
31
|
+
coverage: 3 source files read (.ts/.tsx, excluding .d.ts and .test.ts); 12 registered tools read
|
|
31
32
|
item | file:line | state | verdict
|
|
32
33
|
-----------------------------------------------------------------------------
|
|
33
34
|
D2 stateless | - | present | stateless (no mcp-session-id session-keying)
|
|
@@ -40,6 +41,8 @@ D7 protocol-kit | package.json | absent | hand-rolled bu
|
|
|
40
41
|
|
|
41
42
|
The path is the root of the MCP server sources (the folder holding `server.ts` / `transport/` /
|
|
42
43
|
`package.json`). `node_modules`, `dist`, `build`, `.git` and test folders are skipped automatically.
|
|
44
|
+
The `coverage:` line under `surface:` states what the run read: see
|
|
45
|
+
[the report states how many source files and registered tools it read](#the-report-states-how-many-source-files-and-registered-tools-it-read).
|
|
43
46
|
|
|
44
47
|
### Options
|
|
45
48
|
|
|
@@ -47,7 +50,9 @@ The binary's own `--help` is the authority; this is what it prints:
|
|
|
47
50
|
|
|
48
51
|
```
|
|
49
52
|
usage: mcp-doctor <source-tree-path> [--mode=static|dynamic|both] [--backend=<convex-dir>] [--json]
|
|
53
|
+
mcp-doctor <source-tree-path> --gate [--owed <file>] [--mode=...] [--json]
|
|
50
54
|
mcp-doctor --url <https url> [--bearer-env VAR] [--header "Name: value"]... [--source DIR] [--expected-commit SHA] [--json]
|
|
55
|
+
mcp-doctor --url <https url> [--bearer-env VAR] [--header ...] --events-ready [--events-* ...] [--json]
|
|
51
56
|
|
|
52
57
|
--mode=static read the tree only (default)
|
|
53
58
|
--mode=dynamic launch the server and judge what it serves
|
|
@@ -67,12 +72,31 @@ usage: mcp-doctor <source-tree-path> [--mode=static|dynamic|both] [--backend=<co
|
|
|
67
72
|
--source DIR with --url: the server's source tree, for D8 eval counts and the C-25 expected
|
|
68
73
|
commit (git rev-parse HEAD there)
|
|
69
74
|
--expected-commit SHA with --url: the full commit id the server must serve (C-25)
|
|
75
|
+
--events-ready with --url: run ONLY the MCP events probe (S-29..S-33): discover, events/list,
|
|
76
|
+
events/subscribe, callback verification, signed delivery, events/unsubscribe,
|
|
77
|
+
against an HTTPS receiver it starts (self-signed, generated at run time)
|
|
78
|
+
--events-callback-base URL a public https URL forwarding to the receiver; without it the
|
|
79
|
+
checks that need the server to POST are could-not-judge
|
|
80
|
+
--events-receiver-port N the receiver's local port (the forwarder's target; default any)
|
|
81
|
+
--events-trigger NAME [--events-trigger-args JSON] the tool whose call causes one event;
|
|
82
|
+
without it the delivery checks are could-not-judge
|
|
83
|
+
--events-name NAME [--events-args JSON] the event subscribed to and its arguments
|
|
84
|
+
(default: the first event listed, {}; two keys or more to probe key order)
|
|
85
|
+
--events-observe-ms N how long deliveries are watched after the trigger (default 5000)
|
|
86
|
+
--gate the publish gate (for prepublishOnly): refuse any non-conforming row, any
|
|
87
|
+
could-not-judge row not declared in the owed file, and any stale declaration
|
|
88
|
+
(a declared id no longer could-not-judge, or no row of that id). Prints a
|
|
89
|
+
gate: block (--json: a gate object). Not combinable with --url / --events-ready
|
|
90
|
+
--owed FILE with --gate: the owed-verdicts file (default <source-tree>/mcp-doctor.owed.json);
|
|
91
|
+
{"owed": [{"id": "<detector id>", "reason": "<why>"}, ...]}
|
|
70
92
|
--json print the report as JSON (results, owedHumanVerdicts, exitCode)
|
|
71
93
|
--version print the version and exit
|
|
72
94
|
--help print this and exit
|
|
73
95
|
|
|
74
96
|
exit: 0 clean, 1 a violation, 2 an abstention with no violation (including a target
|
|
75
97
|
that names nothing readable: missing, empty, or not a source tree)
|
|
98
|
+
--gate: 0 passed, 1 refused, 2 the gate could not run (unreadable owed file, unreadable
|
|
99
|
+
tree, a detector failure, a usage error); a violation exits 1 whatever else happened
|
|
76
100
|
```
|
|
77
101
|
|
|
78
102
|
## States and exit codes
|
|
@@ -125,15 +149,75 @@ reporting that it is broken, and silencing it would hide the fault behind a norm
|
|
|
125
149
|
for every target, because its entrypoint guard never fired under a symlink. A CI job that has been
|
|
126
150
|
green on 0.2.0 was green because nothing ran. Expect findings on the first run of 0.3.x.
|
|
127
151
|
|
|
152
|
+
## Publish gate (--gate)
|
|
153
|
+
|
|
154
|
+
`--gate` is the check a server's `prepublishOnly` calls, so that a package is never published with a
|
|
155
|
+
violation or with an undecided row nobody answered for:
|
|
156
|
+
|
|
157
|
+
```json
|
|
158
|
+
"prepublishOnly": "npm run build && mcp-doctor . --gate"
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
The gate decides from two inputs only: the rows the report prints, and an owed-verdicts file committed in
|
|
162
|
+
the server's repository. It adds no rule of its own and changes no detector. It refuses when:
|
|
163
|
+
|
|
164
|
+
| kind | refused when | what to fix |
|
|
165
|
+
|---|---|---|
|
|
166
|
+
| `violation` | a row is `non-conforming` — always, even when its id is declared in the owed file | the code |
|
|
167
|
+
| `undeclared` | a row is `could-not-judge` and its id is not in the owed file (an owed-human row included) | make the row decidable, or declare it with its reason |
|
|
168
|
+
| `stale` | a declared id has no `could-not-judge` row left: it became present, absent or non-conforming, or the run produced no row with that id | remove or correct the entry |
|
|
169
|
+
| `unreadable-owed` | the owed file cannot be read, is not valid JSON, or breaks the format below | the file; it is never read as an empty file |
|
|
170
|
+
|
|
171
|
+
It passes only with zero violations, every `could-not-judge` row declared, and no stale declaration. A server
|
|
172
|
+
with no `could-not-judge` row needs no file. Exit codes: **0** passed, **1** refused, **2** the gate could not run
|
|
173
|
+
(an unreadable owed file, an unreadable tree, a detector failure, a usage error). A violation exits 1 whatever else
|
|
174
|
+
happened, as a violation takes precedence over an abstention in the report's own exit code.
|
|
175
|
+
|
|
176
|
+
**The owed-verdicts file.** Default path `<source-tree>/mcp-doctor.owed.json` (beside a single-file subject, its
|
|
177
|
+
directory), overridable with `--owed <file>`. A file named with `--owed` that does not exist is refused.
|
|
178
|
+
|
|
179
|
+
```json
|
|
180
|
+
{
|
|
181
|
+
"owed": [
|
|
182
|
+
{ "id": "C35 listing-kit", "reason": "the listing kit is generated at release from the served tools/list" },
|
|
183
|
+
{ "id": "D8 eval-suite-coverage", "reason": "tool registration is computed; evals run against the served list in CI" }
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
- `id` is the detector id exactly as the report's first column prints it (`--json`: a result's `id`).
|
|
189
|
+
- One entry per id, one id per entry, each with its own non-empty `reason`. A duplicate id, a list of ids, a
|
|
190
|
+
blank or missing reason, a reason copied onto a second id, and any unknown key are refused: the file states
|
|
191
|
+
a reason per row, it is not a waiver list.
|
|
192
|
+
- An entry list rather than an object keyed by id, because a JSON parser keeps the last of two equal keys in
|
|
193
|
+
silence and a duplicate must be seen to be refused.
|
|
194
|
+
|
|
195
|
+
This is not the same thing as the `owedHumanVerdicts` count: that is a detector stating that a person's verdict
|
|
196
|
+
is due on named sites. The owed file is the maintainer's declaration, for every undecided row, of why the package
|
|
197
|
+
may still be published.
|
|
198
|
+
|
|
199
|
+
**Output.** The table is followed by a `gate:` block: `PASSED`, or `REFUSED` with one line per refusal
|
|
200
|
+
(`kind | id | what is wrong and what to fix`). Under `--json` the report gains a `gate` object:
|
|
201
|
+
`{ passed, exitCode, refusals: [{ id, kind, reason }], declared, owedFile, owedFileFound }`, plus `cannotRun`
|
|
202
|
+
(the reason) when the gate could not run. The report's own `exitCode` field keeps its meaning; the process exits
|
|
203
|
+
with `gate.exitCode`.
|
|
204
|
+
|
|
205
|
+
**Mode.** Static by default (a prepublish has the tree, not a running server); `--mode` passes through. `--gate`
|
|
206
|
+
with `--url` or `--events-ready` is refused: a `--url` run does not run the source-tree rules, so its pass would say
|
|
207
|
+
nothing about them.
|
|
208
|
+
|
|
128
209
|
## Programmatic use
|
|
129
210
|
|
|
130
211
|
```ts
|
|
131
212
|
import { runDoctorReport, renderTable } from "@vantageos/mcp-doctor";
|
|
132
213
|
|
|
133
|
-
const { results, skipped } = runDoctorReport("./mcp-server");
|
|
134
|
-
console.log(renderTable("./mcp-server", results, skipped));
|
|
214
|
+
const { results, skipped, coverage } = runDoctorReport("./mcp-server");
|
|
215
|
+
console.log(renderTable("./mcp-server", results, skipped, coverage));
|
|
135
216
|
```
|
|
136
217
|
|
|
218
|
+
`coverage` is what the run read (source files, registered tools); `renderTable` prints it as the
|
|
219
|
+
`coverage:` line under `surface:`, and called without it prints a "NOT REPORTED" line in its place.
|
|
220
|
+
|
|
137
221
|
`skipped` is the list of directories the run actually walked past (`node_modules`, `dist`, test
|
|
138
222
|
material...), recorded by the walks as they skip them. `renderTable` prints it as the
|
|
139
223
|
"skipped directories" section, so a report never reads as full coverage of a narrowed scope. Pass it
|
|
@@ -158,6 +242,63 @@ Each detector maps one standard item and is proven **bipolar** on real material:
|
|
|
158
242
|
| **DLocalIdentity** no-local-identity | No MCP server defines its own identity primitive: resolving a caller to a tenant or agent (local JWT verify, a populated allow-list attached to a bearer), asserting org membership or role, filtering rows by caller scope (`fromAllowList`, a name allow-list, a row's `orgId` or acting-name field such as `createdBy` / `assignedTo` compared to the caller's, by `===`, `==`, `Object.is` or after `toLowerCase()`), or validating a credential (local `timingSafeEqual`, a digest of a presented value, HMAC; a hash over a static literal, or over local content — file bytes, a directory listing, a digest of them, i.e. a content fingerprint of the built tree — is not a site). A call to a binding imported from `@vantageos/cloud-identity` is not a site. Minting/signing sites (`new SignJWT`, `jwt.sign`, a private-key import) are listed as `MINTING/SIGNING` and not counted; verification and claim reads stay violations whoever issued the token (no issuer carve-out). | present (0, or EXEMPT) / non-conforming (count > ceiling, default 0) / could-not-judge |
|
|
159
243
|
| **S-28** claim-forwarded | Server complement S-28 (standard `bacc54a`) — a tool forwards the verified claim of its caller (`verifiedOrg` / `verifiedPerson`) to every backend door it calls and refuses when it holds none. Reads each `<client>.query\|mutation\|action` call, the helpers it spreads, the refusal before it, and the backend source's door list (`--backend=<convex-dir>`, else the nearest `convex/` above the tree). A door that is service-account-only or declared `fleet-wide:` needs no claim; no backend found, an unknown door, a computed door name are could-not-judge. | present / non-conforming / could-not-judge / absent (no Convex client imported) |
|
|
160
244
|
|
|
245
|
+
### Detectors without a row in the release tables (back-filled)
|
|
246
|
+
|
|
247
|
+
Registered detectors that no description table above or below documents, in registry order; each row is read from the detector's own source file. The last eight (S-35..S-41, C-36) were introduced in a "Changes in" release note, which records a release and does not cover a detector.
|
|
248
|
+
|
|
249
|
+
| ID | Rule | The static run reads | Verdicts |
|
|
250
|
+
|----|------|----------------------|----------|
|
|
251
|
+
| **D8** eval-suite-coverage | C-5 (the >=3-cases count half) | registered tools against the case count per tool in `evals/evals.json` | absent (no tool, or no eval file) / present / non-conforming / could-not-judge |
|
|
252
|
+
| **D9** semver+changelog | C-3 | `package.json` `version` against strict SemVer, and `CHANGELOG.md` beside it | absent (no `CHANGELOG.md`) / present / non-conforming / could-not-judge |
|
|
253
|
+
| **D10** bilingual | C-1 | `description_fr` in `package.json` or in source, `README.fr.md`, and its listing in `files[]` | present / non-conforming / could-not-judge |
|
|
254
|
+
| **D11** zod-schemas | C-4 | `z.any()` per line, and tool registrations against `outputSchema` occurrences tree-wide (not per tool) | absent (no tool) / present / non-conforming / could-not-judge |
|
|
255
|
+
| **D12** stdio-transport | S-1 | `StdioServerTransport` or a `package.json` `bin` entry, against an HTTP/Streamable transport | absent (no transport signal) / present / non-conforming / could-not-judge (unparseable `package.json`) |
|
|
256
|
+
| **C7** artifact-verifiable | C-7 | `README.md` / `README.fr.md`: one-command install naming a registry, version pin, two obtain channels, provenance or checksum | present / non-conforming / could-not-judge |
|
|
257
|
+
| **C8** authority-declared | C-8 | each registered tool's `authRead` / `authWrite` pair in the closed 5-tier set (a folded `auth` refused) | absent (no tool) / present / non-conforming / could-not-judge |
|
|
258
|
+
| **C9** verb-declared | C-9 | each registered tool's `annotations.verb` in the closed set (`rpc` refused) | absent (no tool) / present / non-conforming / could-not-judge |
|
|
259
|
+
| **C10** mechanism-declared | C-10 | each list/search tool's `annotations.searchMechanism` in the closed set (`unindexed-scan` refused) | absent (no list/search tool) / present / non-conforming / could-not-judge |
|
|
260
|
+
| **C11** pagination-declared-applied | C-11 | each list/search tool's cursor, default and finite max in its annotations or `inputSchema` | absent (no paginable tool) / present / non-conforming / could-not-judge |
|
|
261
|
+
| **C12** no-duplicates | C-12 | the (verb, table, mechanism) triplet of every tool declaring verb and table | absent (no tool) / present / non-conforming / could-not-judge |
|
|
262
|
+
| **C13** context-ceiling | C-13 | each tool's `tokensEstimeContexte` against the declared (global, perTool) context ceiling | absent (no tool) / present / non-conforming / could-not-judge |
|
|
263
|
+
| **C14** catalog-registration | C-14 | the `mcpCatalog` block in `package.json` and its required fields | absent (no block) / non-conforming / could-not-judge (complete block; registry resolution owed) |
|
|
264
|
+
| **C15** annotations-untrusted | C-15 | each tool's four behavioral hints and title, read/write enum parameters, and consumer auto-approval off a hint | absent (no tool) / present / non-conforming / could-not-judge |
|
|
265
|
+
| **C16** untrusted-output | C-16 | template interpolation into instruction positions and its trust-boundary marker, and free-body strings in event payloads | absent (no interpolation site) / present / non-conforming |
|
|
266
|
+
| **C17** supply-chain | C-17 | a committed lockfile, and a provenance claim (`publishConfig`, `.github/workflows/*.yml`) or a provenance record | present / non-conforming / could-not-judge |
|
|
267
|
+
| **C18** structure-manifest | C-18 | the root `mcp.json` / `mcp-server.json` or `extension.json`: required fields and version against `package.json` | present / non-conforming / could-not-judge |
|
|
268
|
+
| **C19** served-descriptions | C-19 | an inline source description on each registered tool (presence proxy; the served text is the dynamic run) | absent (no tool) / present / non-conforming / could-not-judge |
|
|
269
|
+
| **C20** locales-derived | C-20 | locale files under `src/i18n/` against hardcoded locale enumerations elsewhere | absent (no `src/i18n/`) / present / non-conforming |
|
|
270
|
+
| **C21** progressive-disclosure | C-21 | nothing: the connection load is measured only with a live session | absent (static run) |
|
|
271
|
+
| **C22** test-ratio-gate | C-22 | test/coverage ratios cited in `README.md`, `README.fr.md`, `CHANGELOG.md` and their passage identifier | absent (no ratio cited) / non-conforming / could-not-judge |
|
|
272
|
+
| **C25** build-identity | C-25 | the `new McpServer(...)` / `new Server(...)` arguments and a `/health` route: a build-fed identity field beside `version` | absent (no construction) / present / non-conforming / could-not-judge |
|
|
273
|
+
| **C26** subpackage-lockfile | C-26 | deployment configs (`railway.json`, `Dockerfile`, `fly.toml`, ...) and a frozen install of each targeted subpackage in isolation | absent (no deployment config, or no npm site) / present / non-conforming / could-not-judge |
|
|
274
|
+
| **A2** declared-domains | A-2 | network and frame targets in the UI code against the `_meta.ui.csp` lists, and the single-file bundle | absent (no `ui://` resource) / present / non-conforming / could-not-judge |
|
|
275
|
+
| **A7** consent-before-destructive | A-7 | the gate logic: event-origin approvals, `destructiveHint`-only skips, explicit confirmation requests | absent (no tool-call gate) / present / non-conforming / could-not-judge |
|
|
276
|
+
| **S12** list-pagination | S-12 | `nextCursor` in each hand-registered protocol list handler, and code that decodes a cursor | absent (no list method served) / present / non-conforming / could-not-judge |
|
|
277
|
+
| **DServer2** naming | C-2 | tool names (snake_case, 64-character cap) and the `package.json` name (kebab-case) | present / non-conforming / could-not-judge |
|
|
278
|
+
| **DServer6** secret-hygiene | C-6 | log calls referencing secrets, PII or internal detail, and raw error traces sent to the client | present / non-conforming / could-not-judge |
|
|
279
|
+
| **DDebugOptIn** debug-opt-in | C-6 (debug half) | `.debug(...)` calls and the env/config gate around them | absent (no debug output) / present / non-conforming / could-not-judge |
|
|
280
|
+
| **DServer8** ui-fallback | A-1 | each `content[]` emitting a `ui://` resource, and a sibling text/markdown entry | absent (no `ui://` emission) / present / non-conforming / could-not-judge |
|
|
281
|
+
| **DServer14** oauth-resource-server | S-5 | the five-element OAuth 2.1 resource-server chain and the `@vantageos/cloud-identity` dependency and range | absent (no resource-server surface) / present / non-conforming / could-not-judge |
|
|
282
|
+
| **DAppI18n** app-i18n | C-20 | `i18n/fr.json` keys against `i18n/en.json` | absent (no `i18n/`) / present / non-conforming / could-not-judge |
|
|
283
|
+
| **DExt1** identifier | E-1 | the reverse-DNS `identifier` in `extension.json` and TS factories, and vendor host-key namespaces against the registry | absent (no identifier declared) / present / non-conforming / could-not-judge |
|
|
284
|
+
| **DExt2** graceful-degradation | E-2 | `graceful_degradation` in `extension.json` and `gracefulDegradation` in `defineExtension` | absent (no flag found) / present / non-conforming / could-not-judge |
|
|
285
|
+
| **DExt3** single-type | E-3 | the extension `type` in `extension.json` and `defineExtension`: exactly one known category | absent (no type declared) / present / non-conforming / could-not-judge |
|
|
286
|
+
| **DExt4** lifecycle-hooks | E-4 | the manifest `lifecycle` hooks against their implementations (`hooks/` files, factory hooks) | absent (no hook declared) / present / non-conforming / could-not-judge |
|
|
287
|
+
| **DExt5** bilingual | C-1 | `description_fr` and `README.fr.md` beside each `extension.json`, and per-tool `description_fr` | absent (no manifest, or an FR piece missing) / present / could-not-judge |
|
|
288
|
+
| **DExt7** eval-coverage | C-5 | each extension's `evals/evals.json`: >=3 cases including an "extension absente" case | absent (no manifest) / present / non-conforming / could-not-judge |
|
|
289
|
+
| **DExt8** semver+changelog | C-3 | each extension's `package.json` `version` against strict SemVer, and `CHANGELOG.md` beside it | absent (no manifest, or no `CHANGELOG.md`) / present / non-conforming / could-not-judge |
|
|
290
|
+
| **DExt9** hook-timeout | E-6 | each declared lifecycle hook's timeout guard (manifest `timeouts.<hook>` or in its implementation) | absent (no hook declared) / present / non-conforming / could-not-judge |
|
|
291
|
+
| **S42** write-read-claims | S-42 | the verified claims each write tool forwards to its backend door against those of the read tools on the same table | absent (no backend door call) / present / non-conforming / could-not-judge |
|
|
292
|
+
| **S44** closed-output | S-44 | every object of each tool's output schema closed to added fields (`.strict()`, `additionalProperties: false`, ...) | absent (no tool) / present / non-conforming / could-not-judge |
|
|
293
|
+
| **S35** scope-in-read | S-35 | each `<client>.query\|action(<door>, <args>)` and, in the same block, a narrowing of what it returned (`scopeFilterList`, `scopeFilterGet`, a `.filter` on an organisation / namespace / recipient / owner field or the caller context, a skipping branch in a loop) | absent / present / non-conforming / could-not-judge (door named by an expression) |
|
|
294
|
+
| **S36** upstream-credential | S-36 | the `client_credentials` grant, where the token source is built, its cache and expiry, the 401 path, the tenancy key, secrets near logs, errors and results | absent (no outbound call, no token source) / present / non-conforming / could-not-judge (unread source) |
|
|
295
|
+
| **S37** upstream-settings | S-37 | environment reads against the declared variables, literal upstream addresses, URL variables, secret flags, defaults on required variables | absent (no outbound call, token source, `upstreams` declaration or `defineVariables`) / present / non-conforming / could-not-judge (unread source) |
|
|
296
|
+
| **S38** bounded-upstream-call | S-38 | page walks and their ceiling, page size, cursor wrapping, retry bounds and `Retry-After`, the origin check, redirect options | absent (no upstream call to bound) / present / non-conforming / could-not-judge (unread source) |
|
|
297
|
+
| **S39** upstream-error | S-39 | time budgets, `isError` results and what is interpolated into them, catch sites, empty-success fallbacks | absent (no outbound call) / present / non-conforming / could-not-judge (unread source) |
|
|
298
|
+
| **S40** upstream-rows-narrowed | S-40 | how the person is resolved, the package narrowing, the refusal paths; each tool serving upstream rows is listed as an owed human verdict (C-23) | absent (no tool serves upstream rows) / non-conforming / could-not-judge, with an owed human verdict (C-23) per tool serving upstream rows |
|
|
299
|
+
| **S41** lake-reader | S-41 | the reader interface, the kind of each store call, the page check, the upstream reached only on a lake miss | absent (no data-lake reader) / present / non-conforming / could-not-judge (unread source) |
|
|
300
|
+
| **C36** readme-npm-limit | C-36 | the size of every root `readme*` file a published package ships, against the npm truncation point | absent (not published) / present / non-conforming / could-not-judge (package.json, the package root or a README that cannot be read) |
|
|
301
|
+
|
|
161
302
|
### Detectors added in 0.7.0 (standard `b714129a`, ElPi-Corp #243)
|
|
162
303
|
|
|
163
304
|
One detector per rule that #243 added, plus the S-5 elements (f)..(l), each implementing the
|
|
@@ -224,6 +365,257 @@ an error message) it counts only as code or as a quoted property key.
|
|
|
224
365
|
| **A4** wcag-axe-gate | A-4 | an axe dependency and a script, workflow or test that runs it | absent / non-conforming / could-not-judge (0 blocking violations is the owed gate) |
|
|
225
366
|
| **A5** performance-budgets | A-5 | gzipped size of the UI bundle files (`dist/` and `build/` read for size only): one file or one directory over 250 KB | absent / non-conforming / could-not-judge (render, roundtrip, memory probes owed) |
|
|
226
367
|
|
|
368
|
+
### Added in 0.17.0 — the host distribution rules (mission k578mxdd9e3zx89hbn8njf0rfs8hcxf4)
|
|
369
|
+
|
|
370
|
+
| ID | Rule | The static run reads | Verdicts |
|
|
371
|
+
|----|------|----------------------|----------|
|
|
372
|
+
| **S45** origin-targets | S-45 | `mcp-server.json` `distribution.targets`, the public origin (manifest URL or `PUBLIC_BASE_URL`), the Streamable HTTP route, each declared host's verification path and where its value comes from | absent (no target declared) / present / non-conforming / could-not-judge (a development default alone) |
|
|
373
|
+
| **S46** registration-redirects | S-46 | CIMD and DCR offered together, each declared host's redirect in the allow-list; served half: the registration and authorize endpoints | absent / present / non-conforming / could-not-judge |
|
|
374
|
+
| **S47** webhook-delivery | S-47 | events served, the outbound call whose target is the subscriber callback, its Standard Webhooks signature headers, the callback verification | absent (no events) / present / non-conforming / could-not-judge |
|
|
375
|
+
| **S48** per-member | S-48 | the request path of a force-installed member: no shared-credential fallback, a 401 challenge for a member without a credential | absent (no person signs in) / present / non-conforming / could-not-judge |
|
|
376
|
+
| **C34** plugin-families | C-34 | each Agent Plugins, Claude or Cursor plugin file, the script that writes it, and its `--check` drift refusal | absent (no plugin family) / present / non-conforming / could-not-judge |
|
|
377
|
+
| **C35** listing-kit | C-35 | `listing/listing.json`: description, tools, test prompts and reviewer note against their sources; served half: titles and hints against the served `tools/list` | absent (not listed) / present / non-conforming / could-not-judge |
|
|
378
|
+
|
|
379
|
+
### Added in 0.18.0 — agent tool roles (standard `1c66e11c`, mcp-server-standard "Agent tool roles", unnumbered)
|
|
380
|
+
|
|
381
|
+
The section carries no rule id, so the detector declares `noNumberedRule` and the id has no number. It reads rule 7, the checks the section assigns to mcp-doctor.
|
|
382
|
+
|
|
383
|
+
| ID | Rule | The static run reads | Verdicts |
|
|
384
|
+
|----|------|----------------------|----------|
|
|
385
|
+
| **DToolRoles** tool-roles | "Agent tool roles" rule 7 (unnumbered) | on a tree with an authenticated tier (a calling agent; otherwise the section does not apply): each registered tool's `domain` and `mode` in its `annotations` and its `_meta` (neither, a conflict, a mode other than `read` / `write`, or `read` without `readOnlyHint: true` is red); `decideToolRole` / `filterGrantedTools` from `@vantageos/cloud-identity` called by the `registerTool` wrapper or `tools/call` handler and by a `tools/list` handler, every registration after the gate is installed, and no tool exempt from the gate but the identity tool (C-33) | absent (no tool, or no authenticated tier) / non-conforming / could-not-judge — including when the static half holds, because rule 7 says a run with no role fixture (grants nothing / read-only / full grant) is never a green |
|
|
386
|
+
|
|
387
|
+
### Added in 0.18.0 — events-ready probe (S-29 to S-33, dynamic)
|
|
388
|
+
|
|
389
|
+
The static S-29..S-33 detectors read what the code must carry and leave the behaviour owed. `--url URL
|
|
390
|
+
--events-ready` runs that behaviour against the live server, the way an events host does: `server/discover`
|
|
391
|
+
(else `initialize`), `events/list`, `events/subscribe`, callback verification, signed delivery,
|
|
392
|
+
`events/unsubscribe`. The probe starts its own HTTPS receiver (a self-signed certificate generated in memory at
|
|
393
|
+
run time; no key is stored) and a loopback SSRF canary. Signatures are checked with `standardwebhooks` on the raw
|
|
394
|
+
bytes received. It prints ten rows and runs nothing else; the exit code follows the usual convention.
|
|
395
|
+
|
|
396
|
+
```bash
|
|
397
|
+
mcp-doctor --url https://mcp.example.com/mcp --bearer-env MCP_TOKEN --events-ready \
|
|
398
|
+
--events-callback-base https://abc123.tunnel.example --events-receiver-port 8443 \
|
|
399
|
+
--events-trigger create_item --events-trigger-args '{"title":"probe"}' \
|
|
400
|
+
--events-name item.created --events-args '{"project":"alpha","kind":"note"}'
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
| ID | Rule | What the probe does | Red when |
|
|
404
|
+
|----|------|---------------------|----------|
|
|
405
|
+
| `ER-a` events-declared | S-29 | reads `capabilities.events`, calls the three methods | declared and a method answers -32601, or not declared and a method answers |
|
|
406
|
+
| `ER-b` unauth-subscribe | S-31 | subscribes with none of the caller's headers or URL query | anything but -32012, or the callback is contacted first |
|
|
407
|
+
| `ER-c` subscribe-params | S-31 | an `http:` callback; secrets of 8 bytes and without `whsec_` | not -32602 (a -32015 on the `http:` URL means it was tried) |
|
|
408
|
+
| `ER-d` subscription-id | S-31 | subscribes twice, `arguments` keys in reverse order | the two ids differ |
|
|
409
|
+
| `ER-e` callback-verify | S-32 | reads the first envelope; a receiver that answers 200 without the challenge | envelope unsigned or without challenge/`webhook-id`, a challenge reused, the non-echoing receiver accepted, a -32015 without a categorical `data.reason` or carrying the receiver's body, an event reaching it |
|
|
410
|
+
| `ER-f` no-data-first | S-32 | the order of POSTs on every callback | an event before the verification envelope |
|
|
411
|
+
| `ER-g` signed-delivery | S-33 | every delivery; a receiver that answers 500 once | a header missing, `webhook-id` ≠ `eventId`, a signature that does not verify, a body over 262144 bytes, a retry with the same timestamp or signature or a new `eventId` |
|
|
412
|
+
| `ER-h` no-replay-410-413 | S-33 | receivers answering 410 and 413 | an event delivered twice to either |
|
|
413
|
+
| `ER-i` ssrf-refused | S-32 (callback rules) | callbacks to `127.0.0.1`, `localhost`, `2130706433` on the canary port | accepted, -32015 (a connection was attempted), or the canary is hit |
|
|
414
|
+
| `ER-j` no-redirect | S-32 (callback rules) | a receiver answering 307 to another path | the redirect target receives anything |
|
|
415
|
+
|
|
416
|
+
Could-not-judge, always named, never a pass:
|
|
417
|
+
|
|
418
|
+
- **No public callback** (`--events-callback-base`): a server that refuses a loopback callback cannot reach the
|
|
419
|
+
receiver, so ER-c's secret half, ER-d, ER-e, ER-f, ER-g, ER-h and ER-j are could-not-judge. The base must
|
|
420
|
+
forward to `--events-receiver-port` on the machine running the probe.
|
|
421
|
+
- **No trigger** (`--events-trigger`): the protocol has no method that causes an event, so ER-g, ER-h and the
|
|
422
|
+
"no event after a failed verification" half of ER-e are could-not-judge.
|
|
423
|
+
- **Fewer than two argument keys** (`--events-args`): ER-d has no key order to permute.
|
|
424
|
+
- **No retry within `--events-observe-ms`** (default 5000): the retry half of ER-g. "Never redelivered" (ER-h) is
|
|
425
|
+
judged within that window only.
|
|
426
|
+
- **HTTP 401/403 before JSON-RPC** on the unauthenticated call: what `events/subscribe` itself answers is not
|
|
427
|
+
observable (ER-b).
|
|
428
|
+
- **The conforming receiver refused**: the receiver echoes `{"challenge": "<value>"}` with HTTP 200; a server
|
|
429
|
+
that reads another echo form leaves ER-e could-not-judge, naming the answer.
|
|
430
|
+
|
|
431
|
+
Not probed: `data` against `payloadSchema` (S-33), another principal and restart survival (S-31), descriptors
|
|
432
|
+
(S-30), access recheck (S-34). The SSRF canary listens on the probe's own loopback, so a hit is seen only for a
|
|
433
|
+
server on the same host; for a remote server the answer decides (-32602 passes, -32015 or a result is red).
|
|
434
|
+
|
|
435
|
+
### Changes in 0.18.0 — the report states what it read; DServer14 reads the challenge where it is set
|
|
436
|
+
|
|
437
|
+
#### The report states how many source files and registered tools it read
|
|
438
|
+
|
|
439
|
+
A `coverage:` line now follows `surface:` in the table, and a `coverage` object is in the `--json` report.
|
|
440
|
+
It gives the number of source files the scan read (the same files every detector reads: `.ts`/`.tsx`, without
|
|
441
|
+
`.d.ts` and `.test.ts`, outside the skipped directories). It also gives the number of registered tools the
|
|
442
|
+
shared tool reader read (the reader D8 and the per-tool rules use). Product-looking files the scan does not read
|
|
443
|
+
(`.js`, `.mjs`...) are counted and named on the same line. So are registration sites whose tool name could not
|
|
444
|
+
be read. When no tool could be read on a tree that serves tools (an SDK-first server with computed names, or a
|
|
445
|
+
tool surface with no located registration), the line says `registered tools: NOT READ — <why>`. It never prints
|
|
446
|
+
0 as if it counted. `0 registered tools read` appears only when the tree has no tool surface. Under `--url`
|
|
447
|
+
the line says no source tree was read. In JSON, `coverage.tools` is `{ read, unresolvedSites }` or
|
|
448
|
+
`{ unreadable }`.
|
|
449
|
+
|
|
450
|
+
#### DServer14 reads the 401 challenge where the header is set
|
|
451
|
+
|
|
452
|
+
Element 1 (the `401` + `WWW-Authenticate: Bearer … resource_metadata=…` challenge) used to be four tokens found
|
|
453
|
+
anywhere in the tree. It stayed present when every line that sets the header was commented out: the tokens
|
|
454
|
+
were still in an unused constant, in other 401 responses, and in the token endpoint's `Basic` challenge. It is
|
|
455
|
+
now present only when one live site sets the header to a Bearer challenge carrying `resource_metadata=`, with
|
|
456
|
+
a `401` in the same block within a few lines (6 before, 8 after).
|
|
457
|
+
|
|
458
|
+
The value is read at the site: a string or template literal, or an identifier bound once in the same file to
|
|
459
|
+
one (`const wwwAuthHeader = \`Bearer resource_metadata=…\`` then `c.header("WWW-Authenticate", wwwAuthHeader)`).
|
|
460
|
+
The set forms read are `.header(name, v)` (Hono, Express), `.set` / `.append` (Fetch `Headers`, Express),
|
|
461
|
+
`.setHeader` / `.appendHeader` (Node), a `"WWW-Authenticate": v` key in a headers object (Response init,
|
|
462
|
+
`writeHead`, `c.text(body, status, headers)`), a `["WWW-Authenticate", v]` tuple, and `headers["WWW-Authenticate"] = v`.
|
|
463
|
+
A `Basic` or other non-Bearer challenge is not Element 1. Reads (`.get`, a one-argument `.header(name)`, a
|
|
464
|
+
subscript read) and CORS header-name lists are not set sites.
|
|
465
|
+
|
|
466
|
+
The rule is could-not-judge, naming the site, in two cases. One: the header name sits anywhere else, such
|
|
467
|
+
as a constant holding the name or a helper taking it as an argument. Two: no site qualifies and a set
|
|
468
|
+
site's value cannot be read (a call, an imported identifier, several bindings). A challenge delegated to
|
|
469
|
+
`@vantageos/cloud-identity` and forwarded is read as before. The non-conforming verdict lists every
|
|
470
|
+
header-set site read and why it did not count.
|
|
471
|
+
|
|
472
|
+
### Changes in 0.17.0 — S-47 (standard `1c66e11c` = mcp-server-standard v2.11, PR #311)
|
|
473
|
+
|
|
474
|
+
#### S-47 reports a server whose events are not delivered by signed webhook
|
|
475
|
+
|
|
476
|
+
S-47 applies to a server that serves events (the same reading as S-29). Every host that documents MCP events takes
|
|
477
|
+
webhook delivery only, so S-47 checks three things in the tree:
|
|
478
|
+
|
|
479
|
+
- **Delivery:** an outbound call (`fetch`, `request`, `.post`, `http(s).request`) in a file that reads the
|
|
480
|
+
subscriber's callback URL (`callbackUrl`, `callback_url`, `webhookUrl`, `webhook_url`, or a `url` / `uri` / `href` /
|
|
481
|
+
`endpoint` member of a subscription, subscriber, delivery, callback, webhook or target object). None at all means
|
|
482
|
+
events are reachable only by polling or streaming: red.
|
|
483
|
+
- **Signature:** the three Standard Webhooks headers `webhook-id`, `webhook-timestamp`, `webhook-signature`, read on
|
|
484
|
+
each call whose target is the subscriber callback (directly, or a variable assigned from it): an object key in the
|
|
485
|
+
call's options, or an options / headers object it is passed (by name, `headers: h`, or `{ headers }`) that holds the
|
|
486
|
+
key or receives `.set` / `.append`, or an options object it spreads (`{ ...opts, method: "POST" }`, followed up to
|
|
487
|
+
three levels). The options are read in source order and the last write wins: a `headers` key after a signed spread
|
|
488
|
+
replaces it. Headers on another call, a docs constant or another function sign nothing; a spread or headers value
|
|
489
|
+
the reader cannot follow is could-not-judge, named; the least-signed callback call is the one judged. Each missing one is named, red. (S-33 checks the
|
|
490
|
+
full delivery contract.)
|
|
491
|
+
- **Verification:** the callback is verified before the first delivery: an envelope `type: "verification"` carrying
|
|
492
|
+
a `challenge`, in a function that sends it to the subscriber. Missing: red.
|
|
493
|
+
|
|
494
|
+
An outbound call in a file where no callback URL is recognised is could-not-judge, naming the call. An imported events
|
|
495
|
+
package may deliver from outside the tree: could-not-judge, naming it.
|
|
496
|
+
### Changes in 0.17.0 — S-48 (standard `1c66e11c` = mcp-server-standard v2.11, PR #311)
|
|
497
|
+
|
|
498
|
+
#### S-48 reports a server that serves a member without their own sign-in
|
|
499
|
+
|
|
500
|
+
S-48 applies to a server that authenticates people (an authorization server in its tree or installed). An
|
|
501
|
+
administrator may install it for every member (Claude Required, Cursor Required, a ChatGPT workspace), so a member can
|
|
502
|
+
arrive without ever having connected. S-48 checks two things in the product source:
|
|
503
|
+
|
|
504
|
+
- **No shared fallback:** a shared credential (an environment value, a config field or a constant whose name carries
|
|
505
|
+
token, key, secret, bearer, credential or password) used as a fallback in any form — `a ?? S`, `a || S`, `??=`,
|
|
506
|
+
`||=`, a ternary, a destructuring default `{ token = S } = …`, a parameter default, `if (!a) a = …S…` — is red,
|
|
507
|
+
naming the line, whatever the left side is called. `port ?? process.env.PORT` is not (PORT is no credential), nor a
|
|
508
|
+
credential-named value that is called (`TOKEN_RE.test(x)`). The words in a string or a comment count for nothing.
|
|
509
|
+
- **A coded refusal:** a member who arrives with no credential receives a 401 with a `WWW-Authenticate` challenge,
|
|
510
|
+
set in code. Missing: red; missing while the authorization server comes from a dependency (which may send it):
|
|
511
|
+
could-not-judge, naming the package.
|
|
512
|
+
|
|
513
|
+
Whether every read then stays scoped to the member is S-5, S-35 and S-28.
|
|
514
|
+
|
|
515
|
+
### Changes in 0.17.0 — C-29 amended (standard `1c66e11c` = mcp-standard v2.8, PR #311)
|
|
516
|
+
|
|
517
|
+
#### C-29 reports a plugin package that does not ship the served skills
|
|
518
|
+
|
|
519
|
+
No host loads skills served over MCP; every host receives them inside a plugin package. So when an object declares
|
|
520
|
+
the `io.modelcontextprotocol/skills` extension and publishes plugin packages (a folder holding
|
|
521
|
+
`.claude-plugin/plugin.json`, `.cursor-plugin/plugin.json`, or an Agent Plugins `plugin.json`), each package must
|
|
522
|
+
carry `skills/<name>/` for every skill in the tree, the whole folder byte-equal to the served copy: `SKILL.md` and
|
|
523
|
+
every file beside it (`references/`, `scripts/`, assets). A missing skill, or a file missing, differing or extra in
|
|
524
|
+
the copy, is red and named; a file that cannot be read, or a folder that cannot be listed, on either side is
|
|
525
|
+
could-not-judge, named, and is never counted as missing, extra or different; a `SKILL.md` is called missing only
|
|
526
|
+
when the folder above it can be listed. A package at the repository root whose `skills/` is the
|
|
527
|
+
served folder satisfies it as is.
|
|
528
|
+
### Changes in 0.17.0 — C-34 (standard `1c66e11c` = mcp-standard v2.8, PR #311)
|
|
529
|
+
|
|
530
|
+
#### C-34 reports a plugin family that is not generated from one source
|
|
531
|
+
|
|
532
|
+
C-34 applies when the repository ships plugin files: the Agent Plugins shape (`plugin.json` + `mcp.json`), the
|
|
533
|
+
Claude plugin (`.claude-plugin/plugin.json` + `.mcp.json`) or the Cursor plugin (`.cursor-plugin/plugin.json`). For
|
|
534
|
+
each file present it checks:
|
|
535
|
+
|
|
536
|
+
- **Generated:** a repository script WRITES the file: a `writeFile` whose path names it (its literal, or the join form
|
|
537
|
+
`".claude-plugin", "plugin.json"`), directly or through a `const` bound to that literal or to a join naming it, or
|
|
538
|
+
a write of each key of an object holding the file paths. A script that only
|
|
539
|
+
reads the file (a linter writing a report) is no generator. A file no script writes is hand-edited, and red; a write
|
|
540
|
+
of a path the reader cannot tie to the file is could-not-judge.
|
|
541
|
+
- **Drift-checked:** a test imports that generator (in `tests/`, `test/` or a colocated `*.test.*`), or a
|
|
542
|
+
`package.json` script or CI workflow runs it with `--check`. None: red.
|
|
543
|
+
- **No credential:** the C-31 credential shapes over each file. Any hit is red.
|
|
544
|
+
|
|
545
|
+
A root `mcp.json` alone is the object's own manifest (C-18) and is not a plugin file; it joins the Agent Plugins
|
|
546
|
+
family only beside a `plugin.json`. A family file that cannot be read, or a `package.json` that cannot be parsed while
|
|
547
|
+
the drift check is looked for, is could-not-judge, naming it. Whether a family is missing for a declared target host
|
|
548
|
+
is not decided here.
|
|
549
|
+
|
|
550
|
+
### Changes in 0.17.0 — C-35 (standard `65e1ac7e` = mcp-standard v2.10, PRs #315 / #318)
|
|
551
|
+
|
|
552
|
+
#### C-35 reports a directory listing kit that is typed rather than derived from the server
|
|
553
|
+
|
|
554
|
+
C-35 applies when the object is listed in a directory: a `listing/listing.json`, or a plugin family (C-34). A plugin
|
|
555
|
+
family with no kit is red. The kit's fields are each compared to their source:
|
|
556
|
+
|
|
557
|
+
- **description:** equal to the `description` of a generated plugin manifest (the source the manifests come from).
|
|
558
|
+
- **tools[]:** one entry per registered tool, no more, no fewer. Each entry's `title`, `readOnlyHint` and
|
|
559
|
+
`destructiveHint` are compared to the literals written at the registration; a value held in a constant is decided
|
|
560
|
+
by the served half (`--mode=both`, or `--url` with `--source`), which compares every entry to the served
|
|
561
|
+
`tools/list`.
|
|
562
|
+
- **testPrompts:** `source` is `evals/evals.json`, at least 5 positive and 3 negative ids, each an eval id of the suite.
|
|
563
|
+
- **reviewerAccount:** `howToObtain` only; a credential shape or any other key is red.
|
|
564
|
+
|
|
565
|
+
A kit that cannot be read, or a source that cannot be resolved, is could-not-judge, naming it.
|
|
566
|
+
|
|
567
|
+
### Changes in 0.17.0 — S-46 (standard `1c66e11c` = mcp-server-standard v2.11, PR #311)
|
|
568
|
+
|
|
569
|
+
#### S-46 reports a server that offers only one client registration method, and names each declared host's redirect
|
|
570
|
+
|
|
571
|
+
S-46 applies to a server that declares target hosts (`distribution.targets`, read by the same reader as S-45) and runs
|
|
572
|
+
an authorization server, either in its tree or installed from a dependency.
|
|
573
|
+
|
|
574
|
+
- **Registration:** both methods are required. CIMD needs `client_id_metadata_document_supported: true`; DCR needs a
|
|
575
|
+
`registration_endpoint` or a `/register` route. Each is read in the tree or in the installed authorization server,
|
|
576
|
+
and a missing one is red, named. A setting counts only where it is declared: the property's `:` or the route call's
|
|
577
|
+
`(` must be code, so the same words inside a string (an error message quoting the flag) or a comment do not count.
|
|
578
|
+
A `/register` literal outside a route call (a loop over proxied prefixes) is named, and DCR is not decided on it.
|
|
579
|
+
- **Redirects:** acceptance of each declared host's stated callback is checked (claude:
|
|
580
|
+
`https://claude.ai/api/mcp/auth_callback`; vscode: `http://127.0.0.1:33418` and `https://vscode.dev/redirect`;
|
|
581
|
+
claude-code: a loopback redirect on any port). Whether the authorization server accepts them, a loopback on any port
|
|
582
|
+
in particular, is decided by the served server, so this static half reads could-not-judge for those hosts and says
|
|
583
|
+
so. A host whose callback the standard does not state (chatgpt, cursor, openclaw, hermes, gemini,
|
|
584
|
+
google-connected-apps) is could-not-judge, named.
|
|
585
|
+
- **Served half (`--url URL --source DIR`):** the doctor reads the served authorization-server metadata (both
|
|
586
|
+
methods must be announced there) and, for a declared host whose client document is known (today: VS Code's,
|
|
587
|
+
`https://vscode.dev/oauth/client-metadata.json`), starts one sign-in per redirect URI that document lists. A
|
|
588
|
+
redirect back to the redirect URI (even with `error=`, which an authorization server only sends to a URI it
|
|
589
|
+
accepted), or onward to a sign-in step (a path naming sign-in, login, consent, authorize, sso), is accepted; a 4xx,
|
|
590
|
+
or a redirect elsewhere carrying `error=`, is refused and quoted. A 200 page, or any other redirect, is no evidence
|
|
591
|
+
either way (an authorization server may show its refusal as a page): could-not-judge, naming it. No credential is sent, only the
|
|
592
|
+
endpoint's own origin is requested, and the answer is never followed. These reads are public, so they are made
|
|
593
|
+
even when the MCP endpoint refuses the handshake without a token (401), and the verdict says so. Claude and
|
|
594
|
+
Claude Code publish no client document the doctor can sign in as: could-not-judge, named. The declared targets
|
|
595
|
+
come from `--source`; without it, could-not-judge.
|
|
596
|
+
|
|
597
|
+
### Changes in 0.17.0 — S-45 (standard `1c66e11c` = mcp-server-standard v2.11, PR #311, the declared target hosts)
|
|
598
|
+
|
|
599
|
+
#### S-45 reports a distributed server on a platform host, with no Streamable HTTP route, or without a declared host's verification path
|
|
600
|
+
|
|
601
|
+
S-45 applies to a server that declares the hosts it targets, in `mcp-server.json` `distribution.targets` (a closed set:
|
|
602
|
+
`chatgpt`, `google-connected-apps`, `gemini`, `claude`, `claude-code`, `cursor`, `vscode`, `openclaw`, `hermes`).
|
|
603
|
+
A server that declares none reads absent, and the verdict says so.
|
|
604
|
+
|
|
605
|
+
- **Origin:** every declared public URL is read: the manifest's `remotes[].url`, `url` and
|
|
606
|
+
`transport.streamableHttp.url`, a literal default of `PUBLIC_BASE_URL` in source, and `PUBLIC_BASE_URL=` in
|
|
607
|
+
`.env.example`. A host under a platform default domain is red: the 3449 rules of the Public Suffix List's private
|
|
608
|
+
section (Railway, Vercel, ngrok, Cloudflare tunnels, GitHub Pages, App Engine...), generated into the package by
|
|
609
|
+
`scripts/regen-psl-private.ts`, wildcards included. A default built by an
|
|
610
|
+
expression, or no URL declared at all, is could-not-judge. A loopback default (`localhost`, `127.0.0.0/8`, `::1`,
|
|
611
|
+
`0.0.0.0`) is a development address, not a public origin: alone it is could-not-judge ("only a development
|
|
612
|
+
default"), beside a public URL the public URL decides.
|
|
613
|
+
- **Transport:** a Streamable HTTP server transport (the S-22 forms, or the boilerplate's `buildHttpApp(`), or the
|
|
614
|
+
manifest's `transport.streamableHttp`. None is red.
|
|
615
|
+
- **Verification paths:** `chatgpt` needs `/.well-known/openai-apps-challenge` and `google-connected-apps` needs
|
|
616
|
+
`/.well-known/google-connected-apps`. The route must read its token from configuration. A literal token in source is
|
|
617
|
+
red, even as the fallback of a configuration read (`settings.x ?? "tok_..."`), and so is a missing route. An unknown host id is could-not-judge, named.
|
|
618
|
+
|
|
227
619
|
### Changes in 0.16.0 — S-28 follows resource read handlers and injected fetchers (standard `6870b775` = mcp-server-standard v2.10, PR #310)
|
|
228
620
|
|
|
229
621
|
#### S-28 follows a fetcher handed to other code to where its door is named
|
|
@@ -269,6 +661,10 @@ the table each door writes and reads. It names each write that lacks a claim for
|
|
|
269
661
|
|
|
270
662
|
### Changes in 0.16.0 — distribution rules (standard `4ec4826b` = mcp-server-standard v2.9, mcp-standard v2.8)
|
|
271
663
|
|
|
664
|
+
| ID | Rule | The static run reads | Verdicts |
|
|
665
|
+
|----|------|----------------------|----------|
|
|
666
|
+
| **C36** readme-npm-limit | C-36 | the size of every root `readme*` file a published package ships, against the npm truncation point | absent (not published) / present / non-conforming / could-not-judge (package.json, the package root or a README that cannot be read) |
|
|
667
|
+
|
|
272
668
|
#### C-36 reports a README past the npm truncation point
|
|
273
669
|
|
|
274
670
|
npm truncates a package README at 65 536 bytes, so everything past that point is missing from the package page.
|