Skip to content

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ochafik
Copy link

@ochafik ochafik commented Jun 19, 2025

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 SHTTP

Motivation 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 env

  • Run 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Copy link
Contributor

@felixweinberger felixweinberger left a 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?

@felixweinberger felixweinberger force-pushed the ochafik/dx-inspector-sdk branch 2 times, most recently from d0673ba to f2e509c Compare June 24, 2025 09:44
Copy link

🎭 Playwright E2E Test Results

✅  12 passed

Details

12 tests across 1 suite
 20.7 seconds
 d0673ba
ℹ️  Test Environment: Ubuntu Latest, Node.js 18
Browsers: Chromium, Firefox

📊 View Detailed HTML Report (download artifacts)

Copy link
Contributor

@pcarleton pcarleton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@olaservo olaservo left a 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?

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.

4 participants