Skip to content

feat: Prioritize HTTP transport over SSE (CFOS-43)#47

Merged
jayscambler merged 2 commits intomainfrom
jay/cfos-27-mcp-server-components
Jun 22, 2025
Merged

feat: Prioritize HTTP transport over SSE (CFOS-43)#47
jayscambler merged 2 commits intomainfrom
jay/cfos-27-mcp-server-components

Conversation

@jayscambler
Copy link
Contributor

Summary

This PR addresses CFOS-43 by making HTTP the primary transport protocol and clarifying that SSE is optional for specific streaming scenarios only.

Changes Made

1. Set HTTP as Default Transport

  • Changed default transport in MCPConfig from stdio to http
  • Updated HttpAdapter documentation to clarify SSE is optional
  • Added comments indicating SSE is only for streaming scenarios

2. Documentation Updates

  • Created TRANSPORT_GUIDE.md - Comprehensive guide on transport selection
  • Created http_client_example.py - HTTP-first client example
  • Created http_primary_transport.md - Implementation notes on HTTP prioritization

3. Test Updates

  • Added test_http_first_approach.py - 14 tests validating HTTP as primary
  • Added test_http_primary.py - Integration tests demonstrating recommended patterns
  • Added test_transport_migration.py - Migration scenario tests
  • Updated test_protocol.py to use HTTP as default transport

Key Points

HTTP is Primary

  • Main endpoint /mcp/v1/jsonrpc uses simple HTTP POST with JSON responses
  • All standard MCP operations work with request/response pattern
  • Better compatibility with existing infrastructure
  • Simpler authentication and caching

SSE is Optional

SSE endpoints are clearly separated and only for:

  • Progress tracking: /mcp/v1/sse/progress/{operation_id}
  • Real-time subscriptions: /mcp/v1/sse/subscribe

Migration Path

The changes maintain backward compatibility while guiding users toward HTTP-first implementations. Existing SSE implementations continue to work but are positioned as optional enhancements.

Testing

✅ 14 new tests added specifically for HTTP-first validation
✅ All existing tests updated to reflect HTTP as default
✅ Documentation includes migration examples

Related to #44 (CFOS-43)

- Set HTTP as default transport in MCPConfig
- Update HttpAdapter documentation to clarify SSE is optional
- Create HTTP-first client example (http_client_example.py)
- Add comprehensive transport guide (TRANSPORT_GUIDE.md)
- Document HTTP as primary, SSE as optional enhancement
- Add migration guidance from SSE-focused implementations

This addresses CFOS-43 by making it clear that HTTP with simple
JSON responses is the primary transport method, while SSE remains
available as an optional feature for specific streaming use cases.
- Create test_http_first_approach.py with comprehensive tests
- Create test_http_primary.py demonstrating recommended patterns
- Create test_transport_migration.py for migration scenarios
- Update test_protocol.py to use HTTP as default transport
- Fix import issues in HTTP transport modules
- Update HttpAdapter to clarify SSE is optional

All tests validate that HTTP is the primary transport protocol
and SSE is only used for specific streaming scenarios.
@linear
Copy link

linear bot commented Jun 22, 2025

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.

1 participant