-
Notifications
You must be signed in to change notification settings - Fork 684
feat: Auto-detect transport type from config files #661
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
🎭 Playwright E2E Test Results✅ 15 passed Details15 tests across 2 suites 📊 View Detailed HTML Report (download artifacts) |
d0985b1
to
08857e2
Compare
When launching the inspector with --config, automatically set the transport dropdown and server URL based on the config file contents. This eliminates the need to manually switch between stdio/sse/streamable-http in the UI. - Use discriminated union for ServerConfig to properly type different transports - Detect transport type and URL from config, pass via query params - Maintain backwards compatibility for configs without explicit 'type' field - Add comprehensive tests for the new functionality Improves UX by making the config file the single source of truth for server settings. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
08857e2
to
a0aebdd
Compare
- Add tests for config files with different transport types (stdio, sse, streamable-http) - Add test for backward compatibility with configs missing type field - Verify transport and serverUrl options are correctly parsed from config files - All 36 tests pass
f2dfe50
to
50b96a0
Compare
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.
Hey @felixweinberger, thanks for this!
-
There is a stalled PR that is working toward this. I'm mentioning it here so it can be closed if this one is merged. It is trying to modify
client/bin/start.js
though. -
I'm testing this locally, and I realized
start.js
is not going to be the right place butcli.js
is, since it's the entrypoint for the inspector package via npx. And placing this hook incli.js
, the common launching script, this should work with the CLI inspector as well, though I'm not certain that's the case. I saw you added tests incli-tests
and that gave me the impression it would be the case, but... -
CLI tests are failing. Turns out the CLI tests are launching the web client. Those tests are meant to test the CLI client. they should just run and be done, without having to interact with the browser. Tests of launching the web client would be more appropriate in
client/e2e
where the Playwright tests happen and can run in CI.

- I notice in your example
mcp_dev_config.json
you provide adefault-server
, so I tried that and found that you cannot launch with--config
and fail to specify a server name. It feels like this should be possible if there is adefault-server
configured. Maybe the if not present on the command line, the script can grep the file for 'default-server' and if present in the file, use it as the server arg.


- Verified that I could launch if I added a
--server
argument


In #643 there is a setup for Playwright testing of the command line arguments using I created that setup to write tests to catch the CLI options bug #649 . PR #664 fixes that bug. Note the Playwright CLI tests PR is currently on top of the bug fix so that I could verify the tests caught the bug, but passed after the fix. I think all of this should be ready for review, if it's helpful here. I thought a full end-to-end test of entry-point CLI arguments to UI would be helpful as a catch-all since the Inspector is several components. (I had experience with Playwright from #582 to test more of the UI.). Tighter tests around just the CLI would be helpful too. (I also noticed the other new "CLI tests" are not same CLI. 😂 ) |
Motivation and Context
When launching the inspector with
--config
, automatically set the transportdropdown and server URL based on the config file contents. This eliminates
the need to manually switch between
stdio/sse/streamable-http
in the UI.type
fieldImproves UX by making the config file the single source of truth for
server settings.
How Has This Been Tested?
Tested manually with different configs:
E.g. with a
stdio
based config:E.g. with a
streamable-http
based config:Breaking Changes
No.
Types of changes
Checklist
Additional context