Fix Glama MCP startup#133
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b57c824438
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| try { | ||
| return import.meta.url === pathToFileURL(realpathSync(entrypoint)).href; |
There was a problem hiding this comment.
Preserve symlinked entrypoints when Node does
When the binary is invoked through npm's symlink with NODE_OPTIONS=--preserve-symlinks-main or node --preserve-symlinks-main, Node keeps import.meta.url pointed at the symlink while realpathSync(entrypoint) resolves it to dist/index.js, so this comparison returns false and main() never runs. This is a regression from the previous raw-path comparison for environments that preserve main-module symlinks; compare both the raw and realpath URLs, or realpath both sides, so the MCP server/CLI still starts in that mode.
Useful? React with 👍 / 👎.
Summary\n- start the Glama Docker image through the package's real dist entrypoint instead of the npm bin symlink\n- make the ESM entrypoint guard symlink-safe so npm/npx invocations actually start the server\n\n## Verification\n- pnpm build\n- pnpm test\n- MCP client handshake against node dist/index.js returned 24 tools