@icoretech/warden-mcp 0.2.1 → 0.2.2

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/bin/warden-mcp.js CHANGED
@@ -8,24 +8,30 @@ import { fileURLToPath } from 'node:url';
8
8
 
9
9
  const __dirname = dirname(fileURLToPath(import.meta.url));
10
10
 
11
- const startupPath = resolve(__dirname, '../dist/startup/bwStartup.js');
12
- if (!existsSync(startupPath)) {
13
- console.error(
14
- '[warden-mcp] ERROR: dist/startup/bwStartup.js not found. Run `npm run build` first.',
15
- );
16
- process.exit(1);
17
- }
18
- const { prepareBwStartup } = await import(startupPath);
19
- prepareBwStartup(process.env);
11
+ async function main() {
12
+ const startupPath = resolve(__dirname, '../dist/startup/bwStartup.js');
13
+ if (!existsSync(startupPath)) {
14
+ console.error(
15
+ '[warden-mcp] ERROR: dist/startup/bwStartup.js not found. Run `npm run build` first.',
16
+ );
17
+ process.exit(1);
18
+ }
19
+ const { prepareBwStartup } = await import(startupPath);
20
+ prepareBwStartup(process.env);
21
+
22
+ // Delegate to the compiled server entry, forwarding all arguments.
23
+ const serverPath = resolve(__dirname, '../dist/server.js');
24
+ if (!existsSync(serverPath)) {
25
+ console.error(
26
+ '[warden-mcp] ERROR: dist/server.js not found. Run `npm run build` first.',
27
+ );
28
+ process.exit(1);
29
+ }
20
30
 
21
- // Delegate to the compiled server entry, forwarding all arguments.
22
- const serverPath = resolve(__dirname, '../dist/server.js');
23
- if (!existsSync(serverPath)) {
24
- console.error(
25
- '[warden-mcp] ERROR: dist/server.js not found. Run `npm run build` first.',
26
- );
27
- process.exit(1);
31
+ await import(serverPath);
28
32
  }
29
33
 
30
- // Use dynamic import to run the server module (it has top-level await).
31
- await import(serverPath);
34
+ void main().catch((error) => {
35
+ console.error(error);
36
+ process.exitCode = 1;
37
+ });
package/dist/server.js CHANGED
@@ -10,10 +10,11 @@ const { values } = parseArgs({
10
10
  strict: false,
11
11
  });
12
12
  const useStdio = values.stdio === true || process.env.WARDEN_MCP_STDIO === 'true';
13
- if (useStdio) {
14
- await runStdioTransport();
15
- }
16
- else {
13
+ async function main() {
14
+ if (useStdio) {
15
+ await runStdioTransport();
16
+ return;
17
+ }
17
18
  const PORT = Number.parseInt(process.env.PORT ?? '3005', 10);
18
19
  const app = createKeychainApp();
19
20
  const server = app.listen(PORT, () => {
@@ -24,3 +25,7 @@ else {
24
25
  server.once('error', reject);
25
26
  });
26
27
  }
28
+ void main().catch((error) => {
29
+ console.error(error);
30
+ process.exitCode = 1;
31
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@icoretech/warden-mcp",
4
- "version": "0.2.1",
4
+ "version": "0.2.2",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "description": "Vaultwarden/Bitwarden MCP server backed by Bitwarden CLI (bw).",