Skip to content

Fix inspector URL using wrong transport for proxied stdio servers#4300

Merged
danbarr merged 2 commits intomainfrom
fix-inspector-url-transport
Mar 20, 2026
Merged

Fix inspector URL using wrong transport for proxied stdio servers#4300
danbarr merged 2 commits intomainfrom
fix-inspector-url-transport

Conversation

@danbarr
Copy link
Copy Markdown
Collaborator

@danbarr danbarr commented Mar 20, 2026

Summary

  • thv inspector was building the MCP Inspector URL using the server's native TransportType (e.g. stdio) instead of ProxyMode to determine the 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.
  • Extracted URL-building logic into a buildInspectorURL helper and changed getServerPortAndTransport to return types.ProxyMode from the workload's ProxyMode field.

Fixes #4298

Type of change

  • Bug fix

Test plan

  • Unit tests (task test)
  • Manual testing (describe below)

Ran thv inspector github against a running github server (stdio proxied as streamable-http) and verified the URL now uses transport=streamable-http with /mcp path.

Does this introduce a user-facing change?

Yes — thv inspector now 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

`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>
@github-actions github-actions bot added the size/S Small PR: 100-299 lines changed label Mar 20, 2026
ChrisJBurns
ChrisJBurns previously approved these changes 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>
@github-actions github-actions bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Mar 20, 2026
@danbarr danbarr merged commit 04ae197 into main Mar 20, 2026
48 checks passed
@danbarr danbarr deleted the fix-inspector-url-transport branch March 20, 2026 21:56
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.77%. Comparing base (4bb1016) to head (e787829).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Small PR: 100-299 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

thv inspector builds wrong URL for stdio servers proxied as streamable-http

3 participants