@sebastienrousseau/crypto-mcp 0.0.33 → 0.0.35
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/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +170 -177
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +47 -74
- package/package.json +19 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAE9D,eAAO,MAAM,SAAS,EAAE,WAAW,EAelC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAE9D,eAAO,MAAM,SAAS,EAAE,WAAW,EAelC,CAAC;AAoLF,wBAAsB,YAAY,CAChC,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,qBAAqB,CAAC,CAYhC"}
|
package/dist/resources/index.js
CHANGED
|
@@ -16,198 +16,191 @@ exports.RESOURCES = [
|
|
|
16
16
|
mimeType: "application/json",
|
|
17
17
|
},
|
|
18
18
|
];
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
{
|
|
37
|
-
level: 3,
|
|
38
|
-
name: "ML-KEM-768",
|
|
39
|
-
publicKeyBytes: 1184,
|
|
40
|
-
ciphertextBytes: 1088,
|
|
41
|
-
sharedSecretBytes: 32,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
level: 5,
|
|
45
|
-
name: "ML-KEM-1024",
|
|
46
|
-
publicKeyBytes: 1568,
|
|
47
|
-
ciphertextBytes: 1568,
|
|
48
|
-
sharedSecretBytes: 32,
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: "ML-DSA",
|
|
54
|
-
fips: 204,
|
|
55
|
-
type: "Digital Signature",
|
|
56
|
-
basis: "Module Learning with Errors (M-LWE)",
|
|
57
|
-
variants: [
|
|
58
|
-
{
|
|
59
|
-
level: 2,
|
|
60
|
-
name: "ML-DSA-44",
|
|
61
|
-
publicKeyBytes: 1312,
|
|
62
|
-
signatureBytes: 2420,
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
level: 3,
|
|
66
|
-
name: "ML-DSA-65",
|
|
67
|
-
publicKeyBytes: 1952,
|
|
68
|
-
signatureBytes: 3309,
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
level: 5,
|
|
72
|
-
name: "ML-DSA-87",
|
|
73
|
-
publicKeyBytes: 2592,
|
|
74
|
-
signatureBytes: 4627,
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
name: "SLH-DSA",
|
|
80
|
-
fips: 205,
|
|
81
|
-
type: "Stateless Hash-Based Digital Signature",
|
|
82
|
-
basis: "Hash Trees (SPHINCS+)",
|
|
83
|
-
variants: [
|
|
84
|
-
{
|
|
85
|
-
level: 1,
|
|
86
|
-
name: "SLH-DSA-128s",
|
|
87
|
-
publicKeyBytes: 32,
|
|
88
|
-
signatureBytes: 7856,
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
level: 5,
|
|
92
|
-
name: "SLH-DSA-256s",
|
|
93
|
-
publicKeyBytes: 64,
|
|
94
|
-
signatureBytes: 29792,
|
|
95
|
-
},
|
|
96
|
-
],
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
timelines: {
|
|
100
|
-
nsaCnsa2: {
|
|
101
|
-
softwareTransition: 2027,
|
|
102
|
-
webAndProtocols: 2030,
|
|
103
|
-
legacyDeprecation: 2033,
|
|
104
|
-
},
|
|
105
|
-
doraEnforcement: 2025,
|
|
106
|
-
cyberResilienceAct: 2027,
|
|
107
|
-
},
|
|
108
|
-
};
|
|
109
|
-
return {
|
|
110
|
-
contents: [
|
|
111
|
-
{
|
|
112
|
-
uri,
|
|
113
|
-
mimeType: "application/json",
|
|
114
|
-
text: JSON.stringify(data, null, 2),
|
|
115
|
-
},
|
|
116
|
-
],
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
if (uri === "crypto://algorithms/matrix") {
|
|
120
|
-
const matrix = {
|
|
121
|
-
symmetric: [
|
|
122
|
-
{
|
|
123
|
-
name: "AES-256-GCM",
|
|
124
|
-
securityBits: 256,
|
|
125
|
-
quantumSafe: true,
|
|
126
|
-
recommended: true,
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
name: "ChaCha20-Poly1305",
|
|
130
|
-
securityBits: 256,
|
|
131
|
-
quantumSafe: true,
|
|
132
|
-
recommended: true,
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
name: "3DES",
|
|
136
|
-
securityBits: 112,
|
|
137
|
-
quantumSafe: false,
|
|
138
|
-
recommended: false,
|
|
139
|
-
status: "DEPRECATED",
|
|
140
|
-
},
|
|
141
|
-
],
|
|
142
|
-
asymmetric: [
|
|
143
|
-
{
|
|
19
|
+
const PQC_STANDARDS = {
|
|
20
|
+
standards: [
|
|
21
|
+
{
|
|
22
|
+
name: "ML-KEM",
|
|
23
|
+
fips: 203,
|
|
24
|
+
type: "Key Encapsulation Mechanism",
|
|
25
|
+
basis: "Module Learning with Errors (M-LWE)",
|
|
26
|
+
variants: [
|
|
27
|
+
{
|
|
28
|
+
level: 1,
|
|
29
|
+
name: "ML-KEM-512",
|
|
30
|
+
publicKeyBytes: 800,
|
|
31
|
+
ciphertextBytes: 768,
|
|
32
|
+
sharedSecretBytes: 32,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
level: 3,
|
|
144
36
|
name: "ML-KEM-768",
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
standard: "FIPS 203",
|
|
37
|
+
publicKeyBytes: 1184,
|
|
38
|
+
ciphertextBytes: 1088,
|
|
39
|
+
sharedSecretBytes: 32,
|
|
149
40
|
},
|
|
150
41
|
{
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
42
|
+
level: 5,
|
|
43
|
+
name: "ML-KEM-1024",
|
|
44
|
+
publicKeyBytes: 1568,
|
|
45
|
+
ciphertextBytes: 1568,
|
|
46
|
+
sharedSecretBytes: 32,
|
|
156
47
|
},
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "ML-DSA",
|
|
52
|
+
fips: 204,
|
|
53
|
+
type: "Digital Signature",
|
|
54
|
+
basis: "Module Learning with Errors (M-LWE)",
|
|
55
|
+
variants: [
|
|
157
56
|
{
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
status: "PHASING_OUT",
|
|
57
|
+
level: 2,
|
|
58
|
+
name: "ML-DSA-44",
|
|
59
|
+
publicKeyBytes: 1312,
|
|
60
|
+
signatureBytes: 2420,
|
|
163
61
|
},
|
|
164
62
|
{
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
status: "PHASING_OUT",
|
|
63
|
+
level: 3,
|
|
64
|
+
name: "ML-DSA-65",
|
|
65
|
+
publicKeyBytes: 1952,
|
|
66
|
+
signatureBytes: 3309,
|
|
170
67
|
},
|
|
171
68
|
{
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
status: "PHASING_OUT",
|
|
69
|
+
level: 5,
|
|
70
|
+
name: "ML-DSA-87",
|
|
71
|
+
publicKeyBytes: 2592,
|
|
72
|
+
signatureBytes: 4627,
|
|
177
73
|
},
|
|
178
74
|
],
|
|
179
|
-
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "SLH-DSA",
|
|
78
|
+
fips: 205,
|
|
79
|
+
type: "Stateless Hash-Based Digital Signature",
|
|
80
|
+
basis: "Hash Trees (SPHINCS+)",
|
|
81
|
+
variants: [
|
|
180
82
|
{
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
83
|
+
level: 1,
|
|
84
|
+
name: "SLH-DSA-128s",
|
|
85
|
+
publicKeyBytes: 32,
|
|
86
|
+
signatureBytes: 7856,
|
|
185
87
|
},
|
|
186
88
|
{
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
name: "SHA-1",
|
|
194
|
-
securityBits: 0,
|
|
195
|
-
quantumSafe: false,
|
|
196
|
-
status: "BROKEN",
|
|
197
|
-
},
|
|
198
|
-
{ name: "MD5", securityBits: 0, quantumSafe: false, status: "BROKEN" },
|
|
199
|
-
],
|
|
200
|
-
};
|
|
201
|
-
return {
|
|
202
|
-
contents: [
|
|
203
|
-
{
|
|
204
|
-
uri,
|
|
205
|
-
mimeType: "application/json",
|
|
206
|
-
text: JSON.stringify(matrix, null, 2),
|
|
89
|
+
level: 5,
|
|
90
|
+
name: "SLH-DSA-256s",
|
|
91
|
+
publicKeyBytes: 64,
|
|
92
|
+
signatureBytes: 29792,
|
|
207
93
|
},
|
|
208
94
|
],
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
timelines: {
|
|
98
|
+
nsaCnsa2: {
|
|
99
|
+
softwareTransition: 2027,
|
|
100
|
+
webAndProtocols: 2030,
|
|
101
|
+
legacyDeprecation: 2033,
|
|
102
|
+
},
|
|
103
|
+
doraEnforcement: 2025,
|
|
104
|
+
cyberResilienceAct: 2027,
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
const ALGORITHM_MATRIX = {
|
|
108
|
+
symmetric: [
|
|
109
|
+
{
|
|
110
|
+
name: "AES-256-GCM",
|
|
111
|
+
securityBits: 256,
|
|
112
|
+
quantumSafe: true,
|
|
113
|
+
recommended: true,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "ChaCha20-Poly1305",
|
|
117
|
+
securityBits: 256,
|
|
118
|
+
quantumSafe: true,
|
|
119
|
+
recommended: true,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: "3DES",
|
|
123
|
+
securityBits: 112,
|
|
124
|
+
quantumSafe: false,
|
|
125
|
+
recommended: false,
|
|
126
|
+
status: "DEPRECATED",
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
asymmetric: [
|
|
130
|
+
{
|
|
131
|
+
name: "ML-KEM-768",
|
|
132
|
+
securityBits: 192,
|
|
133
|
+
quantumSafe: true,
|
|
134
|
+
recommended: true,
|
|
135
|
+
standard: "FIPS 203",
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: "RSA-2048",
|
|
139
|
+
securityBits: 112,
|
|
140
|
+
quantumSafe: false,
|
|
141
|
+
recommended: false,
|
|
142
|
+
status: "PHASING_OUT",
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "RSA-4096",
|
|
146
|
+
securityBits: 128,
|
|
147
|
+
quantumSafe: false,
|
|
148
|
+
recommended: false,
|
|
149
|
+
status: "PHASING_OUT",
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: "ECDSA (P-256)",
|
|
153
|
+
securityBits: 128,
|
|
154
|
+
quantumSafe: false,
|
|
155
|
+
recommended: false,
|
|
156
|
+
status: "PHASING_OUT",
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: "Ed25519",
|
|
160
|
+
securityBits: 128,
|
|
161
|
+
quantumSafe: false,
|
|
162
|
+
recommended: false,
|
|
163
|
+
status: "PHASING_OUT",
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
hashes: [
|
|
167
|
+
{
|
|
168
|
+
name: "SHA-256",
|
|
169
|
+
securityBits: 256,
|
|
170
|
+
quantumSafe: true,
|
|
171
|
+
status: "SECURE",
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: "SHA-512",
|
|
175
|
+
securityBits: 512,
|
|
176
|
+
quantumSafe: true,
|
|
177
|
+
status: "SECURE",
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: "SHA-1",
|
|
181
|
+
securityBits: 0,
|
|
182
|
+
quantumSafe: false,
|
|
183
|
+
status: "BROKEN",
|
|
184
|
+
},
|
|
185
|
+
{ name: "MD5", securityBits: 0, quantumSafe: false, status: "BROKEN" },
|
|
186
|
+
],
|
|
187
|
+
};
|
|
188
|
+
const CONTENTS = new Map([
|
|
189
|
+
["crypto://standards/pqc", PQC_STANDARDS],
|
|
190
|
+
["crypto://algorithms/matrix", ALGORITHM_MATRIX],
|
|
191
|
+
]);
|
|
192
|
+
async function readResource(uri) {
|
|
193
|
+
const data = CONTENTS.get(uri);
|
|
194
|
+
if (data === undefined)
|
|
195
|
+
throw new Error(`Resource not found: ${uri}`);
|
|
196
|
+
return {
|
|
197
|
+
contents: [
|
|
198
|
+
{
|
|
199
|
+
uri,
|
|
200
|
+
mimeType: "application/json",
|
|
201
|
+
text: JSON.stringify(data, null, 2),
|
|
202
|
+
},
|
|
203
|
+
],
|
|
204
|
+
};
|
|
212
205
|
}
|
|
213
206
|
//# sourceMappingURL=index.js.map
|
package/dist/server.d.ts
CHANGED
|
@@ -6,7 +6,9 @@ export declare class CryptoMcpServer {
|
|
|
6
6
|
private readonly name;
|
|
7
7
|
private readonly version;
|
|
8
8
|
isInitialized(): boolean;
|
|
9
|
+
private readonly handlers;
|
|
9
10
|
handleRequest(request: JSONRPCRequest): Promise<JSONRPCResponse>;
|
|
11
|
+
private initialize;
|
|
10
12
|
listenStdio(input?: NodeJS.ReadableStream, output?: NodeJS.WritableStream): void;
|
|
11
13
|
}
|
|
12
14
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAuB,MAAM,SAAS,CAAC;AAc/E,eAAO,MAAM,mBAAmB,QAId,CAAC;AAOnB,eAAO,MAAM,cAAc,EAAE,MAIpB,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAuB,MAAM,SAAS,CAAC;AAc/E,eAAO,MAAM,mBAAmB,QAId,CAAC;AAOnB,eAAO,MAAM,cAAc,EAAE,MAIpB,CAAC;AAyBV,qBAAa,eAAe;IAC1B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAoB;IACzC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkB;IAKnC,aAAa,IAAI,OAAO;IAS/B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAYtB;IAKU,aAAa,CACxB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC;YAiBb,UAAU;IAoBjB,WAAW,CAChB,KAAK,GAAE,MAAM,CAAC,cAA8B,EAC5C,MAAM,GAAE,MAAM,CAAC,cAA+B,GAC7C,IAAI;CA0BR"}
|
package/dist/server.js
CHANGED
|
@@ -16,6 +16,16 @@ exports.SERVER_INSTRUCTIONS = "Cryptographic tools that keep key material inside
|
|
|
16
16
|
"encrypt, decrypt, sign, KEM and KMS tools. No tool returns a private " +
|
|
17
17
|
"or secret key.";
|
|
18
18
|
exports.SERVER_VERSION = JSON.parse(node_fs_1.default.readFileSync(node_path_1.default.join(__dirname, "..", "package.json"), "utf8")).version;
|
|
19
|
+
const fail = (id, code, message) => ({ jsonrpc: "2.0", id, error: { code, message } });
|
|
20
|
+
async function callTool(params) {
|
|
21
|
+
const toolName = (0, protocol_1.requireName)(params, tools_1.TOOLS, "tool");
|
|
22
|
+
return (0, tools_1.executeTool)(toolName, (0, protocol_1.requireArguments)(params));
|
|
23
|
+
}
|
|
24
|
+
async function promptFor(params) {
|
|
25
|
+
const promptName = (0, protocol_1.requireName)(params, prompts_1.PROMPTS, "prompt");
|
|
26
|
+
const promptArgs = (0, protocol_1.requirePromptArguments)(prompts_1.PROMPTS.find((p) => p.name === promptName)?.arguments, (0, protocol_1.requireArguments)(params));
|
|
27
|
+
return (0, prompts_1.getPrompt)(promptName, promptArgs);
|
|
28
|
+
}
|
|
19
29
|
class CryptoMcpServer {
|
|
20
30
|
initialized = false;
|
|
21
31
|
name = "crypto-service";
|
|
@@ -23,89 +33,52 @@ class CryptoMcpServer {
|
|
|
23
33
|
isInitialized() {
|
|
24
34
|
return this.initialized;
|
|
25
35
|
}
|
|
36
|
+
handlers = new Map([
|
|
37
|
+
["initialize", (params) => this.initialize(params)],
|
|
38
|
+
["ping", async () => ({})],
|
|
39
|
+
["tools/list", async () => ({ tools: tools_1.TOOLS })],
|
|
40
|
+
["tools/call", callTool],
|
|
41
|
+
["resources/list", async () => ({ resources: resources_1.RESOURCES })],
|
|
42
|
+
[
|
|
43
|
+
"resources/read",
|
|
44
|
+
(params) => (0, resources_1.readResource)(params ? String(params.uri) : ""),
|
|
45
|
+
],
|
|
46
|
+
["prompts/list", async () => ({ prompts: prompts_1.PROMPTS })],
|
|
47
|
+
["prompts/get", promptFor],
|
|
48
|
+
]);
|
|
26
49
|
async handleRequest(request) {
|
|
27
50
|
const id = request.id ?? null;
|
|
28
51
|
if (!request.jsonrpc || request.jsonrpc !== "2.0") {
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
message: "Invalid Request: jsonrpc must be '2.0'",
|
|
35
|
-
},
|
|
36
|
-
};
|
|
52
|
+
return fail(id, -32600, "Invalid Request: jsonrpc must be '2.0'");
|
|
53
|
+
}
|
|
54
|
+
const handler = this.handlers.get(request.method);
|
|
55
|
+
if (!handler) {
|
|
56
|
+
return fail(id, -32601, `Method not found: ${request.method}`);
|
|
37
57
|
}
|
|
38
58
|
try {
|
|
39
|
-
|
|
40
|
-
case "initialize": {
|
|
41
|
-
this.initialized = true;
|
|
42
|
-
const result = {
|
|
43
|
-
protocolVersion: (0, protocol_1.negotiateProtocolVersion)(request.params?.protocolVersion),
|
|
44
|
-
capabilities: {
|
|
45
|
-
tools: {},
|
|
46
|
-
resources: {},
|
|
47
|
-
prompts: {},
|
|
48
|
-
},
|
|
49
|
-
serverInfo: {
|
|
50
|
-
name: this.name,
|
|
51
|
-
version: this.version,
|
|
52
|
-
},
|
|
53
|
-
instructions: exports.SERVER_INSTRUCTIONS,
|
|
54
|
-
};
|
|
55
|
-
return { jsonrpc: "2.0", id, result };
|
|
56
|
-
}
|
|
57
|
-
case "ping": {
|
|
58
|
-
return { jsonrpc: "2.0", id, result: {} };
|
|
59
|
-
}
|
|
60
|
-
case "tools/list": {
|
|
61
|
-
return { jsonrpc: "2.0", id, result: { tools: tools_1.TOOLS } };
|
|
62
|
-
}
|
|
63
|
-
case "tools/call": {
|
|
64
|
-
const toolName = (0, protocol_1.requireName)(request.params, tools_1.TOOLS, "tool");
|
|
65
|
-
const toolArgs = (0, protocol_1.requireArguments)(request.params);
|
|
66
|
-
const result = await (0, tools_1.executeTool)(toolName, toolArgs);
|
|
67
|
-
return { jsonrpc: "2.0", id, result };
|
|
68
|
-
}
|
|
69
|
-
case "resources/list": {
|
|
70
|
-
return { jsonrpc: "2.0", id, result: { resources: resources_1.RESOURCES } };
|
|
71
|
-
}
|
|
72
|
-
case "resources/read": {
|
|
73
|
-
const params = request.params;
|
|
74
|
-
const uri = params ? String(params.uri) : "";
|
|
75
|
-
const result = await (0, resources_1.readResource)(uri);
|
|
76
|
-
return { jsonrpc: "2.0", id, result };
|
|
77
|
-
}
|
|
78
|
-
case "prompts/list": {
|
|
79
|
-
return { jsonrpc: "2.0", id, result: { prompts: prompts_1.PROMPTS } };
|
|
80
|
-
}
|
|
81
|
-
case "prompts/get": {
|
|
82
|
-
const promptName = (0, protocol_1.requireName)(request.params, prompts_1.PROMPTS, "prompt");
|
|
83
|
-
const promptArgs = (0, protocol_1.requirePromptArguments)(prompts_1.PROMPTS.find((p) => p.name === promptName)?.arguments, (0, protocol_1.requireArguments)(request.params));
|
|
84
|
-
const result = await (0, prompts_1.getPrompt)(promptName, promptArgs);
|
|
85
|
-
return { jsonrpc: "2.0", id, result };
|
|
86
|
-
}
|
|
87
|
-
default:
|
|
88
|
-
return {
|
|
89
|
-
jsonrpc: "2.0",
|
|
90
|
-
id,
|
|
91
|
-
error: {
|
|
92
|
-
code: -32601,
|
|
93
|
-
message: `Method not found: ${request.method}`,
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
}
|
|
59
|
+
return { jsonrpc: "2.0", id, result: await handler(request.params) };
|
|
97
60
|
}
|
|
98
61
|
catch (err) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
id,
|
|
102
|
-
error: {
|
|
103
|
-
code: err instanceof protocol_1.McpError ? err.code : -32603,
|
|
104
|
-
message: err.message,
|
|
105
|
-
},
|
|
106
|
-
};
|
|
62
|
+
const code = err instanceof protocol_1.McpError ? err.code : -32603;
|
|
63
|
+
return fail(id, code, err.message);
|
|
107
64
|
}
|
|
108
65
|
}
|
|
66
|
+
async initialize(params) {
|
|
67
|
+
this.initialized = true;
|
|
68
|
+
return {
|
|
69
|
+
protocolVersion: (0, protocol_1.negotiateProtocolVersion)(params?.protocolVersion),
|
|
70
|
+
capabilities: {
|
|
71
|
+
tools: {},
|
|
72
|
+
resources: {},
|
|
73
|
+
prompts: {},
|
|
74
|
+
},
|
|
75
|
+
serverInfo: {
|
|
76
|
+
name: this.name,
|
|
77
|
+
version: this.version,
|
|
78
|
+
},
|
|
79
|
+
instructions: exports.SERVER_INSTRUCTIONS,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
109
82
|
listenStdio(input = process.stdin, output = process.stdout) {
|
|
110
83
|
const rl = node_readline_1.default.createInterface({
|
|
111
84
|
input,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sebastienrousseau/crypto-mcp",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Model Context Protocol (MCP) server
|
|
3
|
+
"version": "0.0.35",
|
|
4
|
+
"description": "Model Context Protocol (MCP) server that gives AI assistants and agents cryptography tools: key generation, encryption, ML-KEM, ML-DSA signing, hashing, streaming encryption, KMS and CBOM.",
|
|
5
5
|
"author": "Sebastien Rousseau <sebastienrousseau@users.noreply.github.com>",
|
|
6
6
|
"license": "MIT OR Apache-2.0",
|
|
7
7
|
"engines": {
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"dist/**/*.d.ts.map"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@sebastienrousseau/crypto-
|
|
32
|
-
"@sebastienrousseau/crypto-
|
|
33
|
-
"@sebastienrousseau/crypto-
|
|
31
|
+
"@sebastienrousseau/crypto-lib": "0.0.35",
|
|
32
|
+
"@sebastienrousseau/crypto-kms": "0.0.35",
|
|
33
|
+
"@sebastienrousseau/crypto-wasm": "0.0.35"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/chai": "^5.2.3",
|
|
@@ -56,6 +56,20 @@
|
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
58
|
"private": false,
|
|
59
|
+
"keywords": [
|
|
60
|
+
"mcp",
|
|
61
|
+
"model-context-protocol",
|
|
62
|
+
"mcp-server",
|
|
63
|
+
"ai-agents",
|
|
64
|
+
"llm",
|
|
65
|
+
"claude",
|
|
66
|
+
"cryptography",
|
|
67
|
+
"encryption",
|
|
68
|
+
"post-quantum",
|
|
69
|
+
"pqc",
|
|
70
|
+
"ml-kem",
|
|
71
|
+
"ml-dsa"
|
|
72
|
+
],
|
|
59
73
|
"scripts": {
|
|
60
74
|
"build": "tsc --build tsconfig.json",
|
|
61
75
|
"clean": "rimraf ./coverage ./dist ./docs",
|