The official Kotlin SDK for Model Context Protocol servers and clients. Maintained in collaboration with JetBrains
by modelcontextprotocolLast 12 weeks · 70 commits
5 of 6 standards met
1. Add a customizable builder to StdioServerTransport Scope lifecycle is fixed (#574 resolved), processing dispatcher defaults to (#573 resolved), scope context is clean (no spurious dispatcher stacking), and on the three job vars addresses the visibility race. Introduce a class for to improve API flexibility and readability. Now one can provide a dispatcher for IO running on Virtual Threads Updated transport initialization to use a builder block for configuring parameters such as I/O streams, buffer sizes, dispatchers, and parent coroutine scope. Added integration test validating the builder functionality. 2. Added rule to detekt exclusions for test folders in . Removed issues from detekt baseline files. NB!** This PR doesn't fully resolve race conditions on close(). It will be resolved in the course of #518 Motivation and Context #573, #574 How Has This Been Tested? Integration test / regression tests Breaking Changes No, only API is only extended 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) [ ] 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 Additional context
Some clients add a charset to the content header: _application/json;charset=UTF-8_ This breaks the full equals check here: https://github.com/modelcontextprotocol/kotlin-sdk/blob/9f00f225960086aeb59e3f197fe2a6b06646c4e3/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/server/SSEServerTransport.kt#L75 The following makes the equals check a bit more flexible, allowing charsets
Repository: modelcontextprotocol/kotlin-sdk. Description: The official Kotlin SDK for Model Context Protocol servers and clients. Maintained in collaboration with JetBrains Stars: 1283, Forks: 200. Primary language: Kotlin. Languages: Kotlin (97.4%), TypeScript (2.6%). Homepage: https://modelcontextprotocol.github.io/kotlin-sdk/ Topics: kotlin-multiplatform, mcp. Latest release: 0.9.0 (9h ago). Open PRs: 23, open issues: 93. Last activity: 8h ago. Community health: 87%. Top contributors: devcrocod, kpavlov, dependabot[bot], e5l, tiginamaria, ignatov, Mr3zee, jclyne, skarpovdev, SeanChinJunKai and others.
Kotlin
Describe the bug value properties of (like of ) incorrectly serialize to in the response JSON, instead of being omitted. According to the Spec, is not an allowed value. It allows either omitting the property or an object value. The MCP server is unusable. ⚠️ Claude & Claude Code do strict schema checking, which is valid. They reject the MCP response and assume the MCP connection fails. To Reproduce Steps to reproduce the behavior: 1. Connect to a MCP server with Claude Code. 2. Connection fails. Expected behavior Connection succeeds. Logs** From Claude Code's debug log:
Added utility-based serialization/deserialization tests for and . Updated to include serialization testing guidelines. Motivation and Context #581 How Has This Been Tested? Unit test Breaking Changes No Types of changes [x] Test added 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