@icoretech/warden-mcp 0.2.5 → 0.2.7

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.
@@ -170,6 +170,19 @@ export class BwSessionManager {
170
170
  }).catch(() => { });
171
171
  }
172
172
  }
173
+ async currentServerUrl() {
174
+ try {
175
+ const { stdout } = await runBw(['status'], {
176
+ env: this.baseEnv(),
177
+ timeoutMs: 30_000,
178
+ });
179
+ const parsed = JSON.parse(stdout);
180
+ return typeof parsed.serverUrl === 'string' ? parsed.serverUrl : null;
181
+ }
182
+ catch {
183
+ return null;
184
+ }
185
+ }
173
186
  async ensureUnlockedInternal() {
174
187
  // Ensure server config points to BW_HOST.
175
188
  await this.ensureServerConfigured();
@@ -271,6 +284,11 @@ export class BwSessionManager {
271
284
  async ensureServerConfigured() {
272
285
  if (this.configuredHost === this.env.host)
273
286
  return;
287
+ const currentHost = await this.currentServerUrl();
288
+ if (currentHost === this.env.host) {
289
+ this.configuredHost = currentHost;
290
+ return;
291
+ }
274
292
  // bw requires logout before config server update.
275
293
  await runBw(['logout'], { env: this.baseEnv(), timeoutMs: 30_000 }).catch(() => { });
276
294
  try {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@icoretech/warden-mcp",
4
- "version": "0.2.5",
4
+ "version": "0.2.7",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "description": "Vaultwarden/Bitwarden MCP server backed by Bitwarden CLI (bw).",