feat(connectd): @bin/<file> — spawn a bundled native MCP server binary
Adds @bin/<file> command resolution alongside @node/@bundled: resolves to a native binary in the bundled-servers dir, spawned directly (no Node runtime). Enables native MCP connectors like the Go whatsapp-mcp. Typecheck clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+6
-1
@@ -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/<file>" → 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/<file>" → 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/<file>": 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 {
|
||||
|
||||
Reference in New Issue
Block a user