@buoy-gg/mcp 7.0.3 → 7.0.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/dist/cli.mjs CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  SyncClient,
4
4
  createMcpServer,
5
5
  runInit
6
- } from "./chunk-MGZN6MJE.mjs";
6
+ } from "./chunk-KZFJFXI4.mjs";
7
7
 
8
8
  // src/cli.ts
9
9
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -41,7 +41,13 @@ async function main() {
41
41
  }
42
42
  if (process.argv[2] === "init") {
43
43
  try {
44
- runInit();
44
+ const args = process.argv.slice(3);
45
+ let mode = "auto";
46
+ if (args.includes("--local")) mode = "local";
47
+ else if (args.includes("--npx")) mode = "npx";
48
+ const ri = args.indexOf("--registry");
49
+ const registry = ri !== -1 ? args[ri + 1] : void 0;
50
+ runInit({ mode, registry });
45
51
  process.exit(0);
46
52
  } catch (err) {
47
53
  process.stderr.write(`[buoy-mcp] init failed: ${err?.message ?? err}
package/dist/index.d.mts CHANGED
@@ -132,20 +132,61 @@ declare function createMcpServer(sync: SyncClient): McpServer;
132
132
  * Idempotent + non-destructive: merges into existing configs (never clobbers
133
133
  * other servers), and re-running just refreshes the buoy entry + skill.
134
134
  *
135
+ * ## How the server gets launched (and why corporate registries broke it)
136
+ *
135
137
  * By default the written config launches the server via
136
138
  * `npx -y @buoy-gg/mcp@latest`, so every editor restart re-resolves the newest
137
- * published version — users can't get pinned to a stale local copy. (Passing an
138
- * explicit `cliPath` writes a `node <path>` entry instead, for local dev/testing
139
- * against a working build.)
139
+ * published version — users can't get pinned to a stale local copy.
140
+ *
141
+ * That default fails hard on machines whose `.npmrc` routes npm at an
142
+ * unreachable private registry (e.g. a corporate `@buoy-gg:registry=` or a
143
+ * global `registry=` pointing at an internal host that doesn't resolve off-VPN).
144
+ * There, `npx @latest` blocks trying to download the package from a host that
145
+ * never answers, the editor's MCP startup times out (~30s), and the server
146
+ * silently never comes up — invisible to the user.
147
+ *
148
+ * So `init` now:
149
+ * 1. Probes the npm registry that WOULD serve `@buoy-gg/mcp`. If it's
150
+ * unreachable, it falls back to a **local install** automatically.
151
+ * 2. Local mode installs a pinned copy into a stable dir (`~/.buoy-mcp`) from
152
+ * the public npm registry (bypassing the broken `.npmrc`) and writes a
153
+ * `node <path>` config — taking the network off the editor-startup path
154
+ * entirely.
155
+ * 3. `--local` / `--npx` force a mode; `--registry <url>` overrides which
156
+ * registry the local install pulls from.
157
+ * 4. A `cliPath` (local-dev escape hatch) still writes a `node <path>` entry
158
+ * pointed at a working build, no publish needed.
140
159
  */
160
+ type InitMode = "auto" | "npx" | "local";
141
161
  interface InitOptions {
142
162
  /** Project root to install into. @default process.cwd() */
143
163
  cwd?: string;
144
164
  /**
145
165
  * Absolute path to a built cli.js. When set, the config launches that file
146
- * via `node` instead of `npx @latest` — for local development only.
166
+ * via `node` instead of `npx @latest` — for local development only. Takes
167
+ * precedence over `mode`.
147
168
  */
148
169
  cliPath?: string;
170
+ /**
171
+ * Launch strategy for the written config:
172
+ * - `"auto"` (default): npx `@latest`, but fall back to a local install if
173
+ * the npm registry for `@buoy-gg/mcp` is unreachable.
174
+ * - `"npx"`: always write the `npx -y @latest` entry (skip the probe).
175
+ * - `"local"`: always install a pinned copy to a stable dir and point the
176
+ * config at it (no network on editor startup).
177
+ * @default "auto"
178
+ */
179
+ mode?: InitMode;
180
+ /**
181
+ * Registry to pull the local install from. @default the public npm registry.
182
+ * Only used for `local` (or auto-fallback-to-local) installs.
183
+ */
184
+ registry?: string;
185
+ /**
186
+ * Stable dir the local install lives in.
187
+ * @default `$BUOY_MCP_HOME` or `~/.buoy-mcp`.
188
+ */
189
+ installDir?: string;
149
190
  /** Where the skill source lives. @default resolved from __dirname (../skill). */
150
191
  skillSrcDir?: string;
151
192
  log?: (msg: string) => void;
package/dist/index.d.ts CHANGED
@@ -132,20 +132,61 @@ declare function createMcpServer(sync: SyncClient): McpServer;
132
132
  * Idempotent + non-destructive: merges into existing configs (never clobbers
133
133
  * other servers), and re-running just refreshes the buoy entry + skill.
134
134
  *
135
+ * ## How the server gets launched (and why corporate registries broke it)
136
+ *
135
137
  * By default the written config launches the server via
136
138
  * `npx -y @buoy-gg/mcp@latest`, so every editor restart re-resolves the newest
137
- * published version — users can't get pinned to a stale local copy. (Passing an
138
- * explicit `cliPath` writes a `node <path>` entry instead, for local dev/testing
139
- * against a working build.)
139
+ * published version — users can't get pinned to a stale local copy.
140
+ *
141
+ * That default fails hard on machines whose `.npmrc` routes npm at an
142
+ * unreachable private registry (e.g. a corporate `@buoy-gg:registry=` or a
143
+ * global `registry=` pointing at an internal host that doesn't resolve off-VPN).
144
+ * There, `npx @latest` blocks trying to download the package from a host that
145
+ * never answers, the editor's MCP startup times out (~30s), and the server
146
+ * silently never comes up — invisible to the user.
147
+ *
148
+ * So `init` now:
149
+ * 1. Probes the npm registry that WOULD serve `@buoy-gg/mcp`. If it's
150
+ * unreachable, it falls back to a **local install** automatically.
151
+ * 2. Local mode installs a pinned copy into a stable dir (`~/.buoy-mcp`) from
152
+ * the public npm registry (bypassing the broken `.npmrc`) and writes a
153
+ * `node <path>` config — taking the network off the editor-startup path
154
+ * entirely.
155
+ * 3. `--local` / `--npx` force a mode; `--registry <url>` overrides which
156
+ * registry the local install pulls from.
157
+ * 4. A `cliPath` (local-dev escape hatch) still writes a `node <path>` entry
158
+ * pointed at a working build, no publish needed.
140
159
  */
160
+ type InitMode = "auto" | "npx" | "local";
141
161
  interface InitOptions {
142
162
  /** Project root to install into. @default process.cwd() */
143
163
  cwd?: string;
144
164
  /**
145
165
  * Absolute path to a built cli.js. When set, the config launches that file
146
- * via `node` instead of `npx @latest` — for local development only.
166
+ * via `node` instead of `npx @latest` — for local development only. Takes
167
+ * precedence over `mode`.
147
168
  */
148
169
  cliPath?: string;
170
+ /**
171
+ * Launch strategy for the written config:
172
+ * - `"auto"` (default): npx `@latest`, but fall back to a local install if
173
+ * the npm registry for `@buoy-gg/mcp` is unreachable.
174
+ * - `"npx"`: always write the `npx -y @latest` entry (skip the probe).
175
+ * - `"local"`: always install a pinned copy to a stable dir and point the
176
+ * config at it (no network on editor startup).
177
+ * @default "auto"
178
+ */
179
+ mode?: InitMode;
180
+ /**
181
+ * Registry to pull the local install from. @default the public npm registry.
182
+ * Only used for `local` (or auto-fallback-to-local) installs.
183
+ */
184
+ registry?: string;
185
+ /**
186
+ * Stable dir the local install lives in.
187
+ * @default `$BUOY_MCP_HOME` or `~/.buoy-mcp`.
188
+ */
189
+ installDir?: string;
149
190
  /** Where the skill source lives. @default resolved from __dirname (../skill). */
150
191
  skillSrcDir?: string;
151
192
  log?: (msg: string) => void;