Skip to content

Change default proxy mode from SSE to streamable-http - #2475

Merged
danbarr merged 1 commit into
mainfrom
change-default-proxy-mode-to-streamable-http
Nov 6, 2025
Merged

danbarr merged 1 commit into
mainfrom
change-default-proxy-mode-to-streamable-http

Conversation

@danbarr

@danbarr danbarr commented Nov 6, 2025

Copy link
Copy Markdown
Collaborator

Fixes #2210

Summary

Changes the default proxy mode from the deprecated SSE transport to streamable-http to align with the MCP specification recommendations.

Changes Made

Core Application

  • CLI (cmd/thv/app/run_flags.go): Changed --proxy-mode flag default to streamable-http and updated validation function
  • API (pkg/api/v1/workload_service.go): Changed default proxy mode to streamable-http
  • MCP Client (cmd/thv/app/mcp.go): Updated transport auto-detection to default to streamable-http
  • Client Configs (pkg/client/config.go): Updated all 17 client integration mappings to map stdio transport to streamable-http variants
  • Documentation: Updated architecture docs and regenerated CLI documentation

E2E Tests

Updated 4 middleware/proxy e2e tests to use the new default transport:

  • audit_middleware_e2e_test.go: Changed transport, client type, and labels
  • telemetry_middleware_e2e_test.go: Changed transport and URL extraction
  • proxy_oauth_test.go: Changed transport, URLs (/mcp instead of /sse), and client type
  • proxy_tunnel_e2e_test.go: Changed transport

Tests that explicitly validate SSE behavior remain unchanged (osv_mcp_server_test.go, proxy_stdio_test.go SSE contexts).

Breaking Change

This is a breaking change for users relying on the default SSE behavior. They will need to explicitly specify:

  • CLI: --proxy-mode sse
  • API: "proxyMode": "sse"

Testing

  • ✅ All linting checks pass
  • ✅ Unit tests pass for modified packages
  • ✅ E2E tests updated to reflect new defaults
  • ✅ Backward compatibility maintained through explicit SSE options

SSE transport is deprecated in favor of streamable-http as per the MCP
specification. This changes the default proxy mode to streamable-http
in the CLI, API, and client configurations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Dan Barr <[email protected]>
@codecov

codecov Bot commented Nov 6, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.43%. Comparing base (e667810) to head (f8492ea).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2475      +/-   ##
==========================================
- Coverage   55.46%   55.43%   -0.03%     
==========================================
  Files         284      284              
  Lines       26720    26720              
==========================================
- Hits        14820    14812       -8     
- Misses      10537    10549      +12     
+ Partials     1363     1359       -4     

☔ 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.

@JAORMX

JAORMX commented Nov 6, 2025

Copy link
Copy Markdown
Collaborator

@claude please review this

@claude

claude Bot commented Nov 6, 2025 •

Copy link
Copy Markdown
Contributor

Claude finished @JAORMX's task —— View job


Code Review Complete

Reviewing PR #2475: Change default proxy mode from SSE to streamable-http

Tasks

  • Read and analyze all modified files
  • Review core application changes (CLI, API, client configs)
  • Review test updates
  • Review documentation updates
  • Check for consistency and completeness
  • Provide comprehensive feedback

Review Feedback

This PR successfully changes the default proxy mode from the deprecated SSE transport to streamable-http. The changes are well-structured and comprehensive. Here are my findings:

✅ Strengths

  1. Consistent Changes Across the Board: The default has been changed consistently across all relevant locations:

    • CLI flags (cmd/thv/app/run_flags.go:126)
    • API service (pkg/api/v1/workload_service.go:99)
    • MCP client auto-detection (cmd/thv/app/mcp.go:306, 324)
    • Client integration mappings (pkg/client/config.go)
  2. Proper Backward Compatibility: The code maintains explicit support for SSE mode through flags, ensuring existing users can still use SSE if needed.

  3. Comprehensive Test Updates: All 4 E2E tests that relied on default behavior have been properly updated.

  4. Documentation Updated: Both architecture docs and CLI docs have been regenerated.

  5. Clear Comments: The code includes helpful comments like "SSE is deprecated" and "default to streamable-http" to guide future developers.

🔍 Observations & Suggestions

1. Client Config Mapping Consistency (pkg/client/config.go)

All 17 client integration mappings have been updated to map stdio to their respective streamable-http variants. This is excellent! The mappings are:

  • Standard variants: "http", "streamableHttp", "streamable-http", "streamable_http" (depending on client)
  • All consistently map stdio to their streamable variants instead of SSE

Observation: The mapping is comprehensive and correct for each client's specific naming convention.

2. Test Transport Type Labels (test/e2e/audit_middleware_e2e_test.go:23)

The test file now has the label "streamable-http" instead of "sse". This is good for test categorization.

Line 23: Label("middleware", "audit", "streamable-http", "e2e")

3. URL Path Changes in Tests (test/e2e/proxy_oauth_test.go)

The test correctly updates URLs from /sse to /mcp for streamable-http:

  • Line 158: http://localhost:%d/mcp
  • Line 376: http://localhost:%d/mcp

These align with the streamable-http specification where the endpoint is /mcp.

4. Transport Auto-Detection Logic (cmd/thv/app/mcp.go:290-324)

The determineTransportType function now defaults to streamable-http when URL parsing fails or no specific path is detected (line 307, 324). This is the right choice given SSE deprecation.

Suggestion: Consider adding a log message when falling back to the default, similar to the existing warning on line 306, but perhaps at INFO level to inform users of the auto-detection result.

5. Documentation Accuracy (docs/arch/03-transport-architecture.md)

The documentation has been updated:

  • Line 60: Notes SSE is deprecated
  • Line 194: Notes default mode is streamable-http

Minor suggestion: Consider adding a deprecation timeline or version note (e.g., "deprecated as of MCP spec version X.X") for clarity.

6. Default Constant Naming (cmd/thv/app/run_flags.go:32)

const (
    defaultTransportType = "streamable-http"
)

This constant is well-named and consistently used. Good practice!

7. Validation Function (cmd/thv/app/run_flags.go:392-401)

The validateAndSetupProxyMode function properly defaults to streamable-http when empty:

if runFlags.ProxyMode == "" {
    runFlags.ProxyMode = types.ProxyModeStreamableHTTP.String()
}

This is defensive programming at its best.

📋 Breaking Change Handling

The PR description clearly identifies this as a breaking change and documents the mitigation:

  • Users can explicitly specify --proxy-mode sse (CLI)
  • Users can explicitly specify "proxyMode": "sse" (API)

Recommendation: Consider adding a migration guide or release notes section that shows before/after examples for users who rely on default behavior.

🧪 Test Coverage

The test updates are appropriate:

  1. audit_middleware_e2e_test.go: Transport explicitly set to streamable-http (line 405)
  2. telemetry_middleware_e2e_test.go: Transport type default to streamable-http (line 41, 314)
  3. proxy_oauth_test.go: URLs changed from /sse to /mcp, transport type updated (lines 92, 158, 376)
  4. proxy_tunnel_e2e_test.go: Transport explicitly set to streamable-http (line 36)

Tests that explicitly validate SSE behavior remain unchanged, which is correct (e.g., osv_mcp_server_test.go, SSE-specific tests in proxy_stdio_test.go).

🎯 Consistency Verification

I verified consistency across:

  • CLI flags: ✅ Default set to streamable-http
  • API service: ✅ Default set to streamable-http
  • Client configs: ✅ All stdio mappings point to streamable-http variants
  • MCP auto-detection: ✅ Falls back to streamable-http
  • Documentation: ✅ Updated to reflect new default
  • Tests: ✅ Updated or explicitly set transport where needed

🔧 Minor Code Style Notes

  1. Comment consistency: Some comments say "SSE is deprecated" while others say "default to streamable-http (SSE is deprecated)". Consider standardizing the phrasing.

  2. Line 395 (cmd/thv/app/run_flags.go): The comment could be more concise:

    // Current:
    runFlags.ProxyMode = types.ProxyModeStreamableHTTP.String() // default to streamable-http (SSE is deprecated)
    
    // Suggestion:
    runFlags.ProxyMode = types.ProxyModeStreamableHTTP.String() // Default (SSE deprecated)

✨ Overall Assessment

This is a well-executed PR that:

  • Makes consistent changes across the entire codebase
  • Maintains backward compatibility
  • Updates tests appropriately
  • Includes documentation updates
  • Follows the existing code patterns and conventions

The implementation is solid and ready for merge. The breaking change is properly documented, and users have clear migration paths.

📝 Recommendations for Release

  1. Release Notes: Include clear migration instructions with examples
  2. Deprecation Warning: Consider adding a runtime warning when users explicitly use SSE mode (in a follow-up PR)
  3. Blog Post/Announcement: Communicate the change to users proactively

Verdict: ✅ Approved - The code changes are correct, consistent, and well-tested. The PR successfully achieves its goal of changing the default from SSE to streamable-http while maintaining backward compatibility.


@JAORMX JAORMX left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We'll increase the minor release number when releasing this

@danbarr
danbarr marked this pull request as ready for review November 6, 2025 18:27
@danbarr
danbarr merged commit deb2801 into main Nov 6, 2025
@danbarr
danbarr deleted the change-default-proxy-mode-to-streamable-http branch November 6, 2025 18:31
danbarr added a commit that referenced this pull request Nov 7, 2025
When using `--proxy-mode sse` with stdio MCP servers, client configurations
were incorrectly getting their `type` field set to `streamable-http` instead
of `sse`.

The issue was in `WithStandardLabels()` which computes the transport label
stored in container labels. This label is later used to determine the
transport type for client configurations. The function handled the
`streamable-http` proxy mode case but was missing the `sse` case.

Changes:
- Add handling for stdio transport with SSE proxy mode in config.go:473-474
- Add test coverage for both SSE and streamable-http proxy modes

Fixes #2475

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
amirejaz pushed a commit that referenced this pull request Nov 7, 2025
When using `--proxy-mode sse` with stdio MCP servers, client configurations
were incorrectly getting their `type` field set to `streamable-http` instead
of `sse`.

The issue was in `WithStandardLabels()` which computes the transport label
stored in container labels. This label is later used to determine the
transport type for client configurations. The function handled the
`streamable-http` proxy mode case but was missing the `sse` case.

Changes:
- Add handling for stdio transport with SSE proxy mode in config.go:473-474
- Add test coverage for both SSE and streamable-http proxy modes

Fixes #2475

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Dan Barr <[email protected]>
Co-authored-by: Claude <[email protected]>
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.

Change default proxy mode from deprecated SSE to streaming-http

3 participants