Skip to content

fix: move MCP SDK requires to top level so pkg can bundle them - #13

Merged
thomhoffer-arch merged 3 commits into
mainfrom
claude/review-claude-bridge-BPfhX
Apr 13, 2026
Merged

fix: move MCP SDK requires to top level so pkg can bundle them#13
thomhoffer-arch merged 3 commits into
mainfrom
claude/review-claude-bridge-BPfhX

Conversation

@thomhoffer-arch

Copy link
Copy Markdown
Collaborator

No description provided.

claude added 3 commits April 13, 2026 11:11
- pkg binary: uses the installed binary path as command
- node/dev mode: uses npx -y @clashcontrol/mcp-server
- Previously used process.execPath which pointed to node binary itself,
  resulting in a broken config entry

https://claude.ai/code/session_01XEvUykWcLc452uxGWPb1mb
The npm package @clashcontrol/mcp-server isn't published yet.
When running via node (non-pkg), use process.execPath + absolute
path to smart-bridge.js instead of npx.

https://claude.ai/code/session_01XEvUykWcLc452uxGWPb1mb
The compiled binary crashed with "Cannot find module
'@modelcontextprotocol/sdk/server/mcp.js'" because pkg can't trace
require() calls inside conditional function bodies.

Fix: move requires to top-level imports. Also change pkg config from
assets to scripts for .js files so they're properly compiled into the
binary, and add tools.js to assets.

https://claude.ai/code/session_01XEvUykWcLc452uxGWPb1mb
@thomhoffer-arch
thomhoffer-arch merged commit a02d1d7 into main Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants