The official Kotlin SDK for Model Context Protocol servers and clients. Maintained in collaboration with JetBrains
by modelcontextprotocolLast 12 weeks · 68 commits
5 of 6 standards met
Create integration tests for Client with StreamableHTTP transport: 1. Roots [x] Capabilities https://modelcontextprotocol.io/specification/draft/client/roots#capabilities [x] Listing Roots https://modelcontextprotocol.io/specification/draft/client/roots#listing-roots [ ] Bad request [ ] Security - Allow [ ] Security - Deny [x] Root list changes https://modelcontextprotocol.io/specification/draft/client/roots#root-list-changes 2. Sampling [x] Capabilities [x] Creating Messages - Text https://modelcontextprotocol.io/specification/draft/client/sampling#creating-messages [x] Creating Messages - Image [ ] Creating Messages - Audio 3. Elicitation [ ] Capabilities [ ] Creating Elicitation Requests - Text https://modelcontextprotocol.io/specification/draft/client/elicitation#creating-elicitation-requests [ ] Creating Elicitation Requests - Structured Data https://modelcontextprotocol.io/specification/draft/client/elicitation#structured-data-request [ ] Supported Schema Types - String [ ] Supported Schema Types - Number [ ] Supported Schema Types - Enum [ ] Reject Response [ ] Cancel Reponse
Introduce Configuration class for StreamableHttpServerTransport Replace the six-parameter flat constructor of with a typed class. This improves API ergonomics, enables structural equality and copy(), and provides a stable extension point for future options without further breaking the constructor signature. Changes: Add as a public class nested directly on , with as the first parameter (most commonly set) Change the primary constructor to accept . Rename to 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 Enable test AbstractResourceIntegrationTest.testSubscribeAndUnsubscribe() since #249 is closed Motivation and Context The current StreamableHttpServerTransport API cannot be easily extended: adding more parameters would be a breaking change. But this is already needed for #521. This PR is a prerequisite for #535 How Has This Been Tested? Regression tests Breaking Changes No. Current StreamableHttpServerTransport constructor was deprecated Types of changes [ ] Bug fix (non-breaking change which fixes an issue) [x] New feature (non-breaking change which adds functionality) [ ] Breaking change (fix or feature that would cause existing functionality to change) [ ] Documentation update Checklist [x] I have read the MCP Documentation [x] My code follows the repository's style guidelines [x] New and existing tests pass locally [ ] I have added appropriate error handling [ ] I have added or updated documentation as needed
Repository: modelcontextprotocol/kotlin-sdk. Description: The official Kotlin SDK for Model Context Protocol servers and clients. Maintained in collaboration with JetBrains Stars: 1274, Forks: 198. Primary language: Kotlin. Languages: Kotlin (97.4%), TypeScript (2.6%). Homepage: https://modelcontextprotocol.github.io/kotlin-sdk/ Topics: kotlin-multiplatform, mcp. Latest release: 0.8.4 (1w ago). Open PRs: 23, open issues: 89. Last activity: 2d ago. Community health: 87%. Top contributors: devcrocod, kpavlov, dependabot[bot], e5l, tiginamaria, ignatov, Mr3zee, jclyne, skarpovdev, SeanChinJunKai and others.
Kotlin
closes #543 How Has This Been Tested? unit Breaking Changes NaN Types of changes [ ] Bug fix (non-breaking change which fixes an issue) [x] New feature (non-breaking change which adds functionality) [ ] Breaking change (fix or feature that would cause existing functionality to change) [ ] Documentation update Checklist [x] I have read the MCP Documentation [x] My code follows the repository's style guidelines [x] New and existing tests pass locally [ ] I have added appropriate error handling [ ] I have added or updated documentation as needed
Motivation and Context closes #421 #406 How Has This Been Tested? Unit tests Breaking Changes NaN Types of changes [ ] Bug fix (non-breaking change which fixes an issue) [x] New feature (non-breaking change which adds functionality) [ ] Breaking change (fix or feature that would cause existing functionality to change) [ ] Documentation update Checklist [x] I have read the MCP Documentation [x] My code follows the repository's style guidelines [x] New and existing tests pass locally [x] I have added appropriate error handling [x] I have added or updated documentation as needed
Summary Fix SSE endpoint resolution so absolute paths resolve against the origin, and add tests covering absolute vs relative endpoint events. Motivation and Context The SSE transport currently resolves all endpoint events against the SSE URL’s base path. When the server sends an absolute endpoint (starting with ), the client incorrectly prefixes it with the SSE path. This change resolves absolute endpoints against the origin while keeping relative behavior unchanged. addresses: https://github.com/modelcontextprotocol/kotlin-sdk/issues/329 How Has This Been Tested? Unit tests added in for absolute and relative endpoint events. Breaking Changes No. Types of changes [x] 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) [x] Documentation update Checklist [x] I have read the MCP Documentation [x] My code follows the repository's style guidelines [x] New and existing tests pass locally [x] I have added appropriate error handling [x] I have added or updated documentation as needed Additional context The endpoint resolution logic now treats paths starting with as origin-relative. Relative paths continue to resolve against the SSE base URL.