@icoretech/warden-mcp 0.2.3 → 0.2.5
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/README.md +7 -1
- package/bin/patch-bitwarden-cli-lib.js +64 -99
- package/dist/tools/registerTools.js +28 -0
- package/dist/transports/http.js +2 -1
- package/dist/transports/stdio.js +2 -1
- package/dist/version.js +2 -0
- package/package.json +7 -9
- package/patches/@bitwarden+cli+2026.2.0.patch +0 -80
package/README.md
CHANGED
|
@@ -69,7 +69,9 @@ not continuously proven in CI without a real Bitwarden tenant.
|
|
|
69
69
|
This repository's compose smoke now exercises both direct `bw` auth flows and
|
|
70
70
|
the MCP/SDK layers with username/password auth plus user API-key auth against a
|
|
71
71
|
real local Vaultwarden, so `@bitwarden/cli` bumps do not rely on unit coverage
|
|
72
|
-
alone.
|
|
72
|
+
alone. The bundled postinstall compatibility shim rewrites the affected
|
|
73
|
+
`build/bw.js` login strategies in place so the same Vaultwarden fallback can
|
|
74
|
+
survive compatible CLI bumps without a version-stamped patch artifact.
|
|
73
75
|
|
|
74
76
|
## Install And Run
|
|
75
77
|
|
|
@@ -508,6 +510,10 @@ raw CLI plus MCP/SDK layers:
|
|
|
508
510
|
- user/password login from `.env.test`
|
|
509
511
|
- api-key login from `tmp/vaultwarden-bootstrap/apikey.env`, generated by the bootstrap step and kept out of git via `tmp/`
|
|
510
512
|
|
|
513
|
+
The compose bootstrap step depends on the Playwright Docker image matching the
|
|
514
|
+
`playwright` npm package version. If either moves, update the other in the same
|
|
515
|
+
change.
|
|
516
|
+
|
|
511
517
|
Run session flood regression locally (guardrail sanity):
|
|
512
518
|
|
|
513
519
|
```bash
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { existsSync, rmSync, writeFileSync } from 'node:fs';
|
|
1
|
+
import { readFileSync, writeFileSync } from 'node:fs';
|
|
3
2
|
import { createRequire } from 'node:module';
|
|
4
|
-
import { dirname,
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
5
4
|
import { fileURLToPath } from 'node:url';
|
|
6
5
|
|
|
7
6
|
const require = createRequire(import.meta.url);
|
|
8
|
-
const
|
|
9
|
-
const defaultPackageDir = resolve(__dirname, '..');
|
|
7
|
+
const compatMarker = 'icoretech-vaultwarden-compat';
|
|
10
8
|
|
|
11
9
|
function isModuleNotFoundFor(specifier, error) {
|
|
12
10
|
if (!(error instanceof Error)) return false;
|
|
@@ -14,134 +12,101 @@ function isModuleNotFoundFor(specifier, error) {
|
|
|
14
12
|
return error.message.includes(specifier);
|
|
15
13
|
}
|
|
16
14
|
|
|
17
|
-
export function
|
|
18
|
-
let currentDir = dirname(packageJsonPath);
|
|
19
|
-
|
|
20
|
-
while (true) {
|
|
21
|
-
const parentDir = dirname(currentDir);
|
|
22
|
-
if (parentDir === currentDir) break;
|
|
23
|
-
if (
|
|
24
|
-
currentDir.endsWith('/node_modules') ||
|
|
25
|
-
currentDir.endsWith('\\node_modules')
|
|
26
|
-
) {
|
|
27
|
-
return parentDir;
|
|
28
|
-
}
|
|
29
|
-
currentDir = parentDir;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
throw new Error(
|
|
33
|
-
`[warden-mcp] could not determine install root from ${packageJsonPath}`,
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function resolvePatchPackagePlan({
|
|
38
|
-
packageDir = defaultPackageDir,
|
|
15
|
+
export function resolveBundledBwCliPath({
|
|
39
16
|
resolveDependency = (specifier) => require.resolve(specifier),
|
|
40
|
-
exists = existsSync,
|
|
41
17
|
} = {}) {
|
|
42
|
-
const patchesDir = resolve(packageDir, 'patches');
|
|
43
|
-
if (!exists(patchesDir)) {
|
|
44
|
-
throw new Error(
|
|
45
|
-
`[warden-mcp] patches directory not found at ${patchesDir}`,
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
let cliPackageJsonPath;
|
|
50
18
|
try {
|
|
51
|
-
cliPackageJsonPath = resolveDependency('@bitwarden/cli/package.json');
|
|
19
|
+
const cliPackageJsonPath = resolveDependency('@bitwarden/cli/package.json');
|
|
20
|
+
return join(dirname(cliPackageJsonPath), 'build', 'bw.js');
|
|
52
21
|
} catch (error) {
|
|
53
22
|
if (isModuleNotFoundFor('@bitwarden/cli/package.json', error)) {
|
|
54
23
|
return null;
|
|
55
24
|
}
|
|
56
25
|
throw error;
|
|
57
26
|
}
|
|
27
|
+
}
|
|
58
28
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
'--error-on-fail',
|
|
74
|
-
],
|
|
75
|
-
};
|
|
29
|
+
function buildCompatBlock(indent) {
|
|
30
|
+
return [
|
|
31
|
+
`${indent}/* ${compatMarker} */`,
|
|
32
|
+
`${indent}if (response.accountKeysResponseModel) {`,
|
|
33
|
+
`${indent} yield this.accountCryptographicStateService.setAccountCryptographicState(response.accountKeysResponseModel.toWrappedAccountCryptographicState(), userId);`,
|
|
34
|
+
`${indent}}`,
|
|
35
|
+
`${indent}else if (response.privateKey) {`,
|
|
36
|
+
`${indent} yield this.accountCryptographicStateService.setAccountCryptographicState({`,
|
|
37
|
+
`${indent} V1: {`,
|
|
38
|
+
`${indent} private_key: response.privateKey,`,
|
|
39
|
+
`${indent} },`,
|
|
40
|
+
`${indent} }, userId);`,
|
|
41
|
+
`${indent}}`,
|
|
42
|
+
].join('\n');
|
|
76
43
|
}
|
|
77
44
|
|
|
78
|
-
const
|
|
79
|
-
{
|
|
80
|
-
null,
|
|
81
|
-
2,
|
|
82
|
-
)}\n`;
|
|
45
|
+
const strategyMethodRegex =
|
|
46
|
+
/(setAccountCryptographicState\(response, userId\) \{\n\s+return [^\n]+\(\s*this, void 0, void 0, function\* \(\) \{\n)(\s*)yield this\.accountCryptographicStateService\.setAccountCryptographicState\(response\.accountKeysResponseModel\.toWrappedAccountCryptographicState\(\), userId\);\n(\s*\}\);\n\s*\})/g;
|
|
83
47
|
|
|
84
|
-
export function
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
48
|
+
export function patchBundledBwSource(source) {
|
|
49
|
+
let replacements = 0;
|
|
50
|
+
|
|
51
|
+
const patchedSource = source.replace(
|
|
52
|
+
strategyMethodRegex,
|
|
53
|
+
(_match, prefix, indent, suffix) => {
|
|
54
|
+
replacements += 1;
|
|
55
|
+
return `${prefix}${buildCompatBlock(indent)}\n${suffix}`;
|
|
56
|
+
},
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
if (replacements > 0) {
|
|
60
|
+
return { source: patchedSource, replacements };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (source.includes(compatMarker)) {
|
|
64
|
+
return { source, replacements: 0 };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
throw new Error(
|
|
68
|
+
'[warden-mcp] could not locate the expected setAccountCryptographicState blocks in @bitwarden/cli/build/bw.js',
|
|
69
|
+
);
|
|
93
70
|
}
|
|
94
71
|
|
|
95
72
|
export function applyBundledBwPatch({
|
|
96
|
-
packageDir = defaultPackageDir,
|
|
97
73
|
resolveDependency,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
nodeExecPath = process.execPath,
|
|
101
|
-
writeFile,
|
|
102
|
-
removeFile = (path) => rmSync(path, { force: true }),
|
|
74
|
+
readFile = (path) => readFileSync(path, 'utf8'),
|
|
75
|
+
writeFile = (path, contents) => writeFileSync(path, contents),
|
|
103
76
|
logError = (message) => console.error(message),
|
|
104
77
|
} = {}) {
|
|
105
|
-
let
|
|
78
|
+
let bwCliPath;
|
|
106
79
|
try {
|
|
107
|
-
|
|
80
|
+
bwCliPath = resolveBundledBwCliPath({ resolveDependency });
|
|
108
81
|
} catch (error) {
|
|
109
82
|
const message =
|
|
110
83
|
error instanceof Error
|
|
111
84
|
? error.message
|
|
112
|
-
: '[warden-mcp] failed to
|
|
85
|
+
: '[warden-mcp] failed to resolve @bitwarden/cli';
|
|
113
86
|
logError(message);
|
|
114
87
|
return 1;
|
|
115
88
|
}
|
|
116
89
|
|
|
117
|
-
if (!
|
|
90
|
+
if (!bwCliPath) return 0;
|
|
118
91
|
|
|
119
|
-
const temporaryPackageJsonPath = ensurePatchPackageAppRoot({
|
|
120
|
-
appRoot: plan.cwd,
|
|
121
|
-
exists,
|
|
122
|
-
writeFile,
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
let result;
|
|
126
92
|
try {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
removeFile(temporaryPackageJsonPath);
|
|
93
|
+
const currentSource = readFile(bwCliPath);
|
|
94
|
+
const { source: patchedSource, replacements } =
|
|
95
|
+
patchBundledBwSource(currentSource);
|
|
96
|
+
|
|
97
|
+
if (replacements > 0) {
|
|
98
|
+
writeFile(bwCliPath, patchedSource);
|
|
134
99
|
}
|
|
135
|
-
}
|
|
136
100
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
101
|
+
return 0;
|
|
102
|
+
} catch (error) {
|
|
103
|
+
const message =
|
|
104
|
+
error instanceof Error
|
|
105
|
+
? error.message
|
|
106
|
+
: '[warden-mcp] failed to patch bundled @bitwarden/cli';
|
|
107
|
+
logError(message);
|
|
141
108
|
return 1;
|
|
142
109
|
}
|
|
143
|
-
|
|
144
|
-
return result.status ?? 1;
|
|
145
110
|
}
|
|
146
111
|
|
|
147
112
|
export function isDirectRun(importMetaUrl, argv = process.argv) {
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
export function registerTools(server, deps) {
|
|
4
4
|
const toolMeta = {};
|
|
5
|
+
const mutatingToolAnnotations = {
|
|
6
|
+
readOnlyHint: false,
|
|
7
|
+
destructiveHint: false,
|
|
8
|
+
};
|
|
9
|
+
const destructiveToolAnnotations = {
|
|
10
|
+
readOnlyHint: false,
|
|
11
|
+
destructiveHint: true,
|
|
12
|
+
};
|
|
5
13
|
const rawRegisterTool = server.registerTool.bind(server);
|
|
6
14
|
const legacyPrefix = `${deps.toolPrefix}.`;
|
|
7
15
|
const publicPrefix = `${deps.toolPrefix}${deps.toolSeparator}`;
|
|
@@ -244,6 +252,7 @@ export function registerTools(server, deps) {
|
|
|
244
252
|
registerTool(`${deps.toolPrefix}.create_folder`, {
|
|
245
253
|
title: 'Create Folder',
|
|
246
254
|
description: 'Create a Bitwarden folder (personal).',
|
|
255
|
+
annotations: mutatingToolAnnotations,
|
|
247
256
|
inputSchema: {
|
|
248
257
|
name: z.string(),
|
|
249
258
|
},
|
|
@@ -261,6 +270,7 @@ export function registerTools(server, deps) {
|
|
|
261
270
|
registerTool(`${deps.toolPrefix}.edit_folder`, {
|
|
262
271
|
title: 'Edit Folder',
|
|
263
272
|
description: 'Rename a Bitwarden folder (personal).',
|
|
273
|
+
annotations: mutatingToolAnnotations,
|
|
264
274
|
inputSchema: {
|
|
265
275
|
id: z.string(),
|
|
266
276
|
name: z.string(),
|
|
@@ -279,6 +289,7 @@ export function registerTools(server, deps) {
|
|
|
279
289
|
registerTool(`${deps.toolPrefix}.delete_folder`, {
|
|
280
290
|
title: 'Delete Folder',
|
|
281
291
|
description: 'Delete a Bitwarden folder (personal).',
|
|
292
|
+
annotations: destructiveToolAnnotations,
|
|
282
293
|
inputSchema: {
|
|
283
294
|
id: z.string(),
|
|
284
295
|
},
|
|
@@ -326,6 +337,7 @@ export function registerTools(server, deps) {
|
|
|
326
337
|
registerTool(`${deps.toolPrefix}.create_org_collection`, {
|
|
327
338
|
title: 'Create Org Collection',
|
|
328
339
|
description: 'Create an organization collection.',
|
|
340
|
+
annotations: mutatingToolAnnotations,
|
|
329
341
|
inputSchema: {
|
|
330
342
|
organizationId: z.string(),
|
|
331
343
|
name: z.string(),
|
|
@@ -344,6 +356,7 @@ export function registerTools(server, deps) {
|
|
|
344
356
|
registerTool(`${deps.toolPrefix}.edit_org_collection`, {
|
|
345
357
|
title: 'Edit Org Collection',
|
|
346
358
|
description: 'Rename an organization collection.',
|
|
359
|
+
annotations: mutatingToolAnnotations,
|
|
347
360
|
inputSchema: {
|
|
348
361
|
organizationId: z.string(),
|
|
349
362
|
id: z.string(),
|
|
@@ -363,6 +376,7 @@ export function registerTools(server, deps) {
|
|
|
363
376
|
registerTool(`${deps.toolPrefix}.delete_org_collection`, {
|
|
364
377
|
title: 'Delete Org Collection',
|
|
365
378
|
description: 'Delete an organization collection.',
|
|
379
|
+
annotations: destructiveToolAnnotations,
|
|
366
380
|
inputSchema: {
|
|
367
381
|
organizationId: z.string(),
|
|
368
382
|
id: z.string(),
|
|
@@ -381,6 +395,7 @@ export function registerTools(server, deps) {
|
|
|
381
395
|
registerTool(`${deps.toolPrefix}.move_item_to_organization`, {
|
|
382
396
|
title: 'Move Item To Organization',
|
|
383
397
|
description: 'Move an item to an organization (optionally assigning collection ids).',
|
|
398
|
+
annotations: mutatingToolAnnotations,
|
|
384
399
|
inputSchema: {
|
|
385
400
|
id: z.string(),
|
|
386
401
|
organizationId: z.string(),
|
|
@@ -617,6 +632,7 @@ export function registerTools(server, deps) {
|
|
|
617
632
|
registerTool(`${deps.toolPrefix}.delete_item`, {
|
|
618
633
|
title: 'Delete Item',
|
|
619
634
|
description: 'Delete an item by id (soft-delete by default; set permanent=true to hard delete).',
|
|
635
|
+
annotations: destructiveToolAnnotations,
|
|
620
636
|
inputSchema: {
|
|
621
637
|
id: z.string(),
|
|
622
638
|
permanent: z.boolean().optional(),
|
|
@@ -635,6 +651,7 @@ export function registerTools(server, deps) {
|
|
|
635
651
|
registerTool(`${deps.toolPrefix}.delete_items`, {
|
|
636
652
|
title: 'Delete Items',
|
|
637
653
|
description: 'Delete multiple items by id. Returns per-id results (soft-delete by default; set permanent=true to hard delete).',
|
|
654
|
+
annotations: destructiveToolAnnotations,
|
|
638
655
|
inputSchema: {
|
|
639
656
|
ids: z.array(z.string()).min(1).max(200),
|
|
640
657
|
permanent: z.boolean().optional(),
|
|
@@ -656,6 +673,7 @@ export function registerTools(server, deps) {
|
|
|
656
673
|
registerTool(`${deps.toolPrefix}.restore_item`, {
|
|
657
674
|
title: 'Restore Item',
|
|
658
675
|
description: 'Restore an item from trash by id.',
|
|
676
|
+
annotations: mutatingToolAnnotations,
|
|
659
677
|
inputSchema: {
|
|
660
678
|
id: z.string(),
|
|
661
679
|
},
|
|
@@ -673,6 +691,7 @@ export function registerTools(server, deps) {
|
|
|
673
691
|
registerTool(`${deps.toolPrefix}.create_attachment`, {
|
|
674
692
|
title: 'Create Attachment',
|
|
675
693
|
description: 'Attach a file (base64) to an existing item. Returns the updated (redacted) item.',
|
|
694
|
+
annotations: mutatingToolAnnotations,
|
|
676
695
|
inputSchema: {
|
|
677
696
|
itemId: z.string(),
|
|
678
697
|
filename: z.string(),
|
|
@@ -693,6 +712,7 @@ export function registerTools(server, deps) {
|
|
|
693
712
|
registerTool(`${deps.toolPrefix}.delete_attachment`, {
|
|
694
713
|
title: 'Delete Attachment',
|
|
695
714
|
description: 'Delete an attachment from an item. Returns the updated (redacted) item.',
|
|
715
|
+
annotations: destructiveToolAnnotations,
|
|
696
716
|
inputSchema: {
|
|
697
717
|
itemId: z.string(),
|
|
698
718
|
attachmentId: z.string(),
|
|
@@ -999,6 +1019,7 @@ export function registerTools(server, deps) {
|
|
|
999
1019
|
registerTool(`${deps.toolPrefix}.create_login`, {
|
|
1000
1020
|
title: 'Create Login',
|
|
1001
1021
|
description: 'Create a login item.',
|
|
1022
|
+
annotations: mutatingToolAnnotations,
|
|
1002
1023
|
inputSchema: {
|
|
1003
1024
|
name: z.string(),
|
|
1004
1025
|
username: z.string().optional(),
|
|
@@ -1046,6 +1067,7 @@ export function registerTools(server, deps) {
|
|
|
1046
1067
|
registerTool(`${deps.toolPrefix}.create_logins`, {
|
|
1047
1068
|
title: 'Create Logins',
|
|
1048
1069
|
description: 'Create multiple login items in a single call.',
|
|
1070
|
+
annotations: mutatingToolAnnotations,
|
|
1049
1071
|
inputSchema: {
|
|
1050
1072
|
items: z.array(z.object({
|
|
1051
1073
|
name: z.string(),
|
|
@@ -1101,6 +1123,7 @@ export function registerTools(server, deps) {
|
|
|
1101
1123
|
registerTool(`${deps.toolPrefix}.set_login_uris`, {
|
|
1102
1124
|
title: 'Set Login URIs',
|
|
1103
1125
|
description: 'Set or update the URIs (and per-URI match types) for a login item. mode=replace overwrites; mode=merge updates/adds by uri.',
|
|
1126
|
+
annotations: mutatingToolAnnotations,
|
|
1104
1127
|
inputSchema: {
|
|
1105
1128
|
id: z.string(),
|
|
1106
1129
|
mode: z.enum(['replace', 'merge']).optional(),
|
|
@@ -1129,6 +1152,7 @@ export function registerTools(server, deps) {
|
|
|
1129
1152
|
registerTool(`${deps.toolPrefix}.create_note`, {
|
|
1130
1153
|
title: 'Create Note',
|
|
1131
1154
|
description: 'Create a secure note item.',
|
|
1155
|
+
annotations: mutatingToolAnnotations,
|
|
1132
1156
|
inputSchema: {
|
|
1133
1157
|
name: z.string(),
|
|
1134
1158
|
notes: z.string().optional(),
|
|
@@ -1158,6 +1182,7 @@ export function registerTools(server, deps) {
|
|
|
1158
1182
|
registerTool(`${deps.toolPrefix}.create_ssh_key`, {
|
|
1159
1183
|
title: 'Create SSH Key',
|
|
1160
1184
|
description: 'Create an SSH key object (stored as secure note with fields).',
|
|
1185
|
+
annotations: mutatingToolAnnotations,
|
|
1161
1186
|
inputSchema: {
|
|
1162
1187
|
name: z.string(),
|
|
1163
1188
|
publicKey: z.string(),
|
|
@@ -1184,6 +1209,7 @@ export function registerTools(server, deps) {
|
|
|
1184
1209
|
registerTool(`${deps.toolPrefix}.create_card`, {
|
|
1185
1210
|
title: 'Create Card',
|
|
1186
1211
|
description: 'Create a payment card item.',
|
|
1212
|
+
annotations: mutatingToolAnnotations,
|
|
1187
1213
|
inputSchema: {
|
|
1188
1214
|
name: z.string(),
|
|
1189
1215
|
cardholderName: z.string().optional(),
|
|
@@ -1219,6 +1245,7 @@ export function registerTools(server, deps) {
|
|
|
1219
1245
|
registerTool(`${deps.toolPrefix}.create_identity`, {
|
|
1220
1246
|
title: 'Create Identity',
|
|
1221
1247
|
description: 'Create an identity item.',
|
|
1248
|
+
annotations: mutatingToolAnnotations,
|
|
1222
1249
|
inputSchema: {
|
|
1223
1250
|
name: z.string(),
|
|
1224
1251
|
identity: z
|
|
@@ -1270,6 +1297,7 @@ export function registerTools(server, deps) {
|
|
|
1270
1297
|
registerTool(`${deps.toolPrefix}.update_item`, {
|
|
1271
1298
|
title: 'Update Item',
|
|
1272
1299
|
description: 'Update selected fields of an item by id.',
|
|
1300
|
+
annotations: mutatingToolAnnotations,
|
|
1273
1301
|
inputSchema: {
|
|
1274
1302
|
id: z.string(),
|
|
1275
1303
|
patch: z.object({
|
package/dist/transports/http.js
CHANGED
|
@@ -8,6 +8,7 @@ import { bwEnvFromHeadersOrEnv } from '../bw/bwHeaders.js';
|
|
|
8
8
|
import { BwSessionPool } from '../bw/bwPool.js';
|
|
9
9
|
import { KeychainSdk } from '../sdk/keychainSdk.js';
|
|
10
10
|
import { registerTools } from '../tools/registerTools.js';
|
|
11
|
+
import { SERVER_VERSION } from '../version.js';
|
|
11
12
|
export function createKeychainApp(opts = {}) {
|
|
12
13
|
const parsePositiveInt = (raw, fallback) => {
|
|
13
14
|
const parsed = Number.parseInt(raw ?? '', 10);
|
|
@@ -44,7 +45,7 @@ export function createKeychainApp(opts = {}) {
|
|
|
44
45
|
`${process.env.HOME ?? '/data'}/bw-profiles`,
|
|
45
46
|
});
|
|
46
47
|
function createMcpServer() {
|
|
47
|
-
const server = new McpServer({ name: APP_NAME, version:
|
|
48
|
+
const server = new McpServer({ name: APP_NAME, version: SERVER_VERSION });
|
|
48
49
|
registerTools(server, {
|
|
49
50
|
getSdk: async (authInfo) => {
|
|
50
51
|
const extra = authInfo?.extra;
|
package/dist/transports/stdio.js
CHANGED
|
@@ -5,6 +5,7 @@ import { BwSessionPool } from '../bw/bwPool.js';
|
|
|
5
5
|
import { readBwEnv } from '../bw/bwSession.js';
|
|
6
6
|
import { KeychainSdk } from '../sdk/keychainSdk.js';
|
|
7
7
|
import { registerTools } from '../tools/registerTools.js';
|
|
8
|
+
import { SERVER_VERSION } from '../version.js';
|
|
8
9
|
export async function runStdioTransport() {
|
|
9
10
|
const TOOL_PREFIX = process.env.TOOL_PREFIX ?? 'keychain';
|
|
10
11
|
const TOOL_SEPARATOR = process.env.TOOL_SEPARATOR ?? '_';
|
|
@@ -15,7 +16,7 @@ export async function runStdioTransport() {
|
|
|
15
16
|
rootDir: process.env.KEYCHAIN_BW_HOME_ROOT ??
|
|
16
17
|
`${process.env.HOME ?? '/data'}/bw-profiles`,
|
|
17
18
|
});
|
|
18
|
-
const server = new McpServer({ name: APP_NAME, version:
|
|
19
|
+
const server = new McpServer({ name: APP_NAME, version: SERVER_VERSION });
|
|
19
20
|
registerTools(server, {
|
|
20
21
|
getSdk: async () => {
|
|
21
22
|
const bw = await pool.getOrCreate(bwEnv);
|
package/dist/version.js
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "@icoretech/warden-mcp",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"description": "Vaultwarden/Bitwarden MCP server backed by Bitwarden CLI (bw).",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"files": [
|
|
30
30
|
"dist/",
|
|
31
31
|
"bin/",
|
|
32
|
-
"patches/",
|
|
33
32
|
"!dist/**/*.test.js",
|
|
34
33
|
"!dist/integration/"
|
|
35
34
|
],
|
|
@@ -40,24 +39,23 @@
|
|
|
40
39
|
"start": "node dist/server.js",
|
|
41
40
|
"test": "npm run build && node --test \"dist/**/*.test.js\"",
|
|
42
41
|
"test:coverage": "npm run build && node --test --experimental-test-coverage \"dist/**/*.test.js\"",
|
|
43
|
-
"test:integration": "npm run build && node --test --test-timeout=45000 \"dist/integration/**/*.test.js\"",
|
|
42
|
+
"test:integration": "npm run build && node --test --test-concurrency=1 --test-timeout=45000 \"dist/integration/**/*.test.js\"",
|
|
44
43
|
"test:session-regression": "node scripts/session-flood-regression.mjs",
|
|
45
44
|
"lint": "biome check --write --assist-enabled=true . && tsc --noEmit"
|
|
46
45
|
},
|
|
47
46
|
"dependencies": {
|
|
48
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
47
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
49
48
|
"express": "^5.2.1",
|
|
50
|
-
"patch-package": "^8.0.1",
|
|
51
49
|
"zod": "^4.3.6"
|
|
52
50
|
},
|
|
53
51
|
"optionalDependencies": {
|
|
54
|
-
"@bitwarden/cli": "2026.
|
|
52
|
+
"@bitwarden/cli": "2026.3.0"
|
|
55
53
|
},
|
|
56
54
|
"devDependencies": {
|
|
57
|
-
"@biomejs/biome": "^2.4.
|
|
55
|
+
"@biomejs/biome": "^2.4.10",
|
|
58
56
|
"@types/express": "^5.0.6",
|
|
59
|
-
"@types/node": "^25.5.
|
|
60
|
-
"playwright": "1.
|
|
57
|
+
"@types/node": "^25.5.2",
|
|
58
|
+
"playwright": "1.59.1",
|
|
61
59
|
"tsx": "^4.21.0",
|
|
62
60
|
"typescript": "^6.0.2"
|
|
63
61
|
},
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
diff --git a/node_modules/@bitwarden/cli/build/bw.js b/node_modules/@bitwarden/cli/build/bw.js
|
|
2
|
-
index 6b02f68..2085f5e 100755
|
|
3
|
-
--- a/node_modules/@bitwarden/cli/build/bw.js
|
|
4
|
-
+++ b/node_modules/@bitwarden/cli/build/bw.js
|
|
5
|
-
@@ -27093,7 +27093,17 @@ class AuthRequestLoginStrategy extends LoginStrategy {
|
|
6
|
-
}
|
|
7
|
-
setAccountCryptographicState(response, userId) {
|
|
8
|
-
return auth_request_login_strategy_awaiter(this, void 0, void 0, function* () {
|
|
9
|
-
- yield this.accountCryptographicStateService.setAccountCryptographicState(response.accountKeysResponseModel.toWrappedAccountCryptographicState(), userId);
|
|
10
|
-
+ /* icoretech-vaultwarden-compat */
|
|
11
|
-
+ if (response.accountKeysResponseModel) {
|
|
12
|
-
+ yield this.accountCryptographicStateService.setAccountCryptographicState(response.accountKeysResponseModel.toWrappedAccountCryptographicState(), userId);
|
|
13
|
-
+ }
|
|
14
|
-
+ else if (response.privateKey) {
|
|
15
|
-
+ yield this.accountCryptographicStateService.setAccountCryptographicState({
|
|
16
|
-
+ V1: {
|
|
17
|
-
+ private_key: response.privateKey,
|
|
18
|
-
+ },
|
|
19
|
-
+ }, userId);
|
|
20
|
-
+ }
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
exportCache() {
|
|
24
|
-
@@ -27203,7 +27213,17 @@ class PasswordLoginStrategy extends LoginStrategy {
|
|
25
|
-
}
|
|
26
|
-
setAccountCryptographicState(response, userId) {
|
|
27
|
-
return password_login_strategy_awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
- yield this.accountCryptographicStateService.setAccountCryptographicState(response.accountKeysResponseModel.toWrappedAccountCryptographicState(), userId);
|
|
29
|
-
+ /* icoretech-vaultwarden-compat */
|
|
30
|
-
+ if (response.accountKeysResponseModel) {
|
|
31
|
-
+ yield this.accountCryptographicStateService.setAccountCryptographicState(response.accountKeysResponseModel.toWrappedAccountCryptographicState(), userId);
|
|
32
|
-
+ }
|
|
33
|
-
+ else if (response.privateKey) {
|
|
34
|
-
+ yield this.accountCryptographicStateService.setAccountCryptographicState({
|
|
35
|
-
+ V1: {
|
|
36
|
-
+ private_key: response.privateKey,
|
|
37
|
-
+ },
|
|
38
|
-
+ }, userId);
|
|
39
|
-
+ }
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
encryptionKeyMigrationRequired(response) {
|
|
43
|
-
@@ -28327,7 +28347,17 @@ class UserApiLoginStrategy extends LoginStrategy {
|
|
44
|
-
}
|
|
45
|
-
setAccountCryptographicState(response, userId) {
|
|
46
|
-
return user_api_login_strategy_awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
- yield this.accountCryptographicStateService.setAccountCryptographicState(response.accountKeysResponseModel.toWrappedAccountCryptographicState(), userId);
|
|
48
|
-
+ /* icoretech-vaultwarden-compat */
|
|
49
|
-
+ if (response.accountKeysResponseModel) {
|
|
50
|
-
+ yield this.accountCryptographicStateService.setAccountCryptographicState(response.accountKeysResponseModel.toWrappedAccountCryptographicState(), userId);
|
|
51
|
-
+ }
|
|
52
|
-
+ else if (response.privateKey) {
|
|
53
|
-
+ yield this.accountCryptographicStateService.setAccountCryptographicState({
|
|
54
|
-
+ V1: {
|
|
55
|
-
+ private_key: response.privateKey,
|
|
56
|
-
+ },
|
|
57
|
-
+ }, userId);
|
|
58
|
-
+ }
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
// Overridden to save client ID and secret to token service
|
|
62
|
-
@@ -28457,7 +28487,17 @@ class WebAuthnLoginStrategy extends LoginStrategy {
|
|
63
|
-
}
|
|
64
|
-
setAccountCryptographicState(response, userId) {
|
|
65
|
-
return webauthn_login_strategy_awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
- yield this.accountCryptographicStateService.setAccountCryptographicState(response.accountKeysResponseModel.toWrappedAccountCryptographicState(), userId);
|
|
67
|
-
+ /* icoretech-vaultwarden-compat */
|
|
68
|
-
+ if (response.accountKeysResponseModel) {
|
|
69
|
-
+ yield this.accountCryptographicStateService.setAccountCryptographicState(response.accountKeysResponseModel.toWrappedAccountCryptographicState(), userId);
|
|
70
|
-
+ }
|
|
71
|
-
+ else if (response.privateKey) {
|
|
72
|
-
+ yield this.accountCryptographicStateService.setAccountCryptographicState({
|
|
73
|
-
+ V1: {
|
|
74
|
-
+ private_key: response.privateKey,
|
|
75
|
-
+ },
|
|
76
|
-
+ }, userId);
|
|
77
|
-
+ }
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
exportCache() {
|