Fix inspector URL using wrong transport for proxied stdio servers#4300
Merged
Fix inspector URL using wrong transport for proxied stdio servers#4300
Conversation
`thv inspector` was reading the server's native TransportType (e.g. "stdio") instead of ProxyMode to determine the inspector URL transport and path suffix. This caused stdio servers proxied as streamable-http to get a URL with transport=sse and /sse instead of transport=streamable-http and /mcp. Fixes #4298 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ChrisJBurns
previously approved these changes
Mar 20, 2026
reyortiz3
reviewed
Mar 20, 2026
reyortiz3
reviewed
Mar 20, 2026
reyortiz3
reviewed
Mar 20, 2026
Rename getServerPortAndTransport to getServerPortAndProxyMode and replace IIFE with plain if/else for the URL path suffix. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
reyortiz3
approved these changes
Mar 20, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4300 +/- ##
=======================================
Coverage 68.77% 68.77%
=======================================
Files 473 473
Lines 47917 47917
=======================================
+ Hits 32955 32957 +2
+ Misses 12309 12298 -11
- Partials 2653 2662 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sanskarzz
pushed a commit
to Sanskarzz/toolhive
that referenced
this pull request
Mar 23, 2026
…acklok#4300) * Fix inspector URL using wrong transport for proxied stdio servers `thv inspector` was reading the server's native TransportType (e.g. "stdio") instead of ProxyMode to determine the inspector URL transport and path suffix. This caused stdio servers proxied as streamable-http to get a URL with transport=sse and /sse instead of transport=streamable-http and /mcp. Fixes stacklok#4298 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Address review feedback: rename function and simplify suffix logic Rename getServerPortAndTransport to getServerPortAndProxyMode and replace IIFE with plain if/else for the URL path suffix. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Dan Barr <6922515+danbarr@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
thv inspectorwas building the MCP Inspector URL using the server's nativeTransportType(e.g.stdio) instead ofProxyModeto determine the transport and path suffix. This caused stdio servers proxied as streamable-http to get a URL withtransport=sseand/sseinstead oftransport=streamable-httpand/mcp.buildInspectorURLhelper and changedgetServerPortAndTransportto returntypes.ProxyModefrom the workload'sProxyModefield.Fixes #4298
Type of change
Test plan
task test)Ran
thv inspector githubagainst a running github server (stdio proxied as streamable-http) and verified the URL now usestransport=streamable-httpwith/mcppath.Does this introduce a user-facing change?
Yes —
thv inspectornow generates the correct MCP Inspector URL for servers proxied as streamable-http. Previously, users had to manually change the transport and path in the inspector UI.Generated with Claude Code