Skip to content

Make StreamableHTTPTransport a Rack application#263

Open
koic wants to merge 1 commit intomodelcontextprotocol:mainfrom
koic:make_streamable_http_transport_a_standard_rack_app
Open

Make StreamableHTTPTransport a Rack application#263
koic wants to merge 1 commit intomodelcontextprotocol:mainfrom
koic:make_streamable_http_transport_a_standard_rack_app

Conversation

@koic
Copy link
Member

@koic koic commented Mar 18, 2026

Add call(env) to StreamableHTTPTransport, making it a Rack application that works with mount, run, and Rack middleware.

Refactor examples to use Rack middleware classes for MCP logging instead of proc wrappers, demonstrating idiomatic Rack composition with the new run(transport) pattern.

Update README.md with mount and controller integration patterns.

Closes #59, #60

How Has This Been Tested?

Added tests for call(env) as a Rack app. All tests pass.

Breaking Change

No breaking changes. All existing APIs are preserved:

  • StreamableHTTPTransport.new(server) continues to work as before.
  • handle_request(request) is unchanged. The new call(env) is a purely additive public method.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@koic koic force-pushed the make_streamable_http_transport_a_standard_rack_app branch 2 times, most recently from 06f5b81 to 361288f Compare March 18, 2026 19:06
@koic koic changed the title Make StreamableHTTPTransport a standard Rack application Make StreamableHTTPTransport a Rack application Mar 18, 2026
@koic koic force-pushed the make_streamable_http_transport_a_standard_rack_app branch 3 times, most recently from d6d5860 to d746725 Compare March 19, 2026 03:52
Add `call(env)` to `StreamableHTTPTransport`, making it a Rack application
that works with `mount`, `run`, and Rack middleware.

Refactor examples to use Rack middleware classes for MCP logging instead of proc wrappers,
demonstrating idiomatic Rack composition with the new `run(transport)` pattern.

Update README.md with mount and controller integration patterns.

Closes modelcontextprotocol#59, modelcontextprotocol#60

## How Has This Been Tested?

Added tests for `call(env)` as a Rack app. All tests pass.

## Breaking Change

No breaking changes. All existing APIs are preserved:

- `StreamableHTTPTransport.new(server)` continues to work as before.
- `handle_request(request)` is unchanged. The new `call(env)` is a purely additive public method.
@koic koic force-pushed the make_streamable_http_transport_a_standard_rack_app branch from d746725 to 0912d7d Compare March 19, 2026 03:54
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.

conventional drop-in Rack MCP servers with StreamableHTTP transport

1 participant