diff --git a/src/bridge.ts b/src/bridge.ts index 3a88179..3c1ced3 100644 --- a/src/bridge.ts +++ b/src/bridge.ts @@ -32,6 +32,8 @@ export function namespacedName(serverId: string, tool: string): string { // Node we ship in the .app), used to spawn pre-bundled MCP servers. // arg "@bundled/" → a pre-bundled MCP server shipped alongside the bridge (e.g. the // filesystem server for "Your files"), so it runs offline without npx. +// command "@bin/" → a pre-bundled NATIVE MCP server binary shipped alongside the bridge +// (e.g. the Go whatsapp-mcp), spawned directly (no Node runtime). // The bundled-servers dir is the app's resources/.../neuron-connectd/servers (set by the daemons // launcher via NEURON_CONNECTD_BUNDLE_DIR; falls back to a path next to the running bundle). function bundledServersDir(): string { @@ -39,7 +41,10 @@ function bundledServersDir(): string { } function resolveRuntimeCommand(command: string): string { - return command === "@node" ? process.execPath : command; + if (command === "@node") return process.execPath; + // "@bin/": a bundled native binary (e.g. whatsapp-mcp). Resolve to the bundled-servers dir. + if (command.startsWith("@bin/")) return join(bundledServersDir(), command.slice("@bin/".length)); + return command; } function resolveBundledArg(arg: string): string {