@icoretech/warden-mcp 0.2.20 → 0.2.22

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 CHANGED
@@ -38,9 +38,17 @@ object is returned.
38
38
 
39
39
  For scalar helper tools, the text output follows the reveal contract:
40
40
 
41
+ - `encode`, `get_uri`, and `get_exposed` show their returned scalar value
41
42
  - `get_username` shows the username because Bitwarden treats it as non-secret
42
43
  - `get_password`, `get_totp`, and `get_notes` show `not revealed` unless you pass
43
44
  `reveal: true`
45
+ - `generate` and `generate_username` follow the same reveal contract: they show
46
+ `generated: not revealed` by default and the generated value only with
47
+ `reveal: true`
48
+ - `get_password_history` shows `not revealed` unless you pass `reveal: true`
49
+ - Send helpers mirror their returned Send payloads into visible text so
50
+ text-only clients can use created Send links, fetched Send metadata, received
51
+ text, and file-download metadata without reading `structuredContent`
44
52
  - if `NOREVEAL=true` or `KEYCHAIN_NOREVEAL=true`, revealed values are still
45
53
  suppressed server-side
46
54
 
@@ -115,6 +115,30 @@ function isSshKeyItem(item) {
115
115
  .filter((n) => typeof n === 'string'));
116
116
  return names.has('public_key') && names.has('private_key');
117
117
  }
118
+ function stringValueMatches(value, needle) {
119
+ return typeof value === 'string' && value.toLowerCase().includes(needle);
120
+ }
121
+ function itemMatchesSearchText(item, term) {
122
+ const needle = term.trim().toLowerCase();
123
+ if (needle.length === 0)
124
+ return true;
125
+ if (stringValueMatches(item.name, needle))
126
+ return true;
127
+ const login = item.login;
128
+ if (!login || typeof login !== 'object')
129
+ return false;
130
+ const loginRec = login;
131
+ if (stringValueMatches(loginRec.username, needle))
132
+ return true;
133
+ const uris = loginRec.uris;
134
+ if (!Array.isArray(uris))
135
+ return false;
136
+ return uris.some((rawUri) => {
137
+ if (!rawUri || typeof rawUri !== 'object')
138
+ return false;
139
+ return stringValueMatches(rawUri.uri, needle);
140
+ });
141
+ }
118
142
  export class AmbiguousLoginLookupError extends Error {
119
143
  candidates;
120
144
  constructor(message, candidates) {
@@ -711,7 +735,11 @@ export class KeychainSdk {
711
735
  // NOTE: bw's `--search` does not treat "a | b" as "a OR b". If callers pass
712
736
  // a pipe-delimited string (common when combining name + username), we split
713
737
  // and union the results.
714
- const terms = tokens.length ? tokens : [undefined];
738
+ const terms = input.url
739
+ ? [undefined]
740
+ : tokens.length
741
+ ? tokens
742
+ : [undefined];
715
743
  const byId = new Map();
716
744
  for (const term of terms) {
717
745
  const args = [...baseArgs];
@@ -731,7 +759,17 @@ export class KeychainSdk {
731
759
  }
732
760
  return [...byId.values()];
733
761
  });
734
- const orgFiltered = items.filter((raw) => {
762
+ const textFiltered = input.url
763
+ ? items.filter((raw) => {
764
+ if (tokens.length === 0)
765
+ return true;
766
+ if (!raw || typeof raw !== 'object')
767
+ return false;
768
+ const item = raw;
769
+ return tokens.some((term) => itemMatchesSearchText(item, term));
770
+ })
771
+ : items;
772
+ const orgFiltered = textFiltered.filter((raw) => {
735
773
  if (!raw || typeof raw !== 'object')
736
774
  return false;
737
775
  const item = raw;
@@ -741,6 +779,9 @@ export class KeychainSdk {
741
779
  if (orgFilter === 'notnull') {
742
780
  return typeof item.organizationId === 'string' && item.organizationId;
743
781
  }
782
+ if (typeof orgId === 'string') {
783
+ return item.organizationId === orgId;
784
+ }
744
785
  return true;
745
786
  });
746
787
  const folderFiltered = orgFiltered.filter((raw) => {
@@ -753,9 +794,21 @@ export class KeychainSdk {
753
794
  if (folderFilter === 'notnull') {
754
795
  return typeof item.folderId === 'string' && item.folderId;
755
796
  }
797
+ if (typeof folderId === 'string') {
798
+ return item.folderId === folderId;
799
+ }
756
800
  return true;
757
801
  });
758
- const filtered = folderFiltered.filter((raw) => {
802
+ const collectionFiltered = folderFiltered.filter((raw) => {
803
+ if (!input.collectionId)
804
+ return true;
805
+ if (!raw || typeof raw !== 'object')
806
+ return false;
807
+ const item = raw;
808
+ return (Array.isArray(item.collectionIds) &&
809
+ item.collectionIds.includes(input.collectionId));
810
+ });
811
+ const filtered = collectionFiltered.filter((raw) => {
759
812
  if (!raw || typeof raw !== 'object')
760
813
  return false;
761
814
  const item = raw;
@@ -218,6 +218,16 @@ export function registerTools(server, deps) {
218
218
  ];
219
219
  return [{ type: 'text', text: lines.join('\n') }];
220
220
  }
221
+ function toolScalarContent(structuredContent, label, value) {
222
+ if (textCompatMode === 'structured_json') {
223
+ return [
224
+ { type: 'text', text: JSON.stringify(structuredContent) },
225
+ ];
226
+ }
227
+ return [
228
+ { type: 'text', text: `${label}: ${stringifyScalar(value)}` },
229
+ ];
230
+ }
221
231
  function ambiguousLookupResult(error) {
222
232
  const structuredContent = {
223
233
  ok: false,
@@ -529,7 +539,7 @@ export function registerTools(server, deps) {
529
539
  const encoded = await sdk.encode(input);
530
540
  return {
531
541
  structuredContent: encoded,
532
- content: toolTextContent(encoded, 'OK'),
542
+ content: toolScalarContent(encoded, 'encoded', encoded.encoded),
533
543
  };
534
544
  });
535
545
  registerTool(`${deps.toolPrefix}.generate`, {
@@ -611,7 +621,7 @@ export function registerTools(server, deps) {
611
621
  const structuredContent = toolResult('generated', result.value, result.revealed);
612
622
  return {
613
623
  structuredContent,
614
- content: toolTextContent(structuredContent, 'OK'),
624
+ content: toolValueContent(structuredContent, 'generated', result.value, result.revealed),
615
625
  };
616
626
  });
617
627
  registerTool(`${deps.toolPrefix}.generate_username`, {
@@ -654,7 +664,7 @@ export function registerTools(server, deps) {
654
664
  const structuredContent = toolResult('generated', result.value, result.revealed);
655
665
  return {
656
666
  structuredContent,
657
- content: toolTextContent(structuredContent, 'OK'),
667
+ content: toolValueContent(structuredContent, 'generated', result.value, result.revealed),
658
668
  };
659
669
  });
660
670
  registerTool(`${deps.toolPrefix}.list_folders`, {
@@ -995,7 +1005,7 @@ export function registerTools(server, deps) {
995
1005
  const structuredContent = toolResult('uri', uri.value, uri.revealed);
996
1006
  return {
997
1007
  structuredContent,
998
- content: toolTextContent(structuredContent, 'OK'),
1008
+ content: toolValueContent(structuredContent, 'uri', uri.value, uri.revealed),
999
1009
  };
1000
1010
  });
1001
1011
  registerTool(`${deps.toolPrefix}.get_notes`, {
@@ -1036,7 +1046,7 @@ export function registerTools(server, deps) {
1036
1046
  const structuredContent = toolResult('exposed', exposed.value, exposed.revealed);
1037
1047
  return {
1038
1048
  structuredContent,
1039
- content: toolTextContent(structuredContent, 'OK'),
1049
+ content: toolValueContent(structuredContent, 'exposed', exposed.value, exposed.revealed),
1040
1050
  };
1041
1051
  });
1042
1052
  registerTool(`${deps.toolPrefix}.get_folder`, {
@@ -1255,7 +1265,7 @@ export function registerTools(server, deps) {
1255
1265
  const structuredContent = { sends };
1256
1266
  return {
1257
1267
  structuredContent,
1258
- content: toolTextContent(structuredContent, 'OK'),
1268
+ content: toolScalarContent(structuredContent, 'sends', sends),
1259
1269
  };
1260
1270
  });
1261
1271
  registerTool(`${deps.toolPrefix}.send_template`, {
@@ -1274,7 +1284,7 @@ export function registerTools(server, deps) {
1274
1284
  const structuredContent = { template };
1275
1285
  return {
1276
1286
  structuredContent,
1277
- content: toolTextContent(structuredContent, 'OK'),
1287
+ content: toolScalarContent(structuredContent, 'template', template),
1278
1288
  };
1279
1289
  });
1280
1290
  registerTool(`${deps.toolPrefix}.send_get`, {
@@ -1299,7 +1309,7 @@ export function registerTools(server, deps) {
1299
1309
  const structuredContent = { result };
1300
1310
  return {
1301
1311
  structuredContent,
1302
- content: toolTextContent(structuredContent, 'OK'),
1312
+ content: toolScalarContent(structuredContent, 'result', result),
1303
1313
  };
1304
1314
  });
1305
1315
  registerTool(`${deps.toolPrefix}.send_create`, {
@@ -1361,7 +1371,7 @@ export function registerTools(server, deps) {
1361
1371
  const structuredContent = { send };
1362
1372
  return {
1363
1373
  structuredContent,
1364
- content: toolTextContent(structuredContent, 'OK'),
1374
+ content: toolScalarContent(structuredContent, 'send', send),
1365
1375
  };
1366
1376
  });
1367
1377
  registerTool(`${deps.toolPrefix}.send_create_encoded`, {
@@ -1406,7 +1416,7 @@ export function registerTools(server, deps) {
1406
1416
  const structuredContent = { send };
1407
1417
  return {
1408
1418
  structuredContent,
1409
- content: toolTextContent(structuredContent, 'OK'),
1419
+ content: toolScalarContent(structuredContent, 'send', send),
1410
1420
  };
1411
1421
  });
1412
1422
  registerTool(`${deps.toolPrefix}.send_edit`, {
@@ -1439,7 +1449,7 @@ export function registerTools(server, deps) {
1439
1449
  const structuredContent = { send };
1440
1450
  return {
1441
1451
  structuredContent,
1442
- content: toolTextContent(structuredContent, 'OK'),
1452
+ content: toolScalarContent(structuredContent, 'send', send),
1443
1453
  };
1444
1454
  });
1445
1455
  registerTool(`${deps.toolPrefix}.send_remove_password`, {
@@ -1462,7 +1472,7 @@ export function registerTools(server, deps) {
1462
1472
  const structuredContent = { result };
1463
1473
  return {
1464
1474
  structuredContent,
1465
- content: toolTextContent(structuredContent, 'OK'),
1475
+ content: toolScalarContent(structuredContent, 'result', result),
1466
1476
  };
1467
1477
  });
1468
1478
  registerTool(`${deps.toolPrefix}.send_delete`, {
@@ -1485,7 +1495,7 @@ export function registerTools(server, deps) {
1485
1495
  const structuredContent = { result };
1486
1496
  return {
1487
1497
  structuredContent,
1488
- content: toolTextContent(structuredContent, 'OK'),
1498
+ content: toolScalarContent(structuredContent, 'result', result),
1489
1499
  };
1490
1500
  });
1491
1501
  registerTool(`${deps.toolPrefix}.receive`, {
@@ -1514,7 +1524,7 @@ export function registerTools(server, deps) {
1514
1524
  const structuredContent = { result };
1515
1525
  return {
1516
1526
  structuredContent,
1517
- content: toolTextContent(structuredContent, 'OK'),
1527
+ content: toolScalarContent(structuredContent, 'result', result),
1518
1528
  };
1519
1529
  });
1520
1530
  registerTool(`${deps.toolPrefix}.get_username`, {
@@ -1622,7 +1632,7 @@ export function registerTools(server, deps) {
1622
1632
  const structuredContent = toolResult('password_history', history.value, history.revealed);
1623
1633
  return {
1624
1634
  structuredContent,
1625
- content: toolTextContent(structuredContent, 'OK'),
1635
+ content: toolValueContent(structuredContent, 'password_history', history.value, history.revealed),
1626
1636
  };
1627
1637
  });
1628
1638
  registerTool(`${deps.toolPrefix}.create_login`, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@icoretech/warden-mcp",
4
- "version": "0.2.20",
4
+ "version": "0.2.22",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "description": "Vaultwarden/Bitwarden MCP server backed by Bitwarden CLI (bw).",
@@ -49,14 +49,14 @@
49
49
  "zod": "^4.4.3"
50
50
  },
51
51
  "optionalDependencies": {
52
- "@bitwarden/cli": "2026.4.1"
52
+ "@bitwarden/cli": "2026.5.0"
53
53
  },
54
54
  "devDependencies": {
55
- "@biomejs/biome": "^2.4.14",
55
+ "@biomejs/biome": "^2.4.16",
56
56
  "@types/express": "^5.0.6",
57
- "@types/node": "^25.6.0",
58
- "playwright": "1.59.1",
59
- "tsx": "^4.21.0",
57
+ "@types/node": "^25.9.1",
58
+ "playwright": "1.60.0",
59
+ "tsx": "^4.22.4",
60
60
  "typescript": "^6.0.3"
61
61
  },
62
62
  "publishConfig": {