fix: unblock @modelcontextprotocol/sdk upgrades past 1.26.0 (nodenext)#44
Merged
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Migrate tsconfig module/moduleResolution from Node16 to nodenext. Newer SDK versions expose the bare @modelcontextprotocol/sdk/server subpath with an unconditional ESM `types` entry; Node16 resolution misread it as ESM and rejected the import with TS1479. nodenext correctly applies the package's CommonJS `require` condition, so the import resolves cleanly. The package stays CommonJS (no `type: module`) — nodenext keys format off package.json `type`, so emit is still require() and no entrypoint/__dirname changes are needed. nodenext also future-proofs against later SDK subpath changes. ServerOptions is tightened to `import type` (used only as a type annotation). Closes #42 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
evilmachina
force-pushed
the
fix/unblock-mcp-sdk-upgrade
branch
from
June 24, 2026 16:48
21010f7 to
394bb0e
Compare
Open
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #42. The build was stuck on
@modelcontextprotocol/sdk@1.26.0because newer versions trippedtscwith TS1479 under theNode16module resolution. This bumps the SDK to 1.29.0 and migrates module resolution tonodenext.Root cause
The SDK's
./serverexport entry advertises an unconditional"types": "./dist/esm/server/index.d.ts"(ESM declaration). UndermoduleResolution: "Node16",tscread that ESM.d.ts, classified the bare subpath as ESM, and refused to emit arequire()for it from this CommonJS package:Fix: migrate to
nodenexttsconfigmodule/moduleResolution→nodenext. The newer algorithm correctly applies the package's CommonJSrequirecondition for the bare subpath, so the import resolves without error.nodenextkeys module format offpackage.json"type"(absent → CommonJS). Emit is stillrequire(...); no entrypoint,__dirname, orreadFileSyncplumbing changes were needed.nodenextfloats to current Node resolution semantics, so this also future-proofs against later SDK subpath changes (unlikeNode16, pinned to Node 16-era behavior).ServerOptionsis tightened toimport type(used only as a type annotation), so it erases at compile time.Why
nodenextover the one-lineimport typeworkaroundA surgical alternative existed (keep
Node16, importServerOptionsfrom the explicit/server/index.jswildcard subpath). We chosenodenextdeliberately: it's the forward-looking resolution mode, fixes the bare public import without relying on the./*exports wildcard, and unblocks future SDK subpath changes generally rather than patching one import site. A full ESM migration (type: module) was not needed —nodenextsolves it while the package stays CommonJS.Verification
npm run buildpasses on SDK 1.29.0 undernodenextnpm testpasses (236/236)require()(package remains CommonJS); the type import is erasedinitialize, lists all 12 toolsAcceptance criteria
npm run buildpassesnpm testpasses (236 tests)nodenext, package stays CommonJS🤖 Generated with Claude Code