Repository navigation
fix(mcp): resolve server entry from dist/ instead of app/ - #3765
diegosouzapw merged 3 commits into
Conversation
…prevent E415 hard-link tarball rejection
Bumps [esbuild](https://github.com/evanw/esbuild) from 0.28.0 to 0.28.1. - [Release notes](https://github.com/evanw/esbuild/releases) - [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md) - [Commits](evanw/esbuild@v0.28.0...v0.28.1) --- updated-dependencies: - dependency-name: esbuild dependency-version: 0.28.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Code Review
This pull request updates the MCP server entrypoint path from app/open-sse/mcp-server/server.js to dist/open-sse/mcp-server/server.js in bin/mcp-server.mjs and updates the corresponding documentation in scripts/build/assembleStandalone.mjs. Feedback was provided regarding a violation of the Repository Style Guide (Rule 9), which requires adding or updating tests when modifying production code in the bin/ directory.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| // Preferred distributable JS entry (npm publish artifact, built by prepublish.ts) | ||
| join(rootDir, "dist", "open-sse", "mcp-server", "server.js"), |
There was a problem hiding this comment.
According to the Repository Style Guide (Rule 9), changing production code in bin/ requires including or updating tests. Please add or update tests (e.g., under tests/unit/) to verify that resolveMcpEntry correctly resolves the dist/ path.
References
- Always include tests when changing production code (src/, open-sse/, electron/, bin/). (link)
The prepublish.ts Step 8.5 bundles open-sse/mcp-server/server.ts into dist/open-sse/mcp-server/server.js via esbuild, but bin/mcp-server.mjs was looking for it at app/open-sse/mcp-server/server.js — a legacy path used only on VPS deploys. This meant npm installs never found the compiled JS entry and fell back to running the raw .ts via tsx, which fails on tsx >= 4.22 due to unresolvable @/ and @omniroute/open-sse path aliases. Changes: - bin/mcp-server.mjs: change app/ -> dist/ in resolveMcpEntry candidates; export and accept injectable existsSyncFn for testability - scripts/build/assembleStandalone.mjs: update comment to reflect dist/ - tests/unit/mcp-server-entry.test.ts: new test verifying resolveMcpEntry resolves dist/, falls back to ts, returns null, checks candidates in order, and stays within rootDir
afc491c to
4e0b060
Compare
|
Thanks @megamen32 — verified and correct. |
f3cc266
into
cheaper-inference:release/v3.8.24
Code Review SummaryStatus: No Issues Found | Recommendation: Merge The PR updates MCP server entry point resolution from
The existing comment requesting tests has been addressed by this PR. Reviewed by laguna-m.1-20260312:free · 437,841 tokens |
…contributor credits - Restructure [3.8.24] into ✨ Features / 🔒 Security / 🐛 Fixed / 📝 Maintenance - Add bullets for every PR landed since v3.8.23 that was missing: marketplace (#3656), strict-mode CC defaults (#3776), emergency-fallback flag (#3752), xhigh effort (#3756), Codex memory WS (#3749), IPv6 egress (#3777), marketplace SSRF (#3774), CodeQL/Dependabot (#3778), anthropic sampling (#3780), thinking passthrough (#3775), mcp dist entry (#3765), streamed tool args (#3762), logs light-mode (#3760), clean-history purge (#3751), quality-gates (#3757), docs gaps (#3453), file-size re-baseline (#3770), E415 publish guard, i18n prune - Move misplaced #3775 bullet out of [Unreleased] into [3.8.24] - Date [3.8.23] header (TBD -> 2026-06-12, the release tag date)
…ference#3765) fix(mcp): resolve server entry from dist/ instead of app/ — matches prepublish output + published files[]. Integrated into release/v3.8.24.
…contributor credits - Restructure [3.8.24] into ✨ Features / 🔒 Security / 🐛 Fixed / 📝 Maintenance - Add bullets for every PR landed since v3.8.23 that was missing: marketplace (cheaper-inference#3656), strict-mode CC defaults (cheaper-inference#3776), emergency-fallback flag (cheaper-inference#3752), xhigh effort (cheaper-inference#3756), Codex memory WS (cheaper-inference#3749), IPv6 egress (cheaper-inference#3777), marketplace SSRF (cheaper-inference#3774), CodeQL/Dependabot (cheaper-inference#3778), anthropic sampling (cheaper-inference#3780), thinking passthrough (cheaper-inference#3775), mcp dist entry (cheaper-inference#3765), streamed tool args (cheaper-inference#3762), logs light-mode (cheaper-inference#3760), clean-history purge (cheaper-inference#3751), quality-gates (cheaper-inference#3757), docs gaps (cheaper-inference#3453), file-size re-baseline (cheaper-inference#3770), E415 publish guard, i18n prune - Move misplaced cheaper-inference#3775 bullet out of [Unreleased] into [3.8.24] - Date [3.8.23] header (TBD -> 2026-06-12, the release tag date)
Problem
omniroute --mcpcrashes on npm installs withERR_MODULE_NOT_FOUND: Cannot find package @/libbecause:prepublish.tsStep 8.5 bundlesopen-sse/mcp-server/server.ts→dist/open-sse/mcp-server/server.jsvia esbuild (which correctly resolves@/and@omniroute/open-ssepath aliases at bundle time)bin/mcp-server.mjs:14looks for the compiled entry atapp/open-sse/mcp-server/server.js— a legacy path from VPS deploysapp/directory, so the.jsentry is never foundopen-sse/mcp-server/server.tsvia tsx, which fails on tsx >= 4.22 because tsx can't resolve TypeScript path aliases at runtimeThe compiled JS artifact was already present in the published tarball at
dist/open-sse/mcp-server/server.js(2.6 MB) — it just wasn't found because the code was looking in the wrong directory.Fix
Changed the preferred entry candidate from
join(rootDir, "app", ...)tojoin(rootDir, "dist", ...)inbin/mcp-server.mjs. When present, the compiled JS runs directly without tsx — no path alias resolution needed.Also updated the corresponding comment in
scripts/build/assembleStandalone.mjs.Testing