-
Notifications
You must be signed in to change notification settings - Fork 575
add npm run dev:sdk
to get live sdk changes w/ simple server
#533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change lgtm and safe as it's also strictly additive so won't break any workflows - also seems like a nice DevX improvement when working on SDK and debugging at the same time!
Should we add a paragraph somewhere in the README to draw attention to this feature?
d0673ba
to
f2e509c
Compare
🎭 Playwright E2E Test Results✅ 12 passed Details12 tests across 1 suite 📊 View Detailed HTML Report (download artifacts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there is a conflict with the gitignore?
Introduces an
npm run dev:sdk
script that allows live edit/rebuild of the SDK + inspector codebases.TL;DR:
npm run dev:sdk "cd sdk && npm run examples:simple-server:w"
and open http://localhost:3000/mcp as SHTTPMotivation and Context
The inspector is great to test SDK changes, but there's a bit of gymastics required: there's no watch-enabled build of the SDK, and no instructions or scripts to
npm link
.How Has This Been Tested?
This builds upon modelcontextprotocol/typescript-sdk#663
Checkout this Inspector branch & the SDK:
git clone https://github.com/modelcontextprotocol/typescript-sdk git clone https://github.com/modelcontextprotocol/inspector cd inspector git checkout ochafik/dx-inspector-sdk
If the sdk isn't in
../typescript-sdk
, set MCP_SDK envRun the simpleStreamableHttp.ts example server alongside the inspector & SDK:
npm run dev:sdk "cd sdk && npm run examples:simple-server:w"
Open http://localhost:3000/mcp as Streamable HTTP in the inspector
Inspector & SDK edits should be reflected ~live
To undo the linking of the local typescript-sdk codebase, run
npm run unlink:sdk && npm i
.Breaking Changes
None
Types of changes
Checklist