@kya-os/mcp 1.2.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +114 -10
- package/LICENSE +1 -1
- package/README.md +50 -33
- package/dist/auth/handshake.d.ts +1 -1
- package/dist/auth/handshake.js +1 -1
- package/dist/delegation/cascading-revocation.d.ts +1 -1
- package/dist/delegation/cascading-revocation.js +1 -1
- package/dist/delegation/delegation-graph.d.ts +1 -1
- package/dist/delegation/delegation-graph.js +1 -1
- package/dist/delegation/did-web-resolver.d.ts +51 -1
- package/dist/delegation/did-web-resolver.d.ts.map +1 -1
- package/dist/delegation/did-web-resolver.js +108 -0
- package/dist/delegation/did-web-resolver.js.map +1 -1
- package/dist/delegation/outbound-headers.d.ts +14 -14
- package/dist/delegation/outbound-headers.d.ts.map +1 -1
- package/dist/delegation/outbound-headers.js +15 -15
- package/dist/delegation/outbound-headers.js.map +1 -1
- package/dist/delegation/outbound-proof.d.ts +2 -2
- package/dist/delegation/outbound-proof.js +2 -2
- package/dist/delegation/vc-issuer.d.ts +1 -1
- package/dist/delegation/vc-issuer.js +1 -1
- package/dist/delegation/vc-verifier.d.ts +2 -1
- package/dist/delegation/vc-verifier.d.ts.map +1 -1
- package/dist/delegation/vc-verifier.js +1 -1
- package/dist/delegation/vc-verifier.js.map +1 -1
- package/dist/errors.d.ts +6 -6
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +3 -3
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +8 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/logging/logger.d.ts +1 -1
- package/dist/logging/logger.js +1 -1
- package/dist/middleware/index.d.ts +6 -6
- package/dist/middleware/index.d.ts.map +1 -1
- package/dist/middleware/index.js +6 -6
- package/dist/middleware/index.js.map +1 -1
- package/dist/middleware/{mcpi-transport.d.ts → kya-os-transport.d.ts} +8 -8
- package/dist/middleware/kya-os-transport.d.ts.map +1 -0
- package/dist/middleware/{mcpi-transport.js → kya-os-transport.js} +9 -9
- package/dist/middleware/kya-os-transport.js.map +1 -0
- package/dist/middleware/{with-mcpi-server.d.ts → with-kya-os-server.d.ts} +24 -24
- package/dist/middleware/with-kya-os-server.d.ts.map +1 -0
- package/dist/middleware/{with-mcpi-server.js → with-kya-os-server.js} +26 -26
- package/dist/middleware/with-kya-os-server.js.map +1 -0
- package/dist/middleware/{with-mcpi.d.ts → with-kya-os.d.ts} +41 -60
- package/dist/middleware/with-kya-os.d.ts.map +1 -0
- package/dist/middleware/{with-mcpi.js → with-kya-os.js} +66 -42
- package/dist/middleware/with-kya-os.js.map +1 -0
- package/dist/proof/errors.d.ts +1 -0
- package/dist/proof/errors.d.ts.map +1 -1
- package/dist/proof/errors.js +2 -0
- package/dist/proof/errors.js.map +1 -1
- package/dist/proof/generator.d.ts +1 -1
- package/dist/proof/generator.js +1 -1
- package/dist/proof/index.d.ts +1 -1
- package/dist/proof/index.d.ts.map +1 -1
- package/dist/proof/index.js +1 -1
- package/dist/proof/index.js.map +1 -1
- package/dist/proof/verifier.d.ts +49 -1
- package/dist/proof/verifier.d.ts.map +1 -1
- package/dist/proof/verifier.js +85 -2
- package/dist/proof/verifier.js.map +1 -1
- package/dist/providers/base.d.ts +32 -3
- package/dist/providers/base.d.ts.map +1 -1
- package/dist/providers/base.js.map +1 -1
- package/dist/providers/node-crypto.d.ts +2 -2
- package/dist/providers/node-crypto.js +2 -2
- package/dist/session/manager.d.ts +8 -6
- package/dist/session/manager.d.ts.map +1 -1
- package/dist/session/manager.js +16 -10
- package/dist/session/manager.js.map +1 -1
- package/dist/types/protocol.d.ts +15 -3
- package/dist/types/protocol.d.ts.map +1 -1
- package/dist/types/protocol.js +7 -3
- package/dist/types/protocol.js.map +1 -1
- package/package.json +4 -4
- package/schemas/README.md +6 -6
- package/schemas/delegation-credential.json +4 -4
- package/schemas/detached-proof.json +1 -1
- package/schemas/handshake-request.json +3 -3
- package/schemas/handshake-response.json +2 -2
- package/schemas/well-known-mcpi.json +14 -7
- package/dist/middleware/mcpi-transport.d.ts.map +0 -1
- package/dist/middleware/mcpi-transport.js.map +0 -1
- package/dist/middleware/with-mcpi-server.d.ts.map +0 -1
- package/dist/middleware/with-mcpi-server.js.map +0 -1
- package/dist/middleware/with-mcpi.d.ts.map +0 -1
- package/dist/middleware/with-mcpi.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* KyaOsTransport — Proof-injecting Transport Wrapper
|
|
3
3
|
*
|
|
4
4
|
* Wraps any MCP Transport to intercept `tools/call` responses and attach
|
|
5
|
-
*
|
|
5
|
+
* KYA-OS detached proofs. Uses only the public Transport interface — no
|
|
6
6
|
* private SDK internals accessed.
|
|
7
7
|
*
|
|
8
8
|
* The McpServer never knows this wrapper exists. It sees a normal transport.
|
|
@@ -14,18 +14,18 @@
|
|
|
14
14
|
* 2. Outgoing responses for those ids get a proof injected into `_meta`.
|
|
15
15
|
* 3. All other message types pass through unmodified.
|
|
16
16
|
*
|
|
17
|
-
* @module
|
|
17
|
+
* @module kya-os-transport
|
|
18
18
|
*/
|
|
19
19
|
import { logger } from "../logging/index.js";
|
|
20
20
|
/**
|
|
21
|
-
* Creates a transport wrapper that injects
|
|
21
|
+
* Creates a transport wrapper that injects KYA-OS proofs into `tools/call`
|
|
22
22
|
* responses.
|
|
23
23
|
*
|
|
24
24
|
* @param inner - The real transport (Stdio, HTTP, etc.)
|
|
25
|
-
* @param
|
|
25
|
+
* @param kyaos - Configured KyaOsMiddleware instance
|
|
26
26
|
* @param exclude - Tool names to skip proof generation for
|
|
27
27
|
*/
|
|
28
|
-
export function
|
|
28
|
+
export function createKyaOsTransport(inner, kyaos, exclude = ["_kyaos", "_kyaos_handshake"]) {
|
|
29
29
|
// Request id → { toolName, args } for pending tool calls
|
|
30
30
|
const pending = new Map();
|
|
31
31
|
const wrapper = {
|
|
@@ -62,7 +62,7 @@ export function createMCPITransport(inner, mcpi, exclude = ["_mcpi", "_mcpi_hand
|
|
|
62
62
|
const rawResult = message.result;
|
|
63
63
|
if (rawResult && !rawResult.isError) {
|
|
64
64
|
const handler = async () => rawResult;
|
|
65
|
-
const addProof =
|
|
65
|
+
const addProof = kyaos.wrapWithProof(call.toolName, handler);
|
|
66
66
|
const proofed = await addProof(call.args);
|
|
67
67
|
if (proofed._meta !== undefined) {
|
|
68
68
|
message = {
|
|
@@ -73,7 +73,7 @@ export function createMCPITransport(inner, mcpi, exclude = ["_mcpi", "_mcpi_hand
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
catch (error) {
|
|
76
|
-
logger.error("[
|
|
76
|
+
logger.error("[kya-os-transport] Proof injection failed", {
|
|
77
77
|
tool: call.toolName,
|
|
78
78
|
error: error instanceof Error ? error.message : String(error),
|
|
79
79
|
});
|
|
@@ -118,4 +118,4 @@ export function createMCPITransport(inner, mcpi, exclude = ["_mcpi", "_mcpi_hand
|
|
|
118
118
|
};
|
|
119
119
|
return wrapper;
|
|
120
120
|
}
|
|
121
|
-
//# sourceMappingURL=
|
|
121
|
+
//# sourceMappingURL=kya-os-transport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kya-os-transport.js","sourceRoot":"","sources":["../../src/middleware/kya-os-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAyB7C;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAgB,EAChB,KAAsB,EACtB,UAAoB,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IAElD,yDAAyD;IACzD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAwB,CAAC;IAEhD,MAAM,OAAO,GAAc;QACzB,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE;QAC1B,KAAK,EAAE,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O,CAAC,MAEV,CAAC;gBACd,MAAM,QAAQ,GAAG,MAAM,EAAE,IAAI,CAAC;gBAC9B,IAAI,QAAQ,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;oBAC5C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE;wBACtB,QAAQ;wBACR,IAAI,EAAE,MAAM,EAAE,SAAS,IAAI,EAAE;qBAC9B,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YACD,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,78 +1,78 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* McpServer Adapter for
|
|
2
|
+
* McpServer Adapter for KYA-OS
|
|
3
3
|
*
|
|
4
|
-
* Adds
|
|
4
|
+
* Adds KYA-OS identity, session management, and proof generation to a
|
|
5
5
|
* standard McpServer instance with a single function call.
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
8
|
-
* import {
|
|
9
|
-
* const
|
|
8
|
+
* import { withKyaOs } from '@kya-os/mcp/middleware';
|
|
9
|
+
* const kyaos = await withKyaOs(server, { crypto: new NodeCryptoProvider() });
|
|
10
10
|
* // All tools registered on `server` now get proofs automatically.
|
|
11
11
|
* await server.connect(transport); // transport is transparently wrapped
|
|
12
12
|
*/
|
|
13
13
|
import type { CryptoProvider } from "../providers/base.js";
|
|
14
|
-
import { type
|
|
15
|
-
import { type Transport } from "./
|
|
16
|
-
export interface
|
|
14
|
+
import { type KyaOsIdentityConfig, type KyaOsDelegationConfig, type KyaOsMiddleware } from "./with-kya-os.js";
|
|
15
|
+
import { type Transport } from "./kya-os-transport.js";
|
|
16
|
+
export interface WithKyaOsOptions {
|
|
17
17
|
/** Platform-specific crypto implementation (required) */
|
|
18
18
|
crypto: CryptoProvider;
|
|
19
19
|
/** Identity config — auto-generated if omitted */
|
|
20
|
-
identity?:
|
|
20
|
+
identity?: KyaOsIdentityConfig;
|
|
21
21
|
/** Session configuration */
|
|
22
22
|
session?: {
|
|
23
23
|
sessionTtlMinutes?: number;
|
|
24
24
|
};
|
|
25
|
-
/** Auto-create sessions for non-
|
|
25
|
+
/** Auto-create sessions for non-KYA-OS clients (default: true) */
|
|
26
26
|
autoSession?: boolean;
|
|
27
27
|
/** Attach proofs to all tool responses (default: true) */
|
|
28
28
|
proofAllTools?: boolean;
|
|
29
29
|
/** Tools to skip proof generation for */
|
|
30
30
|
excludeTools?: string[];
|
|
31
31
|
/** Delegation verification config */
|
|
32
|
-
delegation?:
|
|
32
|
+
delegation?: KyaOsDelegationConfig;
|
|
33
33
|
/**
|
|
34
|
-
* How the
|
|
35
|
-
* - "tool" (default): auto-register `
|
|
36
|
-
* - "none": do not register
|
|
34
|
+
* How the KYA-OS protocol tool is exposed on the server.
|
|
35
|
+
* - "tool" (default): auto-register `_kyaos`
|
|
36
|
+
* - "none": do not register KYA-OS tool (use middleware APIs for custom runtime hooks)
|
|
37
37
|
*/
|
|
38
38
|
handshakeExposure?: "tool" | "none";
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
|
-
* Generate a fresh Ed25519 identity for
|
|
41
|
+
* Generate a fresh Ed25519 identity for KYA-OS.
|
|
42
42
|
*
|
|
43
43
|
* @param crypto - Platform-specific crypto provider
|
|
44
44
|
* @returns Identity config with DID, kid, and key material
|
|
45
45
|
*/
|
|
46
|
-
export declare function generateIdentity(crypto: CryptoProvider): Promise<
|
|
46
|
+
export declare function generateIdentity(crypto: CryptoProvider): Promise<KyaOsIdentityConfig>;
|
|
47
47
|
/**
|
|
48
48
|
* Minimal McpServer interface — avoids hard dependency on @modelcontextprotocol/sdk.
|
|
49
|
-
* Matches the subset of McpServer's public API that
|
|
49
|
+
* Matches the subset of McpServer's public API that withKyaOs() uses.
|
|
50
50
|
*/
|
|
51
51
|
interface McpServerLike {
|
|
52
52
|
connect(transport: Transport): Promise<unknown>;
|
|
53
53
|
registerTool(...args: unknown[]): void;
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
|
-
* Add
|
|
56
|
+
* Add KYA-OS to a McpServer instance.
|
|
57
57
|
*
|
|
58
58
|
* 1. Auto-generates Ed25519 identity (or uses provided one)
|
|
59
|
-
* 2. Registers `
|
|
59
|
+
* 2. Registers `_kyaos` tool by default (`handshakeExposure: "tool"`)
|
|
60
60
|
* 3. Patches `server.connect()` to transparently wrap the transport with
|
|
61
|
-
*
|
|
61
|
+
* KyaOsTransport, which injects detached proofs into all `tools/call`
|
|
62
62
|
* responses using only the public Transport interface.
|
|
63
63
|
*
|
|
64
64
|
* The user-facing API is unchanged — register tools before or after this
|
|
65
65
|
* call, then connect as normal:
|
|
66
66
|
*
|
|
67
67
|
* ```ts
|
|
68
|
-
* const
|
|
69
|
-
* await server.connect(transport); //
|
|
68
|
+
* const kyaos = await withKyaOs(server, { crypto: new NodeCryptoProvider() });
|
|
69
|
+
* await server.connect(transport); // KyaOsTransport wraps silently
|
|
70
70
|
* ```
|
|
71
71
|
*
|
|
72
72
|
* @param server - McpServer instance
|
|
73
73
|
* @param options - Configuration
|
|
74
|
-
* @returns The
|
|
74
|
+
* @returns The KyaOsMiddleware instance for advanced usage (wrapWithDelegation, etc.)
|
|
75
75
|
*/
|
|
76
|
-
export declare function
|
|
76
|
+
export declare function withKyaOs(server: McpServerLike, options: WithKyaOsOptions): Promise<KyaOsMiddleware>;
|
|
77
77
|
export {};
|
|
78
|
-
//# sourceMappingURL=with-
|
|
78
|
+
//# sourceMappingURL=with-kya-os-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-kya-os-server.d.ts","sourceRoot":"","sources":["../../src/middleware/with-kya-os-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAG7E,MAAM,WAAW,gBAAgB;IAC/B,yDAAyD;IACzD,MAAM,EAAE,cAAc,CAAC;IACvB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,4BAA4B;IAC5B,OAAO,CAAC,EAAE;QAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,kEAAkE;IAClE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0DAA0D;IAC1D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,yCAAyC;IACzC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,qCAAqC;IACrC,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACrC;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,mBAAmB,CAAC,CAS9B;AAED;;;GAGG;AACH,UAAU,aAAa;IACrB,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,YAAY,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;CACxC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,SAAS,CAC7B,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,CAuE1B"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* McpServer Adapter for
|
|
2
|
+
* McpServer Adapter for KYA-OS
|
|
3
3
|
*
|
|
4
|
-
* Adds
|
|
4
|
+
* Adds KYA-OS identity, session management, and proof generation to a
|
|
5
5
|
* standard McpServer instance with a single function call.
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
8
|
-
* import {
|
|
9
|
-
* const
|
|
8
|
+
* import { withKyaOs } from '@kya-os/mcp/middleware';
|
|
9
|
+
* const kyaos = await withKyaOs(server, { crypto: new NodeCryptoProvider() });
|
|
10
10
|
* // All tools registered on `server` now get proofs automatically.
|
|
11
11
|
* await server.connect(transport); // transport is transparently wrapped
|
|
12
12
|
*/
|
|
13
13
|
import { generateDidKeyFromBase64, didKeyFragment } from "../utils/did-helpers.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import { KYA_OS_ACTIONS, createKyaOsMiddleware, } from "./with-kya-os.js";
|
|
15
|
+
import { createKyaOsTransport } from "./kya-os-transport.js";
|
|
16
16
|
import { z } from "zod";
|
|
17
17
|
/**
|
|
18
|
-
* Generate a fresh Ed25519 identity for
|
|
18
|
+
* Generate a fresh Ed25519 identity for KYA-OS.
|
|
19
19
|
*
|
|
20
20
|
* @param crypto - Platform-specific crypto provider
|
|
21
21
|
* @returns Identity config with DID, kid, and key material
|
|
@@ -31,42 +31,42 @@ export async function generateIdentity(crypto) {
|
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* Add
|
|
34
|
+
* Add KYA-OS to a McpServer instance.
|
|
35
35
|
*
|
|
36
36
|
* 1. Auto-generates Ed25519 identity (or uses provided one)
|
|
37
|
-
* 2. Registers `
|
|
37
|
+
* 2. Registers `_kyaos` tool by default (`handshakeExposure: "tool"`)
|
|
38
38
|
* 3. Patches `server.connect()` to transparently wrap the transport with
|
|
39
|
-
*
|
|
39
|
+
* KyaOsTransport, which injects detached proofs into all `tools/call`
|
|
40
40
|
* responses using only the public Transport interface.
|
|
41
41
|
*
|
|
42
42
|
* The user-facing API is unchanged — register tools before or after this
|
|
43
43
|
* call, then connect as normal:
|
|
44
44
|
*
|
|
45
45
|
* ```ts
|
|
46
|
-
* const
|
|
47
|
-
* await server.connect(transport); //
|
|
46
|
+
* const kyaos = await withKyaOs(server, { crypto: new NodeCryptoProvider() });
|
|
47
|
+
* await server.connect(transport); // KyaOsTransport wraps silently
|
|
48
48
|
* ```
|
|
49
49
|
*
|
|
50
50
|
* @param server - McpServer instance
|
|
51
51
|
* @param options - Configuration
|
|
52
|
-
* @returns The
|
|
52
|
+
* @returns The KyaOsMiddleware instance for advanced usage (wrapWithDelegation, etc.)
|
|
53
53
|
*/
|
|
54
|
-
export async function
|
|
54
|
+
export async function withKyaOs(server, options) {
|
|
55
55
|
const identity = options.identity ?? (await generateIdentity(options.crypto));
|
|
56
|
-
const
|
|
56
|
+
const kyaos = createKyaOsMiddleware({
|
|
57
57
|
identity,
|
|
58
58
|
session: options.session,
|
|
59
59
|
delegation: options.delegation,
|
|
60
60
|
autoSession: options.autoSession ?? true,
|
|
61
61
|
}, options.crypto);
|
|
62
62
|
if ((options.handshakeExposure ?? "tool") === "tool") {
|
|
63
|
-
// Register the unified
|
|
64
|
-
server.registerTool("
|
|
65
|
-
description: "
|
|
66
|
-
annotations: { title: "
|
|
63
|
+
// Register the unified _kyaos tool for protocol operations.
|
|
64
|
+
server.registerTool("_kyaos", {
|
|
65
|
+
description: "KYA-OS protocol — identity verification, session handshake, and server metadata",
|
|
66
|
+
annotations: { title: "KYA-OS Protocol", readOnlyHint: true },
|
|
67
67
|
inputSchema: {
|
|
68
68
|
action: z
|
|
69
|
-
.enum(
|
|
69
|
+
.enum(KYA_OS_ACTIONS)
|
|
70
70
|
.describe("Protocol operation to perform"),
|
|
71
71
|
nonce: z
|
|
72
72
|
.string()
|
|
@@ -86,7 +86,7 @@ export async function withMCPI(server, options) {
|
|
|
86
86
|
.describe("Client agent DID (handshake, optional)"),
|
|
87
87
|
},
|
|
88
88
|
}, async (args) => {
|
|
89
|
-
const result = await
|
|
89
|
+
const result = await kyaos.handleKyaOs(args);
|
|
90
90
|
return {
|
|
91
91
|
...result,
|
|
92
92
|
content: result.content.map((c) => ({ ...c, type: "text" })),
|
|
@@ -96,14 +96,14 @@ export async function withMCPI(server, options) {
|
|
|
96
96
|
// Auto-proof interception via transport wrapper (public API only).
|
|
97
97
|
//
|
|
98
98
|
// We patch server.connect() so that whatever transport the caller passes
|
|
99
|
-
// is silently wrapped with
|
|
99
|
+
// is silently wrapped with KyaOsTransport before McpServer sees it.
|
|
100
100
|
// Tool registration order does not matter — proofs are injected at the
|
|
101
101
|
// transport boundary, after McpServer has already dispatched the call.
|
|
102
102
|
if (options.proofAllTools !== false) {
|
|
103
|
-
const exclude = ["
|
|
103
|
+
const exclude = ["_kyaos", "_kyaos_handshake", ...(options.excludeTools ?? [])];
|
|
104
104
|
const originalConnect = server.connect.bind(server);
|
|
105
|
-
server.connect = (transport) => originalConnect(
|
|
105
|
+
server.connect = (transport) => originalConnect(createKyaOsTransport(transport, kyaos, exclude));
|
|
106
106
|
}
|
|
107
|
-
return
|
|
107
|
+
return kyaos;
|
|
108
108
|
}
|
|
109
|
-
//# sourceMappingURL=with-
|
|
109
|
+
//# sourceMappingURL=with-kya-os-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-kya-os-server.js","sourceRoot":"","sources":["../../src/middleware/with-kya-os-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EACL,cAAc,EACd,qBAAqB,GAItB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAkB,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyBxB;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAsB;IAEtB,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,eAAe,EAAE,CAAC;IAC/C,MAAM,GAAG,GAAG,wBAAwB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACxD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AAgC,CAAC;gBAC7C,QAAQ,EAAE,CAAC;qBACR,MAAM,EAAE;qBACR,QAAQ,EAAE;qBACV,QAAQ,CAAC,wCAAwC,CAAC;aACtD;SACF,EACD,KAAK,EAAE,IAAa,EAAE,EAAE;YACtB,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,WAAW,CACpC,IAA+B,CAChC,CAAC;YACF,OAAO;gBACL,GAAG,MAAM;gBACT,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,CAAC,CAAC;aACtE,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;IAED,mEAAmE;IACnE,EAAE;IACF,yEAAyE;IACzE,oEAAoE;IACpE,uEAAuE;IACvE,uEAAuE;IACvE,IAAI,OAAO,CAAC,aAAa,KAAK,KAAK,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,kBAAkB,EAAE,GAAG,CAAC,OAAO,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,CAAC;QAChF,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAEpD,MAAM,CAAC,OAAO,GAAG,CAAC,SAAoB,EAAE,EAAE,CACxC,eAAe,CAAC,oBAAoB,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* KYA-OS Middleware — Core Implementation
|
|
3
3
|
*
|
|
4
4
|
* Adds identity, session management, and proof generation to MCP servers.
|
|
5
5
|
*
|
|
6
|
-
* For most use cases, prefer the high-level `
|
|
7
|
-
* `./with-
|
|
6
|
+
* For most use cases, prefer the high-level `withKyaOs()` adapter from
|
|
7
|
+
* `./with-kya-os-server.ts` which (by default) auto-registers the handshake
|
|
8
8
|
* tool and auto-attaches proofs to all tool responses:
|
|
9
9
|
*
|
|
10
|
-
* import {
|
|
11
|
-
* await
|
|
10
|
+
* import { withKyaOs } from '@kya-os/mcp';
|
|
11
|
+
* await withKyaOs(server, { crypto: new NodeCryptoProvider() });
|
|
12
12
|
*
|
|
13
|
-
* `
|
|
14
|
-
* internally by `
|
|
13
|
+
* `createKyaOsMiddleware()` in this file is the lower-level API used
|
|
14
|
+
* internally by `withKyaOs()` and for advanced use cases like the
|
|
15
15
|
* low-level `Server` API or custom request handler patterns.
|
|
16
16
|
*/
|
|
17
17
|
import { type CryptoProvider, FetchProvider } from "../providers/base.js";
|
|
@@ -19,15 +19,15 @@ import { SessionManager, type SessionConfig } from "../session/manager.js";
|
|
|
19
19
|
import { ProofGenerator } from "../proof/generator.js";
|
|
20
20
|
import { type DIDResolver, type StatusListResolver } from "../delegation/vc-verifier.js";
|
|
21
21
|
import { type DelegationCredential } from "../types/protocol.js";
|
|
22
|
-
export interface
|
|
22
|
+
export interface KyaOsIdentityConfig {
|
|
23
23
|
did: string;
|
|
24
24
|
kid: string;
|
|
25
25
|
privateKey: string;
|
|
26
26
|
publicKey: string;
|
|
27
27
|
agentName?: string;
|
|
28
28
|
}
|
|
29
|
-
export declare const
|
|
30
|
-
export interface
|
|
29
|
+
export declare const KYA_OS_ACTIONS: readonly ["handshake", "identity", "reputation"];
|
|
30
|
+
export interface KyaOsDelegationConfig {
|
|
31
31
|
/**
|
|
32
32
|
* Optional custom DID resolver. If it returns null, middleware falls back to
|
|
33
33
|
* built-in did:key resolution and fetch-backed did:web resolution.
|
|
@@ -57,9 +57,12 @@ export interface MCPIDelegationConfig {
|
|
|
57
57
|
* that receives the credential will accept it.
|
|
58
58
|
*
|
|
59
59
|
* Recommended for production. See: Alan Karp's transitive access analysis
|
|
60
|
-
* and
|
|
60
|
+
* and KYA-OS §11.6 (Confused Deputy Attacks).
|
|
61
61
|
*
|
|
62
|
-
* Default is
|
|
62
|
+
* Default is `true` as of KYA-OS 1.3.x. Existing integrations that
|
|
63
|
+
* issue re-delegations without an `audience` constraint can set this
|
|
64
|
+
* to `false` to preserve legacy behavior; doing so logs a one-time
|
|
65
|
+
* warning per process.
|
|
63
66
|
*/
|
|
64
67
|
requireAudienceOnRedelegation?: boolean;
|
|
65
68
|
/**
|
|
@@ -74,22 +77,22 @@ export interface MCPIDelegationConfig {
|
|
|
74
77
|
*/
|
|
75
78
|
allowLegacyUnsafeDelegation?: boolean;
|
|
76
79
|
}
|
|
77
|
-
export interface
|
|
80
|
+
export interface KyaOsConfig {
|
|
78
81
|
/** Agent identity (DID + key material) */
|
|
79
|
-
identity:
|
|
82
|
+
identity: KyaOsIdentityConfig;
|
|
80
83
|
/** Session configuration overrides */
|
|
81
84
|
session?: Omit<SessionConfig, "nonceCache">;
|
|
82
85
|
/** Delegation verification overrides */
|
|
83
|
-
delegation?:
|
|
86
|
+
delegation?: KyaOsDelegationConfig;
|
|
84
87
|
/**
|
|
85
88
|
* When true, automatically creates a session on the first tool call
|
|
86
89
|
* if no session exists. Useful for demos and development where
|
|
87
|
-
* MCP clients don't support the `
|
|
88
|
-
* In production,
|
|
90
|
+
* MCP clients don't support the `_kyaos` handshake flow.
|
|
91
|
+
* In production, KYA-OS-aware runtimes should execute handshake before tool calls.
|
|
89
92
|
*/
|
|
90
93
|
autoSession?: boolean;
|
|
91
94
|
}
|
|
92
|
-
export interface
|
|
95
|
+
export interface KyaOsToolDefinition {
|
|
93
96
|
name: string;
|
|
94
97
|
description?: string;
|
|
95
98
|
inputSchema: {
|
|
@@ -99,7 +102,7 @@ export interface MCPIToolDefinition {
|
|
|
99
102
|
[key: string]: unknown;
|
|
100
103
|
};
|
|
101
104
|
}
|
|
102
|
-
export interface
|
|
105
|
+
export interface KyaOsToolHandler<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
103
106
|
(args: T, sessionId?: string): Promise<{
|
|
104
107
|
content: Array<{
|
|
105
108
|
type: string;
|
|
@@ -114,32 +117,32 @@ export interface MCPIToolHandler<T extends Record<string, unknown> = Record<stri
|
|
|
114
117
|
* Server interface — minimal subset of @modelcontextprotocol/sdk Server.
|
|
115
118
|
* This avoids a hard dependency on the SDK at the type level.
|
|
116
119
|
*/
|
|
117
|
-
export interface
|
|
120
|
+
export interface KyaOsServer {
|
|
118
121
|
setRequestHandler(schema: unknown, handler: (...args: unknown[]) => unknown): void;
|
|
119
122
|
}
|
|
120
|
-
export interface
|
|
123
|
+
export interface KyaOsMiddleware {
|
|
121
124
|
/** The identity config used by this middleware instance */
|
|
122
|
-
identity:
|
|
125
|
+
identity: KyaOsIdentityConfig;
|
|
123
126
|
/** The SessionManager instance for manual session operations */
|
|
124
127
|
sessionManager: SessionManager;
|
|
125
128
|
/** The ProofGenerator instance for manual proof operations */
|
|
126
129
|
proofGenerator: ProofGenerator;
|
|
127
130
|
/**
|
|
128
|
-
* Unified tool definition for `
|
|
131
|
+
* Unified tool definition for `_kyaos`.
|
|
129
132
|
* Include this in your ListToolsRequest handler's tool list.
|
|
130
133
|
*/
|
|
131
|
-
|
|
134
|
+
kyaOsTool: KyaOsToolDefinition;
|
|
132
135
|
/**
|
|
133
|
-
* @deprecated Use `
|
|
134
|
-
* Tool definition for `
|
|
136
|
+
* @deprecated Use `kyaOsTool` (`_kyaos` with `action: "handshake"`).
|
|
137
|
+
* Tool definition for `_kyaos_handshake`.
|
|
135
138
|
* Include this in your ListToolsRequest handler's tool list.
|
|
136
139
|
*/
|
|
137
|
-
handshakeTool:
|
|
140
|
+
handshakeTool: KyaOsToolDefinition;
|
|
138
141
|
/**
|
|
139
|
-
* Handle a unified `
|
|
140
|
-
* when `request.params.name === '
|
|
142
|
+
* Handle a unified `_kyaos` action. Use this in your CallToolRequest handler
|
|
143
|
+
* when `request.params.name === '_kyaos'`.
|
|
141
144
|
*/
|
|
142
|
-
|
|
145
|
+
handleKyaOs(args: Record<string, unknown>): Promise<{
|
|
143
146
|
content: Array<{
|
|
144
147
|
type: string;
|
|
145
148
|
text: string;
|
|
@@ -147,9 +150,9 @@ export interface MCPIMiddleware {
|
|
|
147
150
|
isError?: boolean;
|
|
148
151
|
}>;
|
|
149
152
|
/**
|
|
150
|
-
* @deprecated Use `
|
|
153
|
+
* @deprecated Use `handleKyaOs` with `action: "handshake"`.
|
|
151
154
|
* Handle a handshake call. Use this in your CallToolRequest handler
|
|
152
|
-
* when `request.params.name === '
|
|
155
|
+
* when `request.params.name === '_kyaos_handshake'`.
|
|
153
156
|
*/
|
|
154
157
|
handleHandshake(args: Record<string, unknown>): Promise<{
|
|
155
158
|
content: Array<{
|
|
@@ -162,41 +165,19 @@ export interface MCPIMiddleware {
|
|
|
162
165
|
* Wrap a tool handler to automatically generate proofs.
|
|
163
166
|
* Returns a new handler that appends proof metadata to the response.
|
|
164
167
|
*/
|
|
165
|
-
wrapWithProof<T extends Record<string, unknown> = Record<string, unknown>>(toolName: string, handler:
|
|
168
|
+
wrapWithProof<T extends Record<string, unknown> = Record<string, unknown>>(toolName: string, handler: KyaOsToolHandler<T>): KyaOsToolHandler;
|
|
166
169
|
/**
|
|
167
170
|
* Wrap a tool handler to require a valid W3C Delegation Credential.
|
|
168
171
|
*
|
|
169
|
-
* Caller must pass the VC as `
|
|
172
|
+
* Caller must pass the VC as `_kyaos_delegation` in the tool args.
|
|
170
173
|
* - If absent: returns a `needs_authorization` response with the consentUrl.
|
|
171
174
|
* - If present but invalid: returns a structured error with reason.
|
|
172
|
-
* - If valid with correct scope: strips `
|
|
175
|
+
* - If valid with correct scope: strips `_kyaos_delegation` and calls the handler.
|
|
173
176
|
*/
|
|
174
177
|
wrapWithDelegation(toolName: string, config: {
|
|
175
178
|
scopeId: string;
|
|
176
179
|
consentUrl: string;
|
|
177
|
-
}, handler:
|
|
180
|
+
}, handler: KyaOsToolHandler): KyaOsToolHandler;
|
|
178
181
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
*
|
|
182
|
-
* For most use cases, prefer {@link withMCPI} from `./with-mcpi-server.ts`
|
|
183
|
-
* which wraps this function and (by default) auto-registers handshake +
|
|
184
|
-
* auto-attaches proofs.
|
|
185
|
-
*
|
|
186
|
-
* Use `createMCPIMiddleware` directly when:
|
|
187
|
-
* - You use the low-level `Server` API (not `McpServer`)
|
|
188
|
-
* - You need custom request handler patterns
|
|
189
|
-
* - You want per-tool control over proof/delegation wrapping
|
|
190
|
-
*
|
|
191
|
-
* @param config - Agent identity and session configuration
|
|
192
|
-
* @param cryptoProvider - Platform-specific crypto implementation
|
|
193
|
-
* @returns Middleware components for session management and proof generation
|
|
194
|
-
*
|
|
195
|
-
* @remarks
|
|
196
|
-
* **Single-process only**: This middleware stores session state in memory using closure
|
|
197
|
-
* variables (`activeSessionId`, `sessionNonces`). It is NOT suitable for multi-instance
|
|
198
|
-
* deployments behind a load balancer. For distributed deployments, implement a custom
|
|
199
|
-
* `SessionStore` backed by Redis, DynamoDB, or similar and pass it via `config.session`.
|
|
200
|
-
*/
|
|
201
|
-
export declare function createMCPIMiddleware(config: MCPIConfig, cryptoProvider: CryptoProvider): MCPIMiddleware;
|
|
202
|
-
//# sourceMappingURL=with-mcpi.d.ts.map
|
|
182
|
+
export declare function createKyaOsMiddleware(config: KyaOsConfig, cryptoProvider: CryptoProvider): KyaOsMiddleware;
|
|
183
|
+
//# sourceMappingURL=with-kya-os.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-kya-os.d.ts","sourceRoot":"","sources":["../../src/middleware/with-kya-os.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,KAAK,cAAc,EACnB,aAAa,EACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,cAAc,EACd,KAAK,aAAa,EAEnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,cAAc,EAIf,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAEL,KAAK,WAAW,EAEhB,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