@kya-os/mcp 1.18.0 → 1.21.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.
Files changed (80) hide show
  1. package/CHANGELOG.md +377 -0
  2. package/CONFORMANCE.md +10 -4
  3. package/README.md +58 -1
  4. package/SPEC.md +37 -3
  5. package/dist/card/cimd.js +6 -2
  6. package/dist/card/cimd.js.map +1 -1
  7. package/dist/card/index.d.ts +1 -0
  8. package/dist/card/index.js +1 -0
  9. package/dist/card/index.js.map +1 -1
  10. package/dist/card/revocation.d.ts +21 -10
  11. package/dist/card/revocation.js +12 -16
  12. package/dist/card/revocation.js.map +1 -1
  13. package/dist/card/status-list-proof.d.ts +32 -0
  14. package/dist/card/status-list-proof.js +102 -0
  15. package/dist/card/status-list-proof.js.map +1 -0
  16. package/dist/delegation/bitstring.d.ts +41 -6
  17. package/dist/delegation/bitstring.js +36 -21
  18. package/dist/delegation/bitstring.js.map +1 -1
  19. package/dist/delegation/index.d.ts +1 -0
  20. package/dist/delegation/index.js +1 -0
  21. package/dist/delegation/index.js.map +1 -1
  22. package/dist/delegation/statuslist-manager.d.ts +20 -4
  23. package/dist/delegation/statuslist-manager.js +16 -0
  24. package/dist/delegation/statuslist-manager.js.map +1 -1
  25. package/dist/delegation/verification-method-key.d.ts +4 -1
  26. package/dist/delegation/verification-method-key.js.map +1 -1
  27. package/dist/index.d.ts +2 -1
  28. package/dist/index.js +2 -1
  29. package/dist/index.js.map +1 -1
  30. package/dist/middleware/index.d.ts +3 -1
  31. package/dist/middleware/index.js +2 -0
  32. package/dist/middleware/index.js.map +1 -1
  33. package/dist/middleware/kya-os-transport.d.ts +43 -12
  34. package/dist/middleware/kya-os-transport.js +151 -28
  35. package/dist/middleware/kya-os-transport.js.map +1 -1
  36. package/dist/middleware/mcp-tool-callback.d.ts +48 -0
  37. package/dist/middleware/mcp-tool-callback.js +38 -0
  38. package/dist/middleware/mcp-tool-callback.js.map +1 -0
  39. package/dist/middleware/serve-in-process.d.ts +41 -0
  40. package/dist/middleware/serve-in-process.js +86 -0
  41. package/dist/middleware/serve-in-process.js.map +1 -0
  42. package/dist/middleware/with-kya-os-server.d.ts +14 -3
  43. package/dist/middleware/with-kya-os-server.js +4 -1
  44. package/dist/middleware/with-kya-os-server.js.map +1 -1
  45. package/dist/middleware/with-kya-os.config-types.d.ts +24 -0
  46. package/dist/middleware/with-kya-os.d.ts +4 -0
  47. package/dist/middleware/with-kya-os.delegation-gate.d.ts +2 -1
  48. package/dist/middleware/with-kya-os.delegation-gate.js +12 -18
  49. package/dist/middleware/with-kya-os.delegation-gate.js.map +1 -1
  50. package/dist/middleware/with-kya-os.delegation-verify.d.ts +7 -12
  51. package/dist/middleware/with-kya-os.delegation-verify.js +37 -9
  52. package/dist/middleware/with-kya-os.delegation-verify.js.map +1 -1
  53. package/dist/middleware/with-kya-os.deps.d.ts +15 -4
  54. package/dist/middleware/with-kya-os.helpers.d.ts +5 -0
  55. package/dist/middleware/with-kya-os.helpers.js +13 -0
  56. package/dist/middleware/with-kya-os.helpers.js.map +1 -1
  57. package/dist/middleware/with-kya-os.js +23 -0
  58. package/dist/middleware/with-kya-os.js.map +1 -1
  59. package/dist/middleware/with-kya-os.outcome.d.ts +18 -0
  60. package/dist/middleware/with-kya-os.outcome.js +36 -0
  61. package/dist/middleware/with-kya-os.outcome.js.map +1 -0
  62. package/dist/middleware/with-kya-os.policy-gate.d.ts +2 -1
  63. package/dist/middleware/with-kya-os.policy-gate.js +2 -1
  64. package/dist/middleware/with-kya-os.policy-gate.js.map +1 -1
  65. package/dist/middleware/with-kya-os.session.d.ts +76 -10
  66. package/dist/middleware/with-kya-os.session.js +739 -164
  67. package/dist/middleware/with-kya-os.session.js.map +1 -1
  68. package/dist/middleware/with-kya-os.types.d.ts +102 -8
  69. package/dist/proof/generator.d.ts +13 -0
  70. package/dist/proof/generator.js +15 -0
  71. package/dist/proof/generator.js.map +1 -1
  72. package/dist/proof/verifier.js +14 -9
  73. package/dist/proof/verifier.js.map +1 -1
  74. package/dist/utils/statuslist-bits.d.ts +15 -0
  75. package/dist/utils/statuslist-bits.js +44 -6
  76. package/dist/utils/statuslist-bits.js.map +1 -1
  77. package/dist/utils/statuslist-gzip.d.ts +18 -0
  78. package/dist/utils/statuslist-gzip.js +45 -0
  79. package/dist/utils/statuslist-gzip.js.map +1 -0
  80. package/package.json +3 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,383 @@ Versioning: https://semver.org/spec/v2.0.0.html
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.21.0] - 2026-10-21
11
+
12
+ ### Upgrading
13
+
14
+ - **A status-list manager given a compressor that does not GZIP now throws
15
+ instead of publishing.** Status-list readers accept only GZIP, so such a
16
+ list read as revoked for every credential it covered. A decompressor that
17
+ hands back its input unchanged now makes every read throw, where it read
18
+ the GZIP header as status bits. Drop the compressor and decompressor
19
+ arguments to use the shipped codec, or pass `statusListGzipCodec`. A list
20
+ already stored without GZIP, such as one published with the pass-through
21
+ pair the status-list example used, can no longer be read or updated:
22
+ reissue it, and the credentials it covers, with the codec.
23
+
24
+ ### Added
25
+
26
+ - **`statusListGzipCodec`, a GZIP codec for status lists.** One object is
27
+ both the `CompressionFunction` and the `DecompressionFunction` that
28
+ `StatusList2021Manager` and `BitstringManager` take. It loads `node:zlib`
29
+ on first use, so a bundle that injects its own codec does not pull it in,
30
+ and bounds inflation to the 16 MiB status-list cap. The Entity Card
31
+ revocation checker uses it as its default `decompress`.
32
+ - **The compressor and decompressor of `StatusList2021Manager`,
33
+ `createStatusListManager`, `BitstringManager` (its constructor, `decode`
34
+ and `fromSetBits`) and `isIndexSet` are optional** and default to
35
+ `statusListGzipCodec`.
36
+
37
+ ### Fixed
38
+
39
+ - **`StatusList2021Manager` could publish status lists that every other
40
+ reader took as revoked.** The manager required a compressor and
41
+ decompressor, the package shipped none, and its example passed a pair that
42
+ did not compress, so the lists it published were not GZIP and the Entity
43
+ Card revocation checker reported every entry revoked. Publishing now
44
+ refuses a list that is not GZIP, and the example uses the shipped codec.
45
+ - **A pass-through decompressor read revoked entries as live.** Reading a
46
+ GZIP list without inflating it took the GZIP header as status bits, which
47
+ left the first three entries clear whatever the issuer had set. Reading a
48
+ payload that is not GZIP, or one the decompressor returns unchanged, now
49
+ throws, on the delegation and Entity Card paths alike. Fixes #254.
50
+
51
+ ## [1.20.0] - 2026-10-13
52
+
53
+ 1.19.0 was tagged but never published to npm; its changes (listed under
54
+ 1.19.0 below) ship to npm for the first time in this release.
55
+
56
+ ### Upgrading — BREAKING without an open KYA-OS transport
57
+
58
+ - **Every response proof is now made where the KYA-OS transport sends the
59
+ result, under the default body profile as under the envelope profile, and
60
+ the wrappers refuse to run without one.** While no KYA-OS transport is open
61
+ for the middleware, `wrapWithProof`, `wrapWithDelegation`, `withPolicyGate`
62
+ and `proveOutcome` throw on entry, before they record or run anything, with
63
+ an error that names `withKyaOs` and `createKyaOsTransport`. A transport
64
+ counts as open from `start()` until it closes, by `close()` or by its own
65
+ `onclose`. Once a KYA-OS transport has been created for a middleware, every
66
+ wrapper result must go out through one. Before, the proofs were signed in
67
+ the handler, and they did not verify on 2026-07-28 (envelope) or after an
68
+ SDK reshaped `content` (body). Find your setup:
69
+ - **`withKyaOs(server, …)` before `server.connect()`, `proofAllTools` left
70
+ on:** nothing to change.
71
+ - **The low-level `Server` API with `createKyaOsMiddleware`:** connect
72
+ through the KYA-OS transport, as this repository's examples now do:
73
+
74
+ ```ts
75
+ await server.connect(createKyaOsTransport(transport, kyaos)); // was server.connect(transport)
76
+ ```
77
+
78
+ The transport proves and audits every tool's result, as `withKyaOs`
79
+ does, including tools you registered without a wrapper, which went out
80
+ unproven on 1.19.0. List any to leave unproven in its third argument,
81
+ which adds to the always-excluded `_kyaos` and `_kyaos_handshake`.
82
+ - **A script, walkthrough or test that calls a wrapped handler directly:**
83
+ serve it in process, and read the result a client would receive:
84
+
85
+ ```ts
86
+ const local = serveInProcess(kyaos);
87
+ const checkout = local.tool('checkout', kyaos.wrapWithDelegation('checkout', consent, handler));
88
+ const result = await checkout({ item: 'laptop' }); // proved
89
+ await local.close();
90
+ ```
91
+ - **`withKyaOs` with `proofAllTools: false`:** it wraps no transport, so
92
+ the wrappers refuse. Leave it on and list the tools to leave unproven in
93
+ `excludeTools`.
94
+ - **`withKyaOs` called after `connect()`:** the connected transport is not
95
+ wrapped; call `withKyaOs` first.
96
+ - **Code that reads the proof inside the handler:** the result
97
+ `proveOutcome` or a wrapper returns no longer carries one, under either
98
+ profile. Return it from the handler; the transport adds the proof.
99
+ - **Results delivered later, such as MCP task results:** a result is
100
+ proved the first time the same middleware sends it, within
101
+ `pendingProofTtlMs` (default five minutes, at most 2147483647) of the
102
+ handler returning. Raise it for task results fetched later; a later or
103
+ repeated send goes out with `proofError` (see below).
104
+
105
+ ### Added
106
+
107
+ - **The Entity Card revocation checker can verify a status list's proof.**
108
+ `createRevocationChecker` fetched a Bitstring status list and read its bits
109
+ without checking the list's proof, which Bitstring Status List v1.0 requires
110
+ (§3.2, step 4). Whoever could serve or alter the list could clear a
111
+ revocation. It now takes an optional `verifyStatusList`: a list it rejects,
112
+ by returning anything but `true` or by throwing, resolves to revoked and not
113
+ fresh, like any other unreadable list. `createStatusListProofVerifier({
114
+ didResolver })` is a ready verifier for `DataIntegrityProof` /
115
+ `eddsa-jcs-2022` lists. It finds the key that `proof.verificationMethod`
116
+ names in the issuer's DID document, requires that method to belong to the
117
+ list's `issuer`, and accepts relative method ids and `publicKeyJwk` or
118
+ `publicKeyMultibase` keys. It verifies a status list published by
119
+ builders.kya-os.org, signed by an independent implementation. Without
120
+ `verifyStatusList` the checker behaves as before. The option becomes
121
+ required in 2.0, and SPEC.md §6.10 states the requirement.
122
+ - **`createKyaOsTransport` is exported from `@kya-os/mcp`,** next to
123
+ `createKyaOsMiddleware`, for servers on the low-level `Server` API, which
124
+ now connect through it. It was only on `@kya-os/mcp/middleware`. Its
125
+ `Transport` type declares the callbacks as methods, so an SDK 1 or SDK 2
126
+ transport is accepted, and the wrapper connects to either SDK's server,
127
+ without a cast.
128
+ - **`serveInProcess(kyaos)` calls wrapped handlers outside an MCP server.**
129
+ `local.tool(name, handler)` answers as a server would, through a KYA-OS
130
+ transport, so the result carries its proof; `local.close()` closes the
131
+ transport. It replaces the examples' own helper.
132
+ - **`pendingProofTtlMs`** on `KyaOsConfig` and `WithKyaOsOptions`: how long a
133
+ wrapper's result may wait to be sent before its proof is given up (default
134
+ 300000, five minutes; at most 2147483647, about 24.8 days, the longest timer
135
+ a JavaScript runtime keeps). Memory stays bounded by the caps on waiting
136
+ proofs.
137
+
138
+ ### Changed
139
+
140
+ - **Envelope-profile proofs are made at the transport, over the result as it
141
+ is sent.** On the 2026-07-28 revision, MCP SDK 2 adds `resultType:
142
+ 'complete'` to a tool result after the handler returns it. An
143
+ envelope-profile proof made in the handler, by `proveOutcome`,
144
+ `wrapWithProof` or either gate, did not cover that member, so the client's
145
+ check of the result it received failed. Under the envelope profile these
146
+ paths now leave the proof to the `withKyaOs` transport, or one built with
147
+ `createKyaOsTransport`, which makes it in `send()`, after the SDK has
148
+ finished the result. The proof covers exactly the result the client
149
+ receives, on 2025-11-25 and on 2026-07-28, with SDK 1 or SDK 2. This
150
+ supersedes the 1.19.0 advice to set `resultType: 'complete'` on a result
151
+ before proving it under the envelope profile: that is no longer needed, and
152
+ a result that sets it is proved as sent.
153
+ - What a proof claims stays in the middleware. The result carries only a
154
+ private one-time id, redeemed only on a result that also carries the
155
+ middleware's stamp, and the session is read again when the proof is made,
156
+ which takes its audience from it. A result naming no waiting proof, or
157
+ one whose session is gone by then, goes out without a proof and with
158
+ `_meta.proofError`, as does an outcome whose proof fails at send.
159
+ - A waiting proof holds the request's hash, computed when the call was
160
+ recorded, never the arguments, so a waiting proof is small however large
161
+ they were, and later changes to the arguments cannot reach what is
162
+ signed. Arguments that cannot be hashed fail the proof in the handler
163
+ (`proofError`, `proof.rejected` with `PROOF_GENERATION_FAILED`).
164
+ - The claims, `_meta` keys and audit events are the ones the handler-side
165
+ proof had. For a result that is sent, the audit events are recorded in
166
+ the same order as before: an allowed call's `tool.call.started` in the
167
+ handler, then `proof.generated` and `tool.call.completed` at send.
168
+ - A result the SDK never sends (a cancelled call, or an SDK 1 result
169
+ replaced after an `outputSchema` check) is closed in the audit trail with
170
+ `proof.rejected` under the new code `PROOF_NOT_SENT`. An allowed call
171
+ then records `tool.call.failed` with the reason `RESULT_NOT_SENT`, never
172
+ `tool.call.completed`, since its client did not get the result. An
173
+ outcome's terminal events were recorded in the handler. This happens five
174
+ minutes after the handler returned; when the last KYA-OS transport for
175
+ the middleware closes; or, oldest first, when 10,000 proofs are waiting
176
+ or they hold about 16 MB of audit context.
177
+ - **Body-profile proofs are made at the transport too, so neither profile
178
+ signs in the handler.** The MCP SDK also changes `content` after the
179
+ handler returns. SDK 2, on both revisions, appends a text item when
180
+ `structuredContent` is not an object and `content` has none. Both SDKs fill
181
+ in `content: []` when a handler leaves it out. A body-profile proof made in
182
+ the handler did not cover the appended item, so it failed verification, and
183
+ over a missing `content` it could not be made at all. The body profile now
184
+ takes the same path as the envelope profile above: the claims stay in the
185
+ middleware by request hash, and the transport makes the proof in `send()`
186
+ over the result as sent, with the same claims, `_meta` keys and audit
187
+ events, recorded in the same order. `_meta` keeps its place among the
188
+ result's members. Where the SDK does not reshape the result, the output is
189
+ byte-identical to 1.19.0. An outcome proof that fails now also says so in
190
+ `_meta.proofError`, as an allowed call's already did.
191
+ - **A result is proved once, within the window.** A stamped result whose
192
+ pending proof is no longer waiting, because its window passed, it was
193
+ evicted, or it was already sent (a task result fetched again), goes out
194
+ with `proofError`, and the audit trail records `proof.rejected` with the
195
+ new code `PROOF_EXPIRED`, with the call's audit context when it is still
196
+ known. That record of closed proofs is bounded too: 10,000 entries and
197
+ about 4 MB, oldest first, holding no context over 16 KB.
198
+ - **`createKyaOsTransport`'s `exclude` adds to the protocol tools.** The
199
+ third argument replaced the default `["_kyaos", "_kyaos_handshake"]`, so a
200
+ caller passing its own list had the protocol tools' results proved. It now
201
+ adds to them, as `excludeTools` does in `withKyaOs`; the protocol tools
202
+ are always excluded.
203
+
204
+ ### Security
205
+
206
+ - **SDK 2's per-tool OAuth scope challenges were bypassed under `withKyaOs`
207
+ in earlier versions.** SDK 2's `McpServer.connect()` installs
208
+ the `scopeChallenge` enforcement of `registerTool` only on a transport
209
+ that has `setScopeChallengeResolver`, and the KYA-OS transport did not
210
+ pass that member through. A tool registered with, for example,
211
+ `scopeChallenge: requireScopes('payments:write')` therefore ran, and was
212
+ even proved, for a token without that scope. The caller should have
213
+ received a 403. This affected 1.19.0 and earlier:
214
+ - `withKyaOs` with a server's own `WebStandardStreamableHTTPServerTransport`;
215
+ - `createMcpHandler` serving a client that negotiates 2025-11-25.
216
+
217
+ At 2026-07-28, `createMcpHandler` enforces the challenge at its entry, before
218
+ the transport. The transport now passes the resolver through, and every
219
+ other transport member either SDK feature-detects or reads is passed
220
+ through too.
221
+ - **The private members could leave in a message that is not a result, and
222
+ a copied stamp and id could make the transport sign chosen content.** The
223
+ transport removed the lifecycle stamp and pending-proof id only from
224
+ `result`. A tool that logged a wrapped result in a notification therefore
225
+ sent both to the client. A tool that relays caller-controlled `_meta` into
226
+ its own result could then redeem them, and the client got a server-signed
227
+ proof over content of its choosing, verifying as the wrapped call's
228
+ response. With envelope-profile proofs at the transport this was possible
229
+ before this release; with the body profile there too, in this release
230
+ before the fix. Now:
231
+ - every outgoing message is cleaned at any depth: its `params`,
232
+ `result` and `error.data`;
233
+ - a waiting proof whose id is found anywhere other than its own result is
234
+ closed, so nothing can redeem it;
235
+ - on the answer to a `tools/call` the transport tracked, a pending proof
236
+ left for a different tool is not redeemed. The answer goes out unproven,
237
+ and the audit trail records `proof.rejected` with the new code
238
+ `PROOF_TOOL_MISMATCH`.
239
+
240
+ ### Fixed
241
+
242
+ - **The proof wrappers no longer change the result a handler returns.**
243
+ `wrapWithProof` set its `_meta` members (the pending-proof id, the
244
+ lifecycle stamp, `proofError`, the audit marker) on the handler's own
245
+ object, and its audit-degraded path set `isError: true` on it. A handler
246
+ that returned one object from every call, a module-level constant or a
247
+ cached result, found those members on it, and a later call could go out
248
+ with an earlier call's `isError` and audit marker; a frozen result made the
249
+ wrapper throw. Every member now goes on a shallow copy of the result with a
250
+ new `_meta`, in `wrapWithProof` and in the outcome path behind the gates
251
+ and `proveOutcome`, and the handler's object and its `_meta` are never
252
+ changed. What the client receives is otherwise the same. Closes #249.
253
+
254
+ - **The KYA-OS transport passes the SDK's request context through.** It
255
+ dropped the second argument of `onmessage` and of `send`, and did not
256
+ expose the inner transport's `sessionId`, `setProtocolVersion`,
257
+ `setSupportedProtocolVersions` or `hasPerRequestStream`. Under `withKyaOs`,
258
+ tools lost the request's `sessionId`, `authInfo` and `requestInfo` (SDK 1)
259
+ and `ctx.http.authInfo` (SDK 2, both revisions); SDK 1 task stores stopped
260
+ separating tasks by session; and notifications a tool sent during a call
261
+ lost their `relatedRequestId`, so on Streamable HTTP they missed the
262
+ request's stream. All of these now pass through unchanged. Closes #248.
263
+ - **The proof's scope is the call's, as the wrapper received it.**
264
+ `wrapWithProof` read `context.scopeId` and the audit context after the
265
+ handler ran, so a handler could change the scope a proof claims by changing
266
+ the context object it was handed. They are now read before the handler
267
+ runs.
268
+ - **Private members never reach the wire from a nested result.** A wrapped
269
+ result a handler placed inside its own result, in `structuredContent` for
270
+ example, carried the lifecycle stamp and the pending-proof id to the
271
+ client. They are now removed at any depth: the walk is iterative, with no
272
+ depth limit. A wrapped result serialized into a string, a text item for
273
+ example, cannot be cleaned that way. Such a result is sent without a
274
+ proof and with `proofError`, recorded as `proof.rejected` with the new
275
+ code `PRIVATE_MEMBER_IN_RESULT`. Every waiting proof whose id appears in
276
+ that string is closed, so it cannot be redeemed.
277
+
278
+ ## [1.19.0] - 2026-10-09
279
+
280
+ ### Added
281
+
282
+ - **`proveOutcome` proves the authorization outcomes application code
283
+ decides.** A server that enforces OAuth scopes in its tool handlers
284
+ returns its own challenges and denials as tool results, and the
285
+ `withKyaOs` transport sent such an error result unproven. The middleware
286
+ now has `proveOutcome({ toolName, args, outcome, reason, result,
287
+ sessionId? })`, which returns a copy of `result` carrying the proof the
288
+ gates attach to their outcomes: the same claims, the same `_meta` keys,
289
+ the configured response-proof profile and the same audit events. It runs
290
+ the gates' own code, and the transport passes its result through as
291
+ proven. A `needs_authorization` proof binds the result and a denial or
292
+ step-up proof binds none, as SPEC.md §7.4 has it. The `_kyaos*` control
293
+ arguments are left out of the signed request, `_meta` members only the
294
+ middleware may set are dropped, and no session needs to be opened. Under
295
+ the envelope profile, set `resultType: 'complete'` on the result first: on
296
+ the 2026-07-28 revision the MCP SDK adds it after the handler returns,
297
+ outside a proof made there. It is
298
+ optional on `KyaOsMiddleware`, as `withPolicyGate` is, so structural
299
+ implementers still type-check; the new `KyaOsOutcomeProver` role requires
300
+ it. New types: `KyaOsOutcomeProofRequest`, `KyaOsAuthorizationOutcome`,
301
+ `KyaOsToolResult`.
302
+ - **`formatChallenge` may return the whole challenge result.** Besides the
303
+ content array, the delegation gate's hook may return `{ content,
304
+ structuredContent?, isError?, _meta? }` (`KyaOsChallengeResult`; the hook
305
+ type is `KyaOsChallengeFormatter`). The gate sets all of it before it
306
+ signs the challenge, so the envelope profile covers `isError` and
307
+ `structuredContent`; the body profile still covers `content` only.
308
+ `_meta` members the middleware owns are dropped from what the hook
309
+ returns. The array form and the default challenge are unchanged; the
310
+ default challenge still carries no `isError`, unlike the policy gate's
311
+ step-up.
312
+ - **`toMcpToolCallback` registers a wrapped handler with `registerTool`
313
+ without a cast.** Passed straight to `McpServer.registerTool`, a
314
+ `KyaOsToolHandler` needed `as never`, and the SDK's request context then
315
+ arrived as the KYA-OS session id, so `wrapWithProof` found no session and
316
+ sent the result unproven. The adapter passes the arguments alone. Types:
317
+ `McpToolCallback`, `McpToolCallbackResult`.
318
+
319
+ ### Changed
320
+
321
+ - **A `formatChallenge` hook that returns neither form gets the default
322
+ challenge**, as a throwing hook does. Before, the value was emitted as
323
+ `content`, which `McpServer` then rejected as an invalid result.
324
+ - **`wrapWithProof` keeps an outcome proof it is handed.** A result
325
+ produced by the outcome-proof path, recognized by identity, is returned
326
+ as it is. Before, a challenge that was not an error result was signed
327
+ again there as an allowed call. No gate composition in this repository
328
+ reached that path.
329
+
330
+ ### Fixed
331
+
332
+ - **An allow result the session fallback cannot attribute says so.** A
333
+ call that threads no session, which is every call on the `withKyaOs`
334
+ transport path, is proved under the single established session. With
335
+ more than one session live the middleware refuses to pick one and the
336
+ result went out unproven, with only a log line; opening a session in the
337
+ middleware's `SessionManager` from application code did this to every
338
+ later allow result. Such a result now carries `_meta.proofError`, the
339
+ marker a failed proof generation already sets. `isError`, the content and
340
+ the audit events are unchanged, and a server with no session at all
341
+ emits what it did before.
342
+ - **Three DID-document readers accept a key published as
343
+ `publicKeyMultibase`.** `ProofVerifier.fetchPublicKeyFromDID`, the Entity
344
+ Card `didKeyedJwks` projection, and the conformance adapter's DID-resolution
345
+ check read only `publicKeyJwk`. A verification method that published its
346
+ Ed25519 key as `publicKeyMultibase`, the material property of
347
+ `Ed25519VerificationKey2020` and the form did:cheqd documents use, failed
348
+ with `PUBLIC_KEY_NOT_FOUND`, projected no key, or failed the check. They now
349
+ read the key through `verificationMethodJwk`, as the credential verifiers
350
+ already do: a `publicKeyJwk` is used unchanged, otherwise the key is taken
351
+ from `publicKeyMultibase` or `publicKeyBase58`, and anything that is not a
352
+ 32-byte Ed25519 key is still refused. The `PUBLIC_KEY_NOT_FOUND` message from
353
+ `fetchPublicKeyFromDID` now names all three properties. The did:key resolver's
354
+ output is unchanged.
355
+ - **Conformance suite 1.2.0: the status-list vectors' list verifies, and a
356
+ list altered after signing must be rejected.** The StatusList2021Credential
357
+ in `status-list.json` carried a proof that did not verify, and the reference
358
+ adapter read its bits without checking it. The suite therefore passed an
359
+ implementation that never checked a list's proof and failed one that did.
360
+ The list is re-signed, the reference adapter verifies its proof on the
361
+ delegation credentials' path before reading a bit, and a new negative
362
+ vector, `status-list/tampered-list`, clears the revoked bit after signing.
363
+ SPEC.md §6.6 and CONFORMANCE.md L3.11 state the check. The other eight
364
+ vector files change only their `version`, the suite has 49 vectors, and the
365
+ library is unchanged.
366
+
367
+ ### Documentation
368
+
369
+ - **The README says what a response proof does not cover.** `_meta` is
370
+ outside every response proof (SPEC.md §7.6), so a server should repeat
371
+ security-relevant hints it carries there, such as an OAuth
372
+ `resource_metadata`, `scope` or `error`, in `content` or
373
+ `structuredContent`. The new section on proving application outcomes says
374
+ so, and says which profile covers which members.
375
+ - **SPEC.md §6.2 states how a base-profile credential is signed.** Its
376
+ example labels the proof `Ed25519Signature2020`, and CONFORMANCE.md L3.1
377
+ asked for "Ed25519Signature2020 or equivalent", but the profile has never
378
+ used the W3C suite of that name. §6.2 now specifies the construction the
379
+ reference implementation and the vectors use: Ed25519 over the JCS
380
+ canonicalization of the credential without `proof`, `proofValue` as
381
+ unpadded base64url, the key found by `proof.verificationMethod`, and the
382
+ proof options outside the signature. L3.1 and L3.5 point to it. A new
383
+ conformance test checks the vectors' delegation credentials against that
384
+ text with `node:crypto` rather than the library's verifier. Moving to a
385
+ standard cryptosuite stays open in #184.
386
+
10
387
  ## [1.18.0] - 2026-10-08
11
388
 
12
389
  ### Added
package/CONFORMANCE.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Compliance levels for KYA-OS implementations**
4
4
 
5
- Version: 1.1.0
5
+ Version: 1.2.0
6
6
  Status: Stable
7
7
 
8
8
  ---
@@ -231,7 +231,7 @@ Implementation MUST:
231
231
  - Include `issuer` as DID string or object with `id`
232
232
  - Include `issuanceDate` in ISO 8601 format
233
233
  - Include `credentialSubject` with delegation details
234
- - Include `proof` with Ed25519Signature2020 or equivalent
234
+ - Include `proof` as SPEC.md §6.2 specifies: an Ed25519 signature over the JCS canonicalization of the credential without `proof`, in `proofValue` as unpadded base64url. This is not the W3C `Ed25519Signature2020` suite, despite the `proof.type` value ([#184](https://github.com/decentralized-identity/kya-os-mcp/issues/184))
235
235
 
236
236
  #### L3.5 — VC Verification
237
237
 
@@ -242,12 +242,13 @@ Implementation MUST validate:
242
242
  - `issuanceDate` is present and in the past
243
243
  - `expirationDate` (if present) is in the future
244
244
  - `credentialSubject.delegation` has required fields
245
- - `proof` is present
245
+ - `proof` is present and verifies as SPEC.md §6.2 specifies
246
246
 
247
247
  #### L3.11 — StatusList2021 Checking
248
248
 
249
249
  Implementation MUST:
250
250
  - Fetch StatusList2021 credential from `credentialStatus.statusListCredential`
251
+ - Verify the list's `proof` as SPEC.md §6.2 specifies, and reject the credential when it does not verify
251
252
  - Decompress and decode the bitstring
252
253
  - Check bit at `statusListIndex`
253
254
  - Return revoked status if bit is 1
@@ -430,7 +431,7 @@ so it is reproducible against any implementation without re-signing.
430
431
  |------|----------|----------|----------|
431
432
  | `vectors/signed-proof.json` | Detached proof verification | valid signature + in-window ts; envelope content binding (profile `org.kya-os/response-proof.envelope`) | tampered signature, tampered meta, wrong key, timestamp skew exceeded; tampered `structuredContent` under envelope coverage, `prf` stripped (downgrade), unknown profile |
432
433
  | `vectors/delegation-chain.json` | Delegation chain verification | single-hop, two-hop attenuated | broken issuer↔subject linkage, scope widening, tampered signature, audience mismatch |
433
- | `vectors/status-list.json` | StatusList2021 revocation | active (bit unset) | revoked (bit set) |
434
+ | `vectors/status-list.json` | StatusList2021 revocation | active (bit unset) | revoked (bit set), list altered after signing |
434
435
  | `vectors/did-key-resolution.json` | did:key resolution | valid Ed25519 | malformed multibase, wrong method |
435
436
  | `vectors/did-web-resolution.json` | did:web resolution | well-formed id-matched document | document id mismatch, not found |
436
437
  | `vectors/card-proof.json` | `org.kya-os/proof.v1` holder-of-key proof | valid signed proof, in-window, audience-bound | tampered body, tampered signature, wrong audience, expired, kid⇄did forgery |
@@ -458,6 +459,11 @@ This vector leaves the JWS byte-identical to `valid-basic` and alters only the m
458
459
  A conformant verifier MUST reconcile `meta` against the decoded JWS payload and reject on any mismatch.
459
460
  Signature validity alone does not pass this vector: it is the `requestHash` counterpart of the `responseHash` recompute rule in L2.11.
460
461
 
462
+ **On `status-list/tampered-list` (suite ≥ 1.2.0).**
463
+ This vector carries the revoked credential and its signed list with the revoked bit cleared and the list's proof left as signed.
464
+ A verifier that reads the bits without verifying the list's proof reports the credential active and passes a vector it must reject (L3.11).
465
+ Suites before 1.2.0 shipped a list whose proof did not verify, so an implementation that checked it failed `status-list/active-credential`.
466
+
461
467
  ### Running the reference implementation
462
468
 
463
469
  ```bash
package/README.md CHANGED
@@ -54,6 +54,24 @@ npm install @kya-os/mcp
54
54
 
55
55
  ---
56
56
 
57
+ ## Upgrading to 1.20: proofs need a KYA-OS transport
58
+
59
+ > **Breaking for servers without a KYA-OS transport.** From 1.20, every response proof (under the default body profile as under the envelope profile) is made where the KYA-OS transport sends the result, after the MCP SDK has finished it. While no KYA-OS transport is open for the middleware, `wrapWithProof`, `wrapWithDelegation`, `withPolicyGate` and `proveOutcome` throw before they run anything.
60
+
61
+ | Your setup | What to do |
62
+ |---|---|
63
+ | `withKyaOs(server, …)` before `server.connect()` | Nothing. |
64
+ | Low-level `Server` with `createKyaOsMiddleware` | `await server.connect(createKyaOsTransport(transport, kyaos))`. It proves every tool's result, unwrapped tools included (unproven on 1.19.0); its third argument adds tools to leave unproven. |
65
+ | A script or test that calls a wrapped handler directly | `const local = serveInProcess(kyaos); const call = local.tool('name', handler); await call(args); await local.close();` |
66
+ | `withKyaOs` with `proofAllTools: false` | Leave it on; list tools to leave unproven in `excludeTools`. |
67
+ | `withKyaOs` after `connect()` | Call it before `connect()`. |
68
+ | Reading the proof inside the handler | The transport adds it when the result is sent; read it from what the client receives. |
69
+ | MCP task results fetched later | A result is proved the first time the same middleware sends it, within `pendingProofTtlMs` (default five minutes, at most 2147483647 ms); raise it for later fetches. |
70
+
71
+ See the [changelog](./CHANGELOG.md) for the details.
72
+
73
+ ---
74
+
57
75
  ## Migrate any MCP server in 2 lines
58
76
 
59
77
  **Before**, a standard MCP server with no identity or proofs:
@@ -106,6 +124,45 @@ When an agent calls `checkout` without a delegation credential, it gets back a `
106
124
 
107
125
  > Try it yourself: [examples/consent-basic](./examples/consent-basic/) walks through the full consent flow end-to-end.
108
126
 
127
+ ### Prove the outcomes your own code decides
128
+
129
+ A server that enforces authorization itself, checking OAuth scopes in the tool handler for example, returns its own challenges and denials as tool results. `withKyaOs` proves the results it can attribute, but it sends an error result its own gates did not produce as the handler returned it, without a proof. `proveOutcome` gives that result the proof the gates attach to theirs, with the same claims, `_meta` keys and audit events:
130
+
131
+ ```typescript
132
+ import { toMcpToolCallback } from '@kya-os/mcp';
133
+
134
+ server.registerTool('get_report', { inputSchema }, toMcpToolCallback(async (args) => {
135
+ if (!grantedScopes.includes('reports:read')) {
136
+ return kyaos.proveOutcome!({
137
+ toolName: 'get_report',
138
+ args,
139
+ outcome: 'needs_authorization', // or 'step_up_required', 'denied'
140
+ reason: 'insufficient_scope',
141
+ result: {
142
+ content: [{ type: 'text', text: 'Sign in to see this report.' }],
143
+ structuredContent: { error: 'insufficient_scope', scope: 'reports:read', resource_metadata },
144
+ isError: true,
145
+ _meta: { 'mcp/www_authenticate': [`Bearer resource_metadata="${resource_metadata}"`] },
146
+ },
147
+ });
148
+ }
149
+ return { content: [{ type: 'text', text: report }] };
150
+ }));
151
+ ```
152
+
153
+ - **Build the whole result before proving it**, and return what `proveOutcome` gives you from the handler.
154
+ - **Every proof is made where the result is sent.** The `withKyaOs` transport makes it when it sends the result, after the MCP SDK has finished the result, so it covers what the client receives. Under the default body profile it covers `content`, including a text item SDK 2 appends when `structuredContent` is not an object, and the `content: []` either SDK fills in when a handler leaves it out. Under the envelope response-proof profile (`responseProofProfile: RESPONSE_PROOF_PROFILE_ENVELOPE`) it covers every member except `_meta`, including the `resultType` that SDK 2 adds on the 2026-07-28 revision. This applies to `proveOutcome`, `wrapWithProof` and both gates.
155
+ - **Every wrapper needs an open KYA-OS transport.** `withKyaOs` wraps the transport you connect, unless `proofAllTools` is `false`; for a transport you connect yourself (the low-level `Server` API with `createKyaOsMiddleware`), wrap it with `createKyaOsTransport`, exported from `@kya-os/mcp`. Once a KYA-OS transport has been created for a middleware, every wrapper result must go out through one. While none is open (none was started, or all have closed), the wrappers and `proveOutcome` throw before they run anything, instead of sending a result they cannot prove.
156
+ - **`_meta` is outside every response proof** (SPEC §7.6). Repeat anything a client must be able to trust, such as `resource_metadata`, `scope` and `error`, in `content` or `structuredContent`.
157
+ - A `needs_authorization` proof binds the result; a denial or step-up proof binds none (SPEC §7.4).
158
+ - The result carries private members until the transport sends it, and the transport removes them. One of them is a one-time id: what the proof claims (by request hash) and its session stay in the middleware, and the transport redeems the id once. A result the SDK never sends, such as a cancelled call's, is closed in the audit trail with `proof.rejected` (`PROOF_NOT_SENT`) and, for an allowed call, `tool.call.failed` (`RESULT_NOT_SENT`).
159
+ - **A result is proved once, by the middleware that sends it, within `pendingProofTtlMs`** (default five minutes, at most 2147483647 ms). A task result fetched again, or later than the window, goes out with `proofError`, recorded as `PROOF_EXPIRED`. What the proof claims lives in that middleware's memory, so only the process that recorded the call can make the proof; [#250](https://github.com/decentralized-identity/kya-os-mcp/issues/250) proposes sealed claims so that any process holding the identity could.
160
+ - **Do not serialize a wrapped result into a string.** Its private members cannot be removed from inside the string, so the result that carries it goes out unproven (`PRIVATE_MEMBER_IN_RESULT`), and the serialized result's own proof is voided. Nest the result as an object instead: private members are removed at any depth from every outgoing message (results, notification and request `params`, and error `data`), and a wrapped result that goes out anywhere but as its own answer has its proof closed. On the answer to a `tools/call`, only a proof left for that tool is made.
161
+ - **Connect every server that shares a middleware through a KYA-OS transport.** The refusal checks only that some KYA-OS transport is open for the middleware. A second server sharing it over a plain transport therefore runs its wrappers, and its results leave with the lifecycle stamp and the pending-proof id in `_meta` and no proof. Those proofs are later closed as `PROOF_NOT_SENT`, although the results were sent.
162
+ - Leave `kyaos.sessionManager` alone. A second live session makes the fallback session ambiguous, and allow results then go out unproven, marked with `_meta.proofError`.
163
+ - `wrapWithDelegation`'s `formatChallenge` can return the same `{ content, structuredContent, isError, _meta }` shape for the library's own challenge, and all of it is set before signing.
164
+ - `toMcpToolCallback` adapts any wrapped handler to `registerTool` without a cast. The SDK's request context never reaches the handler as its session id.
165
+
109
166
  ---
110
167
 
111
168
  ## Turn proofs into a verifiable audit trail
@@ -251,7 +308,7 @@ The server is operated by a maintainer on pinned releases; this repo does not de
251
308
  | **Entity Card** | Typed, DID-anchored identity: fluent `card()` builder, `requireProof` per-request holder-of-key guard, CIMD OAuth on-ramp (`client_id` ⇄ `did:web`, MCP's default client auth), and `withKyaOsCard` projections that embed into MCP `server.json` / Server Cards (draft SEP-2127), A2A AgentCards, and NANDA AgentFacts |
252
309
  | **Signed proofs** | Detached JWS over JCS-canonicalized request/response hashes |
253
310
  | **Delegation credentials** | W3C Verifiable Credentials with scope constraints, rooted at a Responsible Party |
254
- | **Revocation** | StatusList2021 bitstring with cascading revocation |
311
+ | **Revocation** | StatusList2021 bitstring with cascading revocation; lists are GZIP-compressed by the shipped `statusListGzipCodec`, the manager's default |
255
312
  | **Replay prevention** | Nonce-based handshake with timestamp skew validation |
256
313
  | **Verifiable auditability** | Typed producer events, authoritative atomic recorder, signed chain receipts, RFC 9162 checkpoints, independent observation, encrypted evidence references, replay bundles, and offline CLI |
257
314
  | **Extensible** | Bring your own KMS, HSM, atomic nonce provider, or DID method |
package/SPEC.md CHANGED
@@ -513,6 +513,33 @@ Delegations are issued as W3C Verifiable Credentials:
513
513
  }
514
514
  ```
515
515
 
516
+ **The proof.** The example's `proof.type` is `Ed25519Signature2020`, but this
517
+ profile does not use the W3C suite of that name, and a W3C Data Integrity
518
+ verifier will not verify it. A conformant issuer produces, and a conformant
519
+ verifier checks, exactly this:
520
+
521
+ - **Signing input.** The UTF-8 bytes of the RFC 8785 (JCS) canonicalization of
522
+ the credential with its `proof` member removed. There is no RDF
523
+ canonicalization and no hash of the proof options.
524
+ - **Signature.** Ed25519 (RFC 8032), 64 bytes.
525
+ - **`proofValue`.** The signature as base64url without padding (86 characters),
526
+ with no multibase prefix.
527
+ - **Key.** The verification method in the issuer's DID document whose `id`
528
+ equals `proof.verificationMethod`.
529
+ - **`proof.type`.** Issuers set `Ed25519Signature2020`. A verifier MAY also
530
+ accept `DataIntegrityProof` for the same construction, and MUST reject any
531
+ other `proof.type`.
532
+
533
+ The other `proof` members (`type`, `created`, `verificationMethod`,
534
+ `proofPurpose`) are not covered by the signature; a verifier uses
535
+ `verificationMethod` only to select the key. The `StatusList2021Credential` of
536
+ §6.6 is signed the same way. The delegation credentials in the
537
+ `delegation-chain` and `status-list` conformance vectors, and the status
538
+ lists in the `status-list` vectors, carry this construction. Whether 2.0
539
+ moves this profile to a standard cryptosuite is tracked in [#184](https://github.com/decentralized-identity/kya-os-mcp/issues/184).
540
+ The §6.10 profile uses `DataIntegrityProof` with `eddsa-jcs-2022` and is not
541
+ affected.
542
+
516
543
  A `DelegationCredential` carries a _permission_, not a _claim_. To keep claim
517
544
  semantics out of an authorization decision — a confused-deputy vector (§11.6) —
518
545
  the `credentialSubject` MUST contain only two properties: `id` (the delegate's
@@ -718,6 +745,10 @@ KYA-OS uses the W3C StatusList2021 specification for revocation:
718
745
  }
719
746
  ```
720
747
 
748
+ A verifier that reads a `StatusList2021Credential` MUST verify its proof, as
749
+ §6.2 states, before reading any bit. A list whose proof does not verify is
750
+ unresolvable: the credential it covers is rejected, never read as active.
751
+
721
752
  L1 implementations do not require revocation support; revocation checking is available at L3 only.
722
753
 
723
754
  Revocation does not require a globally accessible list. A verifier only needs to
@@ -871,9 +902,12 @@ different resource fails at the root check instead of being accepted by an unrel
871
902
  (`BitstringStatusListEntry`) - the **successor to** the deprecated StatusList2021 - behind a
872
903
  pluggable `RevocationChecker` seam so status-list churn never reaches callers. The default checker
873
904
  resolves `statusListCredential` via SafeFetch (§6.6), inflates the multibase (`u` = base64url) +
874
- GZIP `encodedList`, and reads the bit at `statusListIndex` MSB-first within each byte. It is
875
- **fail-closed**: an unreachable list, malformed credential, mismatched `statusPurpose`, or
876
- out-of-range index all resolve to `{ revoked: true }`. Each verdict also reports `fresh` - `true`
905
+ GZIP `encodedList`, and reads the bit at `statusListIndex` MSB-first within each byte. A verifier
906
+ MUST verify the status list credential's proof before it reads a bit, as Bitstring Status List
907
+ v1.0 requires. The reference checker does so when given its `verifyStatusList` seam (optional
908
+ until 2.0) and ships a verifier for `eddsa-jcs-2022` lists. It is **fail-closed**: an unreachable
909
+ list, malformed credential, rejected list proof, mismatched `statusPurpose`, or out-of-range index
910
+ all resolve to `{ revoked: true }`. Each verdict also reports `fresh` - `true`
877
911
  only when read from a live, in-validity-window (`validFrom`/`validUntil`, or
878
912
  `issuanceDate`/`expirationDate`) status list. The chain walk is **cascading**: root→leaf,
879
913
  short-circuiting on the first revoked/unresolvable hop (a revoked ancestor invalidates the subtree),
package/dist/card/cimd.js CHANGED
@@ -27,6 +27,7 @@
27
27
  * no runtime (mcp-i-core) dependency leaks into `@kya-os/mcp`.
28
28
  */
29
29
  import { isRecord } from '../utils/guards.js';
30
+ import { verificationMethodJwk } from '../delegation/verification-method-key.js';
30
31
  import { parseCard } from './resolve.js';
31
32
  /** The OAuth `client_id` metadata-document prefix this module transforms. */
32
33
  const DID_WEB_PREFIX = 'did:web:';
@@ -208,11 +209,14 @@ function urlOrigin(url) {
208
209
  return null;
209
210
  }
210
211
  }
211
- /** Project one verification method to a public OKP JWK (Ed25519 only; `d` stripped), or null. */
212
+ /**
213
+ * Project one verification method to a public OKP JWK (Ed25519 only; `d` stripped), or null.
214
+ * The key may be published as `publicKeyJwk`, `publicKeyMultibase`, or `publicKeyBase58`.
215
+ */
212
216
  function vmToOkpJwk(vm) {
213
217
  if (!isRecord(vm))
214
218
  return null;
215
- const jwk = vm.publicKeyJwk;
219
+ const jwk = verificationMethodJwk(vm);
216
220
  if (!isRecord(jwk) || jwk.kty !== 'OKP' || jwk.crv !== 'Ed25519' || typeof jwk.x !== 'string') {
217
221
  return null;
218
222
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cimd.js","sourceRoot":"","s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