Skip to content

refactor: replace flat parameter definitions with StreamableHttpServerTransport.Configuration in Application Ktor extensions#563

Draft
kpavlov wants to merge 4 commits intomainfrom
kpavlov/streaming-http-app-ext
Draft

refactor: replace flat parameter definitions with StreamableHttpServerTransport.Configuration in Application Ktor extensions#563
kpavlov wants to merge 4 commits intomainfrom
kpavlov/streaming-http-app-ext

Conversation

@kpavlov
Copy link
Contributor

@kpavlov kpavlov commented Feb 23, 2026

refactor: replace flat parameter definitions with StreamableHttpServerTransport.Configuration in Application Ktor extensions

Simplified Application.mcp*StreamableHttp functions by replacing individual parameters with the typed StreamableHttpServerTransport.Configuration for improved extensibility and performance.

Includes #560

Motivation and Context

See #562, #560 see thr comment: #560 (comment)

How Has This Been Tested?

Regression test

Breaking Changes

No, it is safe. #562 was not shipped yet.

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

Replace the six-parameter flat constructor of StreamableHttpServerTransport with a typed Configuration class. This improves API ergonomics and provides a stable extension point for future options without further breaking the constructor signature.

Changes:

  - Add `Configuration` as a public class nested directly on `StreamableHttpServerTransport`, with `enableJsonResponse` as the first
    parameter (most commonly set)
  - Change the primary constructor to accept `Configuration`
  - Rename `retryIntervalMillis: Long?` to `retryInterval: Duration?` in Configuration, aligning with Kotlin's type-safe time API
  - Deprecate the old flat constructor with a compatibility bridge
  - Update KotlinTestBase integration test to use the new constructor
…simplify `StreamableHttpServerTransport` constructor
@kpavlov kpavlov requested review from devcrocod and e5l February 23, 2026 17:57
@kpavlov kpavlov added the bugfix Something was fixed 🎉 label Feb 23, 2026
…erTransport.Configuration` in Application Ktor extensions

Simplified `Application.mcp*StreamableHttp`  functions by replacing individual parameters with the typed `StreamableHttpServerTransport.Configuration` for improved extensibility and performance.
@kpavlov kpavlov force-pushed the kpavlov/streaming-http-app-ext branch from d11ef9f to bc3c750 Compare February 23, 2026 18:14
…erTransport.Configuration` in Application Ktor extensions

Simplified `Application.mcp*StreamableHttp` functions by replacing individual parameters with the typed `StreamableHttpServerTransport.Configuration` with default value for improved extensibility and performance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Something was fixed 🎉

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant