## Summary
Part of #815.
Adds the core types and codecs needed for SEP-2575:
- experimental accessors for request-scoped metadata while preserving
legacy request shapes and unknown `_meta` entries;
- `server/discover` request/result types, cache fields, and
unsupported-version error data; and
- polymorphic request/result decoding with wire-format and
malformed-input coverage.
The discovery types match the merged draft schema in
modelcontextprotocol/modelcontextprotocol#3002: `protocolVersion` and
`clientCapabilities` are required, `clientInfo` is optional, and
optional server information remains in result `_meta`.
## Motivation and Context
SEP-2575 moves protocol and client context onto individual requests and
introduces `server/discover`. The shared `RequestMeta` accessors remain
nullable so legacy requests stay representable; `DiscoverRequestParams`
enforces the fields required by the new discovery request.
This PR stops at the core type and codec boundary. It does not add
server admission, request-scoped dispatch, Streamable HTTP,
authentication, subscriptions, MRTR, lifecycle hooks, or a discovery
DSL.
## How Has This Been Tested?
- JVM: 597/597 tests
- JS Node and Chrome: 528/528 tests per target
- WasmJS Node and Chrome: 528/528 tests per target
- iOS Simulator arm64 and macOS arm64: 528/528 tests per target
- API dump/check, ktlint, detekt, and diff checks
Coverage includes required discovery metadata, optional `clientInfo`,
required cache fields, unknown metadata round-trips, the legacy
`resultType` fallback, unsupported-version data, and polymorphic result
classification.
## Breaking Changes
This adds `DiscoverRequest` as a new `ClientRequest` subtype. Consumers
recompiling exhaustive `when` expressions over `ClientRequest` may need
to add a branch. Existing request types and wire representations are
unchanged.
## Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
## Checklist
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [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
`ttlMs` and `cacheScope` have Kotlin construction defaults but remain
required when decoding. An absent `resultType` decodes as `"complete"`
for compatibility with legacy results. Discovery result selection
requires the complete required shape so unrelated result extensions are
not misclassified.
---------
Co-authored-by: Pavel Gorgulov <devcrocod@gmail.com>
Clear the recently-cancelled request id buffer in `doClose` so
connection teardown fully resets per-request bookkeeping.
## Motivation and Context
Follow-up to #884. `doClose` already resets `_responseHandlers`,
`_progressHandlers`, and `inFlightRequestJobs`, but left
`recentlyCancelledRequestIds` populated across a close. This aligns
teardown to clear all Protocol-scoped per-request state.
Not a correctness bug: the buffer is bounded (256) and self-evicting,
request ids are random UUIDs so stale entries cannot false-match a new
connection, and the post-close `onMessage` guard drops late messages
from the old transport before the buffer is consulted. The change
removes the lone asymmetry in `doClose`.
## How Has This Been Tested?
- `./gradlew :kotlin-sdk-core:compileKotlinJvm`
- `./gradlew :kotlin-sdk-core:jvmTest --tests "*ProtocolTest*"`
## Breaking Changes
None.
## 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](https://modelcontextprotocol.io)
- [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
`recentlyCancelledRequestIds` is Protocol-scoped (like
`_responseHandlers`/`_progressHandlers`), so it is reset in `doClose`
rather than on the per-connection `Connection` object.
Make inbound message handling concurrent after the initialization
handshake, so a slow or peer-awaiting handler no longer blocks other
messages on the same connection
fixes#176, #572
## Motivation and Context
Inbound messages were processed serially on the transport read loop. One
slow or peer-awaiting request handler (sampling, elicitation, roots)
blocked every later message on that connection, including the responses
and `notifications/cancelled` those handlers depend on which could
deadlock request/response flows.
## How Has This Been Tested?
New and old tests
## Breaking Changes
- after the handshake, inbound handlers may run concurrently (processing
stays serial during initialization). There is no opt-out flag by design,
concurrency is bounded by `maxConcurrentHandlers` /
`maxInFlightHandlers`.
- `ProtocolOptions` / `ClientOptions` / `ServerOptions` gain new
parameters with defaults
- `RequestHandlerExtra` is now a coroutine-context element and is no
longer user-constructible
## Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
## Checklist
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [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
Bumps the kotlin group with 2 updates in the / directory:
[org.jetbrains.kotlin:kotlin-gradle-plugin](https://github.com/JetBrains/kotlin)
and
[org.jetbrains.kotlin:kotlin-serialization](https://github.com/JetBrains/kotlin).
Updates `org.jetbrains.kotlin:kotlin-gradle-plugin` from 2.3.21 to 2.4.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/JetBrains/kotlin/releases">org.jetbrains.kotlin:kotlin-gradle-plugin's
releases</a>.</em></p>
<blockquote>
<h2>Kotlin 2.4.0</h2>
<h2>Changelog</h2>
<h3>Analysis API</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83867"><code>KT-83867</code></a>
OVERLOAD_RESOLUTION_AMBIGUITY false positive with assertEquals in IJ
repo</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83723"><code>KT-83723</code></a>
[Analysis API] Enable experimental KDoc resolver by default</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83388"><code>KT-83388</code></a>
Analysis API: properly support KMP in KotlinPackageProvider</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-65683"><code>KT-65683</code></a>
Analysis API: Dangling file session creation causes a
<code>computeIfAbsent</code> contract violation</li>
</ul>
<h3>Analysis API. Code Compilation</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-78946"><code>KT-78946</code></a>
Evaluation of variable with local class in type parameter leads to
InventNamesForLocalClasses exception</li>
</ul>
<h3>Analysis API. FIR</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-68260"><code>KT-68260</code></a>
K2 AA: InvalidFirElementTypeException “For CALLABLE_REFERENCE_EXPRESSION
with text <code>::lam1</code>, unexpected element of type: no element
found” with illegal callable reference call</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-70896"><code>KT-70896</code></a>
AA: False positive deprecation warning with override of built-in method
in JDK mapped class</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84711"><code>KT-84711</code></a>
K2 IDE sometimes loses FIR plugin-generated declarations after file
changes</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84625"><code>KT-84625</code></a>
Analysis API: collectDesignationPath fails for nested classes inside
plugin-generated top-level classes</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84596"><code>KT-84596</code></a>
Improve K2 Jooq completion performance</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84525"><code>KT-84525</code></a>
KaValueParameterSymbol#getHasSynthesizedName returns false for
FirDeclarationOrigin.SubstitutionOverride.DeclarationSite</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83546"><code>KT-83546</code></a>
Kotlin analysis reach ClsCustomNavigationPolicy</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84259"><code>KT-84259</code></a>
Move CommonDefaultImportsProvider to the frontend independent
module</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-82945"><code>KT-82945</code></a>
Analysis API: KotlinIllegalArgumentExceptionWithAttachments: Expected
FirResolvedTypeRef with ConeKotlinType but was FirUserTypeRefImpl</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-71135"><code>KT-71135</code></a>
AA: exception from sealed inheritors checker when
<code>analyzeCopy</code></li>
</ul>
<h3>Analysis API. Infrastructure</h3>
<h4>Fixes</h4>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83905"><code>KT-83905</code></a>
Analysis API: Improve UX with test data</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84913"><code>KT-84913</code></a>
Extract compiler classes used by the PSI & Analysis API to a
separate module</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-64986"><code>KT-64986</code></a>
Analysis API: Implement Analysis API tests for different KMP
Platforms</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84776"><code>KT-84776</code></a>
The test data manager misses the redundancy check in the update
mode</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84962"><code>KT-84962</code></a>
The test data manager misses -ea flag</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84388"><code>KT-84388</code></a>
Preserve the EOF status in the test data manager to avoid extra
changes</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84362"><code>KT-84362</code></a>
Analysis API tests produce many warnings due to "not yet loaded
registry"</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84279"><code>KT-84279</code></a>
Test Data Manager fails on a clean build</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83913"><code>KT-83913</code></a>
Exclude compiler-based Analysis API tests from Git tracking</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-80379"><code>KT-80379</code></a>
Extract per-module test generators for AA tests</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84120"><code>KT-84120</code></a>
Move CLI modules out of kotlin-compiler-fe10-for-ide</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83200"><code>KT-83200</code></a>
Track external dependencies of the Analysis API modules</li>
</ul>
<h3>Analysis API. Light Classes</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-82434"><code>KT-82434</code></a>
Light classes should prefer enum entries to properties</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84200"><code>KT-84200</code></a>
SLC: return type is not boxed for delegated methods with generic
original method</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-72451"><code>KT-72451</code></a>
"CCE: class PsiPrimitiveType cannot be cast to class
PsiClassType" with same-named enum class and typealias</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md">org.jetbrains.kotlin:kotlin-gradle-plugin's
changelog</a>.</em></p>
<blockquote>
<h2>2.4.0</h2>
<h3>Analysis API</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83867"><code>KT-83867</code></a>
OVERLOAD_RESOLUTION_AMBIGUITY false positive with assertEquals in IJ
repo</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83723"><code>KT-83723</code></a>
[Analysis API] Enable experimental KDoc resolver by default</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83388"><code>KT-83388</code></a>
Analysis API: properly support KMP in KotlinPackageProvider</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-65683"><code>KT-65683</code></a>
Analysis API: Dangling file session creation causes a
<code>computeIfAbsent</code> contract violation</li>
</ul>
<h3>Analysis API. Code Compilation</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-78946"><code>KT-78946</code></a>
Evaluation of variable with local class in type parameter leads to
InventNamesForLocalClasses exception</li>
</ul>
<h3>Analysis API. FIR</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-68260"><code>KT-68260</code></a>
K2 AA: InvalidFirElementTypeException “For CALLABLE_REFERENCE_EXPRESSION
with text <code>::lam1</code>, unexpected element of type: no element
found” with illegal callable reference call</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-70896"><code>KT-70896</code></a>
AA: False positive deprecation warning with override of built-in method
in JDK mapped class</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84711"><code>KT-84711</code></a>
K2 IDE sometimes loses FIR plugin-generated declarations after file
changes</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84625"><code>KT-84625</code></a>
Analysis API: collectDesignationPath fails for nested classes inside
plugin-generated top-level classes</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84596"><code>KT-84596</code></a>
Improve K2 Jooq completion performance</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84525"><code>KT-84525</code></a>
KaValueParameterSymbol#getHasSynthesizedName returns false for
FirDeclarationOrigin.SubstitutionOverride.DeclarationSite</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83546"><code>KT-83546</code></a>
Kotlin analysis reach ClsCustomNavigationPolicy</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84259"><code>KT-84259</code></a>
Move CommonDefaultImportsProvider to the frontend independent
module</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-82945"><code>KT-82945</code></a>
Analysis API: KotlinIllegalArgumentExceptionWithAttachments: Expected
FirResolvedTypeRef with ConeKotlinType but was FirUserTypeRefImpl</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-71135"><code>KT-71135</code></a>
AA: exception from sealed inheritors checker when
<code>analyzeCopy</code></li>
</ul>
<h3>Analysis API. Infrastructure</h3>
<h4>Fixes</h4>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83905"><code>KT-83905</code></a>
Analysis API: Improve UX with test data</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84913"><code>KT-84913</code></a>
Extract compiler classes used by the PSI & Analysis API to a
separate module</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-64986"><code>KT-64986</code></a>
Analysis API: Implement Analysis API tests for different KMP
Platforms</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84776"><code>KT-84776</code></a>
The test data manager misses the redundancy check in the update
mode</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84962"><code>KT-84962</code></a>
The test data manager misses -ea flag</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84388"><code>KT-84388</code></a>
Preserve the EOF status in the test data manager to avoid extra
changes</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84362"><code>KT-84362</code></a>
Analysis API tests produce many warnings due to "not yet loaded
registry"</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84279"><code>KT-84279</code></a>
Test Data Manager fails on a clean build</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83913"><code>KT-83913</code></a>
Exclude compiler-based Analysis API tests from Git tracking</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-80379"><code>KT-80379</code></a>
Extract per-module test generators for AA tests</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84120"><code>KT-84120</code></a>
Move CLI modules out of kotlin-compiler-fe10-for-ide</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83200"><code>KT-83200</code></a>
Track external dependencies of the Analysis API modules</li>
</ul>
<h3>Analysis API. Light Classes</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-82434"><code>KT-82434</code></a>
Light classes should prefer enum entries to properties</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84200"><code>KT-84200</code></a>
SLC: return type is not boxed for delegated methods with generic
original method</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-72451"><code>KT-72451</code></a>
"CCE: class PsiPrimitiveType cannot be cast to class
PsiClassType" with same-named enum class and typealias</li>
</ul>
<h3>Analysis API. PSI</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="add726ca8c"><code>add726c</code></a>
Add ChangeLog for 2.4.0-RC2</li>
<li><a
href="69a4a81ef2"><code>69a4a81</code></a>
[Wasm] Add binaryen per-file arguments</li>
<li><a
href="8907c635d4"><code>8907c63</code></a>
[KGP] Suppress duplicate compiler warning output when --warning-mode=all
is a...</li>
<li><a
href="f9bef128ea"><code>f9bef12</code></a>
[KGP] Add failing test for duplicate compiler warning output via
Problems API</li>
<li><a
href="7fe49c227a"><code>7fe49c2</code></a>
KT-86268: Use 2.4.0 toolchain for abiValidation with older CVs</li>
<li><a
href="13d25e2c58"><code>13d25e2</code></a>
KT-86268: Regression test added</li>
<li><a
href="f7d1a76541"><code>f7d1a76</code></a>
[JKlib] Fix JAR deserializer configuration.</li>
<li><a
href="5cec663aff"><code>5cec663</code></a>
[JKlib] Wire up JvmBuiltInClassDescriptorFactory</li>
<li><a
href="ef146114de"><code>ef14611</code></a>
Make the default stability of non-final classes <code>Unknown</code>
instead of <code>Stable</code></li>
<li><a
href="d76473afd2"><code>d76473a</code></a>
[Gradle] Fix GeneralNativeIT.shouldAllowToOverrideDownloadUrl test
failures</li>
<li>Additional commits viewable in <a
href="https://github.com/JetBrains/kotlin/compare/v2.3.21...v2.4.0">compare
view</a></li>
</ul>
</details>
<br />
Updates `org.jetbrains.kotlin:kotlin-serialization` from 2.3.21 to 2.4.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/JetBrains/kotlin/releases">org.jetbrains.kotlin:kotlin-serialization's
releases</a>.</em></p>
<blockquote>
<h2>Kotlin 2.4.0</h2>
<h2>Changelog</h2>
<h3>Analysis API</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83867"><code>KT-83867</code></a>
OVERLOAD_RESOLUTION_AMBIGUITY false positive with assertEquals in IJ
repo</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83723"><code>KT-83723</code></a>
[Analysis API] Enable experimental KDoc resolver by default</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83388"><code>KT-83388</code></a>
Analysis API: properly support KMP in KotlinPackageProvider</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-65683"><code>KT-65683</code></a>
Analysis API: Dangling file session creation causes a
<code>computeIfAbsent</code> contract violation</li>
</ul>
<h3>Analysis API. Code Compilation</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-78946"><code>KT-78946</code></a>
Evaluation of variable with local class in type parameter leads to
InventNamesForLocalClasses exception</li>
</ul>
<h3>Analysis API. FIR</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-68260"><code>KT-68260</code></a>
K2 AA: InvalidFirElementTypeException “For CALLABLE_REFERENCE_EXPRESSION
with text <code>::lam1</code>, unexpected element of type: no element
found” with illegal callable reference call</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-70896"><code>KT-70896</code></a>
AA: False positive deprecation warning with override of built-in method
in JDK mapped class</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84711"><code>KT-84711</code></a>
K2 IDE sometimes loses FIR plugin-generated declarations after file
changes</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84625"><code>KT-84625</code></a>
Analysis API: collectDesignationPath fails for nested classes inside
plugin-generated top-level classes</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84596"><code>KT-84596</code></a>
Improve K2 Jooq completion performance</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84525"><code>KT-84525</code></a>
KaValueParameterSymbol#getHasSynthesizedName returns false for
FirDeclarationOrigin.SubstitutionOverride.DeclarationSite</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83546"><code>KT-83546</code></a>
Kotlin analysis reach ClsCustomNavigationPolicy</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84259"><code>KT-84259</code></a>
Move CommonDefaultImportsProvider to the frontend independent
module</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-82945"><code>KT-82945</code></a>
Analysis API: KotlinIllegalArgumentExceptionWithAttachments: Expected
FirResolvedTypeRef with ConeKotlinType but was FirUserTypeRefImpl</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-71135"><code>KT-71135</code></a>
AA: exception from sealed inheritors checker when
<code>analyzeCopy</code></li>
</ul>
<h3>Analysis API. Infrastructure</h3>
<h4>Fixes</h4>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83905"><code>KT-83905</code></a>
Analysis API: Improve UX with test data</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84913"><code>KT-84913</code></a>
Extract compiler classes used by the PSI & Analysis API to a
separate module</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-64986"><code>KT-64986</code></a>
Analysis API: Implement Analysis API tests for different KMP
Platforms</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84776"><code>KT-84776</code></a>
The test data manager misses the redundancy check in the update
mode</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84962"><code>KT-84962</code></a>
The test data manager misses -ea flag</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84388"><code>KT-84388</code></a>
Preserve the EOF status in the test data manager to avoid extra
changes</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84362"><code>KT-84362</code></a>
Analysis API tests produce many warnings due to "not yet loaded
registry"</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84279"><code>KT-84279</code></a>
Test Data Manager fails on a clean build</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83913"><code>KT-83913</code></a>
Exclude compiler-based Analysis API tests from Git tracking</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-80379"><code>KT-80379</code></a>
Extract per-module test generators for AA tests</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84120"><code>KT-84120</code></a>
Move CLI modules out of kotlin-compiler-fe10-for-ide</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83200"><code>KT-83200</code></a>
Track external dependencies of the Analysis API modules</li>
</ul>
<h3>Analysis API. Light Classes</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-82434"><code>KT-82434</code></a>
Light classes should prefer enum entries to properties</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84200"><code>KT-84200</code></a>
SLC: return type is not boxed for delegated methods with generic
original method</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-72451"><code>KT-72451</code></a>
"CCE: class PsiPrimitiveType cannot be cast to class
PsiClassType" with same-named enum class and typealias</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md">org.jetbrains.kotlin:kotlin-serialization's
changelog</a>.</em></p>
<blockquote>
<h2>2.4.0</h2>
<h3>Analysis API</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83867"><code>KT-83867</code></a>
OVERLOAD_RESOLUTION_AMBIGUITY false positive with assertEquals in IJ
repo</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83723"><code>KT-83723</code></a>
[Analysis API] Enable experimental KDoc resolver by default</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83388"><code>KT-83388</code></a>
Analysis API: properly support KMP in KotlinPackageProvider</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-65683"><code>KT-65683</code></a>
Analysis API: Dangling file session creation causes a
<code>computeIfAbsent</code> contract violation</li>
</ul>
<h3>Analysis API. Code Compilation</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-78946"><code>KT-78946</code></a>
Evaluation of variable with local class in type parameter leads to
InventNamesForLocalClasses exception</li>
</ul>
<h3>Analysis API. FIR</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-68260"><code>KT-68260</code></a>
K2 AA: InvalidFirElementTypeException “For CALLABLE_REFERENCE_EXPRESSION
with text <code>::lam1</code>, unexpected element of type: no element
found” with illegal callable reference call</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-70896"><code>KT-70896</code></a>
AA: False positive deprecation warning with override of built-in method
in JDK mapped class</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84711"><code>KT-84711</code></a>
K2 IDE sometimes loses FIR plugin-generated declarations after file
changes</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84625"><code>KT-84625</code></a>
Analysis API: collectDesignationPath fails for nested classes inside
plugin-generated top-level classes</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84596"><code>KT-84596</code></a>
Improve K2 Jooq completion performance</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84525"><code>KT-84525</code></a>
KaValueParameterSymbol#getHasSynthesizedName returns false for
FirDeclarationOrigin.SubstitutionOverride.DeclarationSite</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83546"><code>KT-83546</code></a>
Kotlin analysis reach ClsCustomNavigationPolicy</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84259"><code>KT-84259</code></a>
Move CommonDefaultImportsProvider to the frontend independent
module</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-82945"><code>KT-82945</code></a>
Analysis API: KotlinIllegalArgumentExceptionWithAttachments: Expected
FirResolvedTypeRef with ConeKotlinType but was FirUserTypeRefImpl</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-71135"><code>KT-71135</code></a>
AA: exception from sealed inheritors checker when
<code>analyzeCopy</code></li>
</ul>
<h3>Analysis API. Infrastructure</h3>
<h4>Fixes</h4>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83905"><code>KT-83905</code></a>
Analysis API: Improve UX with test data</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84913"><code>KT-84913</code></a>
Extract compiler classes used by the PSI & Analysis API to a
separate module</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-64986"><code>KT-64986</code></a>
Analysis API: Implement Analysis API tests for different KMP
Platforms</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84776"><code>KT-84776</code></a>
The test data manager misses the redundancy check in the update
mode</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84962"><code>KT-84962</code></a>
The test data manager misses -ea flag</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84388"><code>KT-84388</code></a>
Preserve the EOF status in the test data manager to avoid extra
changes</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84362"><code>KT-84362</code></a>
Analysis API tests produce many warnings due to "not yet loaded
registry"</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84279"><code>KT-84279</code></a>
Test Data Manager fails on a clean build</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83913"><code>KT-83913</code></a>
Exclude compiler-based Analysis API tests from Git tracking</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-80379"><code>KT-80379</code></a>
Extract per-module test generators for AA tests</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84120"><code>KT-84120</code></a>
Move CLI modules out of kotlin-compiler-fe10-for-ide</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83200"><code>KT-83200</code></a>
Track external dependencies of the Analysis API modules</li>
</ul>
<h3>Analysis API. Light Classes</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-82434"><code>KT-82434</code></a>
Light classes should prefer enum entries to properties</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84200"><code>KT-84200</code></a>
SLC: return type is not boxed for delegated methods with generic
original method</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-72451"><code>KT-72451</code></a>
"CCE: class PsiPrimitiveType cannot be cast to class
PsiClassType" with same-named enum class and typealias</li>
</ul>
<h3>Analysis API. PSI</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="add726ca8c"><code>add726c</code></a>
Add ChangeLog for 2.4.0-RC2</li>
<li><a
href="69a4a81ef2"><code>69a4a81</code></a>
[Wasm] Add binaryen per-file arguments</li>
<li><a
href="8907c635d4"><code>8907c63</code></a>
[KGP] Suppress duplicate compiler warning output when --warning-mode=all
is a...</li>
<li><a
href="f9bef128ea"><code>f9bef12</code></a>
[KGP] Add failing test for duplicate compiler warning output via
Problems API</li>
<li><a
href="7fe49c227a"><code>7fe49c2</code></a>
KT-86268: Use 2.4.0 toolchain for abiValidation with older CVs</li>
<li><a
href="13d25e2c58"><code>13d25e2</code></a>
KT-86268: Regression test added</li>
<li><a
href="f7d1a76541"><code>f7d1a76</code></a>
[JKlib] Fix JAR deserializer configuration.</li>
<li><a
href="5cec663aff"><code>5cec663</code></a>
[JKlib] Wire up JvmBuiltInClassDescriptorFactory</li>
<li><a
href="ef146114de"><code>ef14611</code></a>
Make the default stability of non-final classes <code>Unknown</code>
instead of <code>Stable</code></li>
<li><a
href="d76473afd2"><code>d76473a</code></a>
[Gradle] Fix GeneralNativeIT.shouldAllowToOverrideDownloadUrl test
failures</li>
<li>Additional commits viewable in <a
href="https://github.com/JetBrains/kotlin/compare/v2.3.21...v2.4.0">compare
view</a></li>
</ul>
</details>
<br />
Updates `org.jetbrains.kotlin:kotlin-serialization` from 2.3.21 to 2.4.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/JetBrains/kotlin/releases">org.jetbrains.kotlin:kotlin-serialization's
releases</a>.</em></p>
<blockquote>
<h2>Kotlin 2.4.0</h2>
<h2>Changelog</h2>
<h3>Analysis API</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83867"><code>KT-83867</code></a>
OVERLOAD_RESOLUTION_AMBIGUITY false positive with assertEquals in IJ
repo</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83723"><code>KT-83723</code></a>
[Analysis API] Enable experimental KDoc resolver by default</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83388"><code>KT-83388</code></a>
Analysis API: properly support KMP in KotlinPackageProvider</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-65683"><code>KT-65683</code></a>
Analysis API: Dangling file session creation causes a
<code>computeIfAbsent</code> contract violation</li>
</ul>
<h3>Analysis API. Code Compilation</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-78946"><code>KT-78946</code></a>
Evaluation of variable with local class in type parameter leads to
InventNamesForLocalClasses exception</li>
</ul>
<h3>Analysis API. FIR</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-68260"><code>KT-68260</code></a>
K2 AA: InvalidFirElementTypeException “For CALLABLE_REFERENCE_EXPRESSION
with text <code>::lam1</code>, unexpected element of type: no element
found” with illegal callable reference call</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-70896"><code>KT-70896</code></a>
AA: False positive deprecation warning with override of built-in method
in JDK mapped class</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84711"><code>KT-84711</code></a>
K2 IDE sometimes loses FIR plugin-generated declarations after file
changes</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84625"><code>KT-84625</code></a>
Analysis API: collectDesignationPath fails for nested classes inside
plugin-generated top-level classes</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84596"><code>KT-84596</code></a>
Improve K2 Jooq completion performance</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84525"><code>KT-84525</code></a>
KaValueParameterSymbol#getHasSynthesizedName returns false for
FirDeclarationOrigin.SubstitutionOverride.DeclarationSite</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83546"><code>KT-83546</code></a>
Kotlin analysis reach ClsCustomNavigationPolicy</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84259"><code>KT-84259</code></a>
Move CommonDefaultImportsProvider to the frontend independent
module</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-82945"><code>KT-82945</code></a>
Analysis API: KotlinIllegalArgumentExceptionWithAttachments: Expected
FirResolvedTypeRef with ConeKotlinType but was FirUserTypeRefImpl</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-71135"><code>KT-71135</code></a>
AA: exception from sealed inheritors checker when
<code>analyzeCopy</code></li>
</ul>
<h3>Analysis API. Infrastructure</h3>
<h4>Fixes</h4>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83905"><code>KT-83905</code></a>
Analysis API: Improve UX with test data</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84913"><code>KT-84913</code></a>
Extract compiler classes used by the PSI & Analysis API to a
separate module</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-64986"><code>KT-64986</code></a>
Analysis API: Implement Analysis API tests for different KMP
Platforms</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84776"><code>KT-84776</code></a>
The test data manager misses the redundancy check in the update
mode</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84962"><code>KT-84962</code></a>
The test data manager misses -ea flag</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84388"><code>KT-84388</code></a>
Preserve the EOF status in the test data manager to avoid extra
changes</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84362"><code>KT-84362</code></a>
Analysis API tests produce many warnings due to "not yet loaded
registry"</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84279"><code>KT-84279</code></a>
Test Data Manager fails on a clean build</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83913"><code>KT-83913</code></a>
Exclude compiler-based Analysis API tests from Git tracking</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-80379"><code>KT-80379</code></a>
Extract per-module test generators for AA tests</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84120"><code>KT-84120</code></a>
Move CLI modules out of kotlin-compiler-fe10-for-ide</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83200"><code>KT-83200</code></a>
Track external dependencies of the Analysis API modules</li>
</ul>
<h3>Analysis API. Light Classes</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-82434"><code>KT-82434</code></a>
Light classes should prefer enum entries to properties</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84200"><code>KT-84200</code></a>
SLC: return type is not boxed for delegated methods with generic
original method</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-72451"><code>KT-72451</code></a>
"CCE: class PsiPrimitiveType cannot be cast to class
PsiClassType" with same-named enum class and typealias</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md">org.jetbrains.kotlin:kotlin-serialization's
changelog</a>.</em></p>
<blockquote>
<h2>2.4.0</h2>
<h3>Analysis API</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83867"><code>KT-83867</code></a>
OVERLOAD_RESOLUTION_AMBIGUITY false positive with assertEquals in IJ
repo</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83723"><code>KT-83723</code></a>
[Analysis API] Enable experimental KDoc resolver by default</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83388"><code>KT-83388</code></a>
Analysis API: properly support KMP in KotlinPackageProvider</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-65683"><code>KT-65683</code></a>
Analysis API: Dangling file session creation causes a
<code>computeIfAbsent</code> contract violation</li>
</ul>
<h3>Analysis API. Code Compilation</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-78946"><code>KT-78946</code></a>
Evaluation of variable with local class in type parameter leads to
InventNamesForLocalClasses exception</li>
</ul>
<h3>Analysis API. FIR</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-68260"><code>KT-68260</code></a>
K2 AA: InvalidFirElementTypeException “For CALLABLE_REFERENCE_EXPRESSION
with text <code>::lam1</code>, unexpected element of type: no element
found” with illegal callable reference call</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-70896"><code>KT-70896</code></a>
AA: False positive deprecation warning with override of built-in method
in JDK mapped class</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84711"><code>KT-84711</code></a>
K2 IDE sometimes loses FIR plugin-generated declarations after file
changes</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84625"><code>KT-84625</code></a>
Analysis API: collectDesignationPath fails for nested classes inside
plugin-generated top-level classes</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84596"><code>KT-84596</code></a>
Improve K2 Jooq completion performance</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84525"><code>KT-84525</code></a>
KaValueParameterSymbol#getHasSynthesizedName returns false for
FirDeclarationOrigin.SubstitutionOverride.DeclarationSite</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83546"><code>KT-83546</code></a>
Kotlin analysis reach ClsCustomNavigationPolicy</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84259"><code>KT-84259</code></a>
Move CommonDefaultImportsProvider to the frontend independent
module</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-82945"><code>KT-82945</code></a>
Analysis API: KotlinIllegalArgumentExceptionWithAttachments: Expected
FirResolvedTypeRef with ConeKotlinType but was FirUserTypeRefImpl</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-71135"><code>KT-71135</code></a>
AA: exception from sealed inheritors checker when
<code>analyzeCopy</code></li>
</ul>
<h3>Analysis API. Infrastructure</h3>
<h4>Fixes</h4>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83905"><code>KT-83905</code></a>
Analysis API: Improve UX with test data</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84913"><code>KT-84913</code></a>
Extract compiler classes used by the PSI & Analysis API to a
separate module</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-64986"><code>KT-64986</code></a>
Analysis API: Implement Analysis API tests for different KMP
Platforms</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84776"><code>KT-84776</code></a>
The test data manager misses the redundancy check in the update
mode</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84962"><code>KT-84962</code></a>
The test data manager misses -ea flag</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84388"><code>KT-84388</code></a>
Preserve the EOF status in the test data manager to avoid extra
changes</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84362"><code>KT-84362</code></a>
Analysis API tests produce many warnings due to "not yet loaded
registry"</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84279"><code>KT-84279</code></a>
Test Data Manager fails on a clean build</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83913"><code>KT-83913</code></a>
Exclude compiler-based Analysis API tests from Git tracking</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-80379"><code>KT-80379</code></a>
Extract per-module test generators for AA tests</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84120"><code>KT-84120</code></a>
Move CLI modules out of kotlin-compiler-fe10-for-ide</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-83200"><code>KT-83200</code></a>
Track external dependencies of the Analysis API modules</li>
</ul>
<h3>Analysis API. Light Classes</h3>
<ul>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-82434"><code>KT-82434</code></a>
Light classes should prefer enum entries to properties</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-84200"><code>KT-84200</code></a>
SLC: return type is not boxed for delegated methods with generic
original method</li>
<li><a
href="https://youtrack.jetbrains.com/issue/KT-72451"><code>KT-72451</code></a>
"CCE: class PsiPrimitiveType cannot be cast to class
PsiClassType" with same-named enum class and typealias</li>
</ul>
<h3>Analysis API. PSI</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="add726ca8c"><code>add726c</code></a>
Add ChangeLog for 2.4.0-RC2</li>
<li><a
href="69a4a81ef2"><code>69a4a81</code></a>
[Wasm] Add binaryen per-file arguments</li>
<li><a
href="8907c635d4"><code>8907c63</code></a>
[KGP] Suppress duplicate compiler warning output when --warning-mode=all
is a...</li>
<li><a
href="f9bef128ea"><code>f9bef12</code></a>
[KGP] Add failing test for duplicate compiler warning output via
Problems API</li>
<li><a
href="7fe49c227a"><code>7fe49c2</code></a>
KT-86268: Use 2.4.0 toolchain for abiValidation with older CVs</li>
<li><a
href="13d25e2c58"><code>13d25e2</code></a>
KT-86268: Regression test added</li>
<li><a
href="f7d1a76541"><code>f7d1a76</code></a>
[JKlib] Fix JAR deserializer configuration.</li>
<li><a
href="5cec663aff"><code>5cec663</code></a>
[JKlib] Wire up JvmBuiltInClassDescriptorFactory</li>
<li><a
href="ef146114de"><code>ef14611</code></a>
Make the default stability of non-final classes <code>Unknown</code>
instead of <code>Stable</code></li>
<li><a
href="d76473afd2"><code>d76473a</code></a>
[Gradle] Fix GeneralNativeIT.shouldAllowToOverrideDownloadUrl test
failures</li>
<li>Additional commits viewable in <a
href="https://github.com/JetBrains/kotlin/compare/v2.3.21...v2.4.0">compare
view</a></li>
</ul>
</details>
<br />
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: devcrocod <devcrocod@gmail.com>
finished SEP-1686
closes#421
## Breaking Changes
none
## 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](https://modelcontextprotocol.io)
- [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
closes#410
## How Has This Been Tested?
integration and unit tests
## Breaking Changes
none
## 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](https://modelcontextprotocol.io)
- [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
- reject empty sampling content in SamplingMessage and
CreateMessageResult constructors
- clarify sampling validation docs and emit an explicit error when
tool_use is not followed by tool_result
- return sampled text from the conformance test_sampling tool instead of
content object strings
Fixes#730
## Testing
- ./gradlew
-Dorg.gradle.java.installations.paths="/Users/ubl/Documents/New
project/oss-contributions/.jdks/jdk-21.0.11+10/Contents/Home"
:kotlin-sdk-core:jvmTest :kotlin-sdk-server:jvmTest
:conformance-test:compileKotlin
Co-authored-by: Pavel Gorgulov <devcrocod@gmail.com>
closes#544
Replaces opaque `JsonObject?` modelling of `elicitation` with a typed
`ClientCapabilities.Elicitation` (`form`, `url`), and adds the new
`tasks` capability on both `ClientCapabilities` and `ServerCapabilities`
(with `list`, `cancel`, per-request-type augmentation). Wires capability
assertions for `tasks/*` methods and `notifications/tasks/status` into
`Client` and `ServerSession`
## How Has This Been Tested?
unit tests
## Breaking Changes
yes
now elicitation is a specific class in capabilities
## Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
## Checklist
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [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
Migrate detekt to a convention plugin in `buildSrc`, switch the project
to a fully explicit YAML config (`buildUponDefaultConfig = false`), fix
the real findings that this stricter setup revealed, and remove
`@Suppress` annotations that became unnecessary after the rule changes.
## Motivation and Context
- Explicit visibility into the rule set
- Lock against detekt version upgrades
## Breaking Changes
None
## 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](https://modelcontextprotocol.io)
- [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
Implements SEP-1577 sampling With tools
closes#409
## How Has This Been Tested?
unit + integration
## Breaking Changes
- binary changes
- MediaContent -> SamplingMessageContent
-
## Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
## Checklist
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [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
Drop the deprecated `watchosX64` and `tvosX64`
## Breaking Changes
consumers that depended on `watchosX64` or `tvosX64` artifacts will need
to migrate to the corresponding ARM/simulator targets.
## Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
## Checklist
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [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
<!-- Provide a brief summary of your changes -->
Add support for MCP extension negotiation during the initialize
handshake, as defined in the MCP extensions specification. Clients and
servers can now advertise supported extensions via a new `extensions:
Map<String, JsonObject>?` field on their respective capabilities
objects.
## Motivation and Context
<!-- Why is this change needed? What problem does it solve? -->
Extensions are supported part of the [MCP spec
](https://modelcontextprotocol.io/extensions/overview) and are available
in other language libraries e.g. [Golang
](862d78a265/mcp/protocol.go (L215)).
## How Has This Been Tested?
Existing and added unit tests
## Breaking Changes
<!-- Will users need to update their code or configurations? -->
Adding a new field to existing ClientCapabilities and ServerCapabilities
fields will break already compiled clients. They will need to recompile
on upgrading.
## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] 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
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [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
<!-- Add any other context, implementation notes, or design decisions
-->
Co-authored-by: Pavel Gorgulov <devcrocod@gmail.com>
fixes#242
## How Has This Been Tested?
new and existing tests pass
## Breaking Changes
none
## 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](https://modelcontextprotocol.io)
- [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
Validate `mcp-protocol-version` HTTP header during `InitializeRequest`
Fix `DEFAULT_NEGOTIATED_PROTOCOL_VERSION` to match the spec
fixes#547
## How Has This Been Tested?
Updated existing test (removed TODO referencing #547) to verify init
request
## Breaking Changes
none
## 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](https://modelcontextprotocol.io)
- [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
Add optional `$schema` field to `ToolSchema`, establishing JSON Schema
2020-12 as the default dialect per SEP-1613.
closes#422
## How Has This Been Tested?
unit tests
## Breaking Changes
none
## 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](https://modelcontextprotocol.io)
- [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
Remove unused OpenAPI Generator plugin, its configuration, and the
`.openapi-generator-ignore` file.
## Breaking Changes
none
## 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
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [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
- enable rule for checking undocumented public api
- add kdoc skill
## How Has This Been Tested?
./gradlew detekt
## Breaking Changes
none
## 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)
- [x] Documentation update
## Checklist
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [ ] I have added appropriate error handling
- [x] I have added or updated documentation as needed
---------
Co-authored-by: Konstantin Pavlov <1517853+kpavlov@users.noreply.github.com>
closes#546
## How Has This Been Tested?
unit
## Breaking Changes
none
## 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](https://modelcontextprotocol.io)
- [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
Add URL mode elicitation support and typed `PrimitiveSchemaDefinition`
hierarchy to align with MCP specification 2025-11-25
closes#540
## How Has This Been Tested?
unit/integration/conformance
## Breaking Changes
- `ElicitRequestParams` changed from `data class` to `sealed interface`.
A deprecated factory function preserves source compatibility for
`ElicitRequestParams(message, requestedSchema)`.
- `RequestedSchema.properties` changed from `JsonObject` to `Map<String,
PrimitiveSchemaDefinition>`.
- `ElicitRequest.requestedSchema` is deprecated, use `(params as
ElicitRequestFormParams).requestedSchema`.
## Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
## Checklist
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [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
## Fix Kotlin language and api version to 2.1
- Remove language constructs not supported in Kotlin 2.1
<!-- Provide a brief summary of your changes -->
## Motivation and Context
To ensure binary compatibility
## How Has This Been Tested?
Regression tests
## Breaking Changes
<!-- Will users need to update their code or configurations? -->
## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] 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
- [x] Build update
## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [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
<!-- Add any other context, implementation notes, or design decisions
-->
Remove all deprecation with error level
## Motivation and Context
next minor release
## How Has This Been Tested?
-
## Breaking Changes
Removing it is a binary-incompatible change
## 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
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [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
## 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](https://modelcontextprotocol.io)
- [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
Adds a comprehensive conformance test suite for the Kotlin MCP SDK,
covering core protocol operations, tool calls, elicitation, resources,
prompts, and 20 OAuth/auth scenarios
- Conformance server and client implementations
- OAuth/auth test scenarios: JWT, authorization code flow, client
credentials, PKCE, scope handling, cross-app access, client registration
- CI workflow
- Baseline file for tracking expected failures
- Shell script
fixes:
- #592
- #593
- #596
## Remaining known failures (tracked issues, will be fixed directly in
`main`)
- [x] `tools-call-with-logging`, `tools-call-with-progress`,
`tools-call-sampling`, `tools-call-elicitation`,
`elicitation-sep1034-defaults`- see #599,
- [x] `elicitation-sep1330-enums` - #587#600
- [x] `initialize` - #588
- [x] `tools_call`, `auth/scope-step-up`, `auth/scope-retry-limit` -
#589
- [ ] `elicitation-sep1034-client-defaults` - #414
- [x] `sse-retry` - #590
- [ ] `resources-templates-read` - #591
## Breaking Changes
from #596
- `StreamableHttpClientTransport` and
`mcpStreamableHttp`/`mcpStreamableHttpTransport`: old constructors
accepting `Duration` timeout are now `@Deprecated` — use the new
overloads with `ReconnectionOptions` instead
- `StreamableHttpClientTransport.close()` no longer calls
`terminateSession()` automatically
## Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
## Checklist
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [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
---------
Co-authored-by: Konstantin Pavlov <1517853+kpavlov@users.noreply.github.com>
closes#543
## How Has This Been Tested?
unit
## Breaking Changes
binary compatibility in the Tool class
## 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](https://modelcontextprotocol.io)
- [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
---------
Co-authored-by: Konstantin Pavlov <1517853+kpavlov@users.noreply.github.com>
## Rethrow CancellationException in StdioServerTransport, fix ReadBuffer
### Changes
1. StdioServerTransport
- Replace generic `Throwable` catches with specific
`CancellationException` and `Exception` for clarity and correctness.
**breaking change** `Throwable` is not handled any more!
- Refactor launching jobs to separate methods
- Introduce `READ_BUFFER_SIZE` constant to replace inline buffer size
literals.
- Add suppress annotations for clearer intent and constructor
documentation for better usability.
- Extend StdioServerTransportTest
2. ReadBuffer
Previously, readMessage() returned null after consuming an unparseable
line even when more complete lines existed in the buffer. This caused
valid messages following a bad line in the same chunk to be silently
dropped until the next chunk arrived (or forever, in tests).
Fix the loop so null means only "no complete line available", not
"encountered a parse failure". Blank/whitespace-only lines are now
silently skipped via isBlank() rather than forwarded to the deserializer
and logged as errors.
Refactor the method into three focused helpers:
- readMessage() — outer loop over lines
- readLine() — consume the next newline-delimited line from the buffer
- tryRecover() — attempt deserialization from the first '{' onward
3. Add utility method `runIntegrationTest` for integration testing
(`runBlocking` + `withTimeout`). Use it in StdioServerTransportTest
4. Store processing Job reference and `calcelAndJoin()` it on close.
Partially addressing #574
## Motivation and Context
See #575, #564, #242
## How Has This Been Tested?
Unit test added
## Breaking Changes
Semantic change: `Throwable` and CancellationException are not handled
any more!
## 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
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [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
<!-- Add any other context, implementation notes, or design decisions
-->
# Add DSL builder tests for Request, Capabilities, and Content types
- Introduced unit tests for `RequestDslTest`, `CapabilitiesDslTest`, and
`ContentDslTest` to validate DSL builder functionality.
- Covered edge cases, nested properties, custom fields, and overwrite
behavior for requests, capabilities, and content creation.
- Update AGENTS.md
## Motivation and Context
for confidence
## Breaking Changes
No
## Types of changes
- [x] Tests
## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [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
1. Migrate test-utils module to multiplatform, add serialization
utilities
- Migrated `test-utils` to support Kotlin Multiplatform (JVM, JS,
Native).
- Added `verifySerialization`, `verifyDeserialization`,
`verifySerializationRoundTrip` utilities to streamline and validate JSON
serialization/deserialization
2. Refactor serialization tests to use test serialization utilities
- Updated serialization tests across the project to use
`verifySerialization` and `verifyDeserialization` utilities.
- Improved consistency and ensured proper round-trip validation for JSON
deserialization.
3. Remove some detekt baseline files and suppress `LongMethod` findings
- Deleted detekt baseline XML files for test sources.
- Suppressed `LongMethod` findings in relevant tests using `@Suppress`
annotations.
- Replaced empty method implementations with explicit `// noop` comments
for clarity.
- Adjusted min test coverage threshold in `build.gradle.kts`.
## Motivation and Context
To improve serialization testing
## How Has This Been Tested?
Unit tests
## Breaking Changes
No
## 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
- [x] Refactoring
## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [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
Add $defs support in ToolSchema and update tests.
Motivation and Context
Fix parsing when tool schemas include $defs.
How Has This Been Tested?
`./gradlew :kotlin-sdk-core:jvmTest --tests
"io.modelcontextprotocol.kotlin.sdk.types.ToolsTest"`
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)
- [ ] 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
N/A
# Detekt setup hardeing; address some issues
- Address some detekt findings: missing KDocs, formatting, use `check*`
& `orEmpty()``
- Remove unnecessary KDoc comments from deprecated classes in `types.kt`
- Add Detekt baseline XML files for all modules
- Enforce stricter Detekt rules by setting `failOnSeverity` from `None`
to `Error`
## Motivation and Context
Detekt is not actually failing the build on violations. This PR is
enabling Detekt to fail on errors. Baseline fines added for historical
issues. Follow-up for #501
## How Has This Been Tested?
Regressions
## Breaking Changes
No breaking changes.
## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Refactoring
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [x] Documentation update
## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [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
## refactor: Introduce AbstractClientTransport and simplify client
transport lifecycle
This PR unifies state management logic across client transports, except
for the websocket transport, as it needs more refactoring first and is
not the primary transport.
- Introduce `AbstractClientTransport` as base class for other client
transports.
- Migrate to `ClientTransportState` states with state machine,
streamline state management.
- Ensure proper cleanup and error handling consistency across transport
implementations.
- Add unit tests to validate `AbstractClientTransport` behavior and
state transitions.
- Update related documentation and API contract.
- Make sure `onClose` callback is called at most once
- fix
[StreamableHttpClientTransportTest.kt](https://github.com/modelcontextprotocol/kotlin-sdk/pull/516/changes#diff-b9fe8891d08a492448a7ed2dc782151c6a915ae1403a4d70c2034c6062c84cb5)
to throw `McpException` on connect when received invalid Json
## Motivation and Context
Unify lifecycle handling and eliminate duplication in client Transport
implementations.
## How Has This Been Tested?
Unit test, regression tests
## Breaking Changes
- `onClose` callback is now called only once
- send(...) will throw McpException with message "Transport is not
ready" when `ClientTransportState != Operational`
## Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] Refactoring
- [ ] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] 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
## Additional context
See #517
#162
## Motivation and Context
- update readme
- add more snippets
- add knit
## How Has This Been Tested?
knit on CI
## Breaking Changes
None
## 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)
- [x] Documentation update
## Checklist
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [ ] I have added appropriate error handling
- [x] I have added or updated documentation as needed
---------
Co-authored-by: devcrocod <devcrocod@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- increase the deprecation level
- remove tests that use deprecated objects with deprecation level =
error
## Motivation and Context
deprecation lifecycle
## How Has This Been Tested?
-
## Breaking Changes
-
## 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
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [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
<!-- Provide a brief summary of your changes -->
## Motivation and Context
<!-- Why is this change needed? What problem does it solve? -->
The dsl builders in [this
commit](74c93745cd (diff-598edaa01d))
were mistakenly marked internal and are therefore unusable. I have
simply marked them as public.
## How Has This Been Tested?
<!-- Have you tested this in a real application? Which scenarios were
tested? -->
## Breaking Changes
No
## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [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
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [ ] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [ ] 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
<!-- Add any other context, implementation notes, or design decisions
-->
---------
Co-authored-by: Konstantin Pavlov <1517853+kpavlov@users.noreply.github.com>
# Update/Fix build workflow
- `macos-latest-xlarge` is no longer available. Switch to cheaper
runner: `macos-latest-xlarge` -> `macos-latest`
- Refactor build to run matrix job under Linux and macOS
- Tune caching GH caching
- Add junit and logger properties
- Downgrade Junit to 5.14.2
- Extract `ProcessBuilder` creation logic into helper functions
- Disable `StdioClientTransportTest` on windows temporary
## How Has This Been Tested?
CI
## Breaking Changes
Functionally - no. Outdated/broken TypeScript tests were disabled
## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [x] Bug fix (non-breaking change which fixes an issue)
- [x] CI Update
## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [ ] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [ ] 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
## Additional context
GitHub actions workflows were blocked because the selected
"macos-latest-xlarge" runner, which is not available for the free
open-source plan. With "macos-latest" workflow works.
# [WIP] StreamableHttpServerTransport implementation
- Implement StreamableHttpServerTransport for MCP spec
- Support both SSE streaming and direct HTTP JSON responses
- Add event store interface for resumability
> [!IMPORTANT]
> The work is in progress. StreamableHttpServerTransport is not
production-ready yet!!!
Based on #235
## How Has This Been Tested?
<!-- Have you tested this in a real application? Which scenarios were
tested? -->
## Breaking Changes
None
## 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](https://modelcontextprotocol.io)
- [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
# Better exception handling in StdioClientTransport
Refactor `McpException` for improved handling with convenience
constructors and enhanced exception wrapping logic in
`StdioClientTransport`. Update tests to use `kotest` matchers and add
JUnit parameterized tests for exception handling.
## Motivation and Context
#442 follow up
## How Has This Been Tested?
<!-- Have you tested this in a real application? Which scenarios were
tested? -->
## Breaking Changes
<!-- Will users need to update their code or configurations? -->
## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [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
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [ ] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [ ] 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
## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->
- Add convenience constructors to JSONRPCRequest
- Make UUID string a default JSONRPCRequest
## Motivation and Context
To create request objects more easily
## How Has This Been Tested?
Unit tests
## Breaking Changes
No, this is a new API
## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] 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
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] 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
## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->
Add support for `TransportSendOptions` in `Transport.send` method
## Motivation and Context
This change extends the `Transport.send` method signature to support
advanced transport features like resumption tokens and progress
callbacks. This is needed to enable:
- Long-running request resumption after reconnection
- Request-response association tracking
- Progress token handling in transport layer
needed for #235
## How Has This Been Tested?
All transport tests passed
## Breaking Changes
Yes, it’s necessary to update the custom Transport implementations.
For users who rely on the transports provided by the sdk, there’s no
breaking change
## Types of changes
- [x] 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](https://modelcontextprotocol.io)
- [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
This PR introduces type-safe DSL builders for all MCP request types,
making it easier to construct requests
### Current Solution
All request types now have DSL builders:
```kotlin
// Initialize request
val request = initializeRequest {
protocolVersion = "2024-11-05"
capabilities {
sampling(ClientCapabilities.sampling)
roots(listChanged = true)
}
info("MyClient", "1.0.0")
}
// Create message request with conversation
val messageRequest = createMessageRequest {
maxTokens = 1000
systemPrompt = "You are a helpful assistant"
messages {
user { "What is the capital of France?" }
assistant { "The capital of France is Paris." }
user { "What about Germany?" }
}
}
// Call tool request
val toolRequest = callToolRequest {
name = "searchDatabase"
arguments {
put("query", "users")
put("limit", 10)
}
}
// Elicit request with schema
val elicitRequest = elicitationRequest {
message = "Please provide your contact information"
requestedSchema {
properties {
put("email", JsonObject(mapOf(
"type" to JsonPrimitive("string"),
"description" to JsonPrimitive("Your email address")
)))
}
required = listOf("email")
}
}
```
Each DSL builder includes:
- Clear separation of required (but runtime) vs optional fields
- Multiple usage examples
- Concise error messages with examples when required fields are missing
- Cross-references to related types
### Design Considerations
1. Function Naming Convention
The current naming convention (e.g., initializeRequest, callToolRequest) might be confusing since these functions don't send requests, they just build request objects.
Alternative approach: Add a build prefix to clarify intent:
- `initializeRequest` → `buildInitializeRequest`
- `callToolRequest` → `buildCallToolRequest`
- `createMessageRequest` → `buildCreateMessageRequest`
This would make it clearer that these are builder functions.
2. Runtime vs Compile-Time Validation
Currently, required fields are validated at runtime in the `build()` method:
```kotlin
val request = initializeRequest {
protocolVersion = "2024-11-05"
// Missing required fields: capabilities, info
// Error thrown at runtime ❌
}
```
Alternative approach: Use Compose UI style where required parameters are in the function signature:
```kotlin
fun initializeRequest(
protocolVersion: String,
capabilities: ClientCapabilities,
info: Implementation,
block: InitializeRequestBuilder.() -> Unit = {}
): InitializeRequest
```
```kotlin
// Usage
val request = initializeRequest(
protocolVersion = "2024-11-05",
capabilities = ClientCapabilities(sampling =
ClientCapabilities.sampling),
info = Implementation("MyClient", "1.0.0")
) {
// Optional fields only
meta { put("key", "value") }
}
```
Pros:
- Compile-time safety for required fields ✅
- Clear which fields are required ✅
- Better IDE autocomplete ✅
Cons:
- Multiple trailing lambdas can be confusing:
```kotlin
// When required fields include lambdas
val request = elicitationRequest(
message = "Enter info",
requestedSchema = { /* lambda 1 */ }
) { /* lambda 2 for optional fields */ }
```
- Less consistent DSL feel
- More verbose for simple cases
## Motivation and Context
fix#220
## How Has This Been Tested?
locally
## Breaking Changes
None
## 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](https://modelcontextprotocol.io)
- [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
Add tests with new schema types
## Motivation and Context
<!-- Why is this change needed? What problem does it solve? -->
## How Has This Been Tested?
The repository currently contains duplicated tests:
- tests using the new schema
- tests using the old schema for compatibility checks. they will be
removed once the deprecation level is raised
## Breaking Changes
No
## 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
- [x] Testing
## Checklist
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [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
---------
Co-authored-by: Konstantin Pavlov <1517853+kpavlov@users.noreply.github.com>
- add the warning message to `ExperimentalMcpApi` annotation
- change level from error to warning
## 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)
- [x] Documentation update
## Checklist
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [ ] I have added appropriate error handling
- [x] I have added or updated documentation as needed
- Introduced `@ExperimentalMcpApi` annotation to mark experimental APIs.
- Added `mcpClient` function for initializing and connecting MCP
clients.
- Modified tests to utilize the new `mcpClient` function.
- Refactored variable naming in transport tests for improved
readability.
## Motivation and Context
To improve the creation of the MCP Client experience.
## How Has This Been Tested?
Integration test updated
## Breaking Changes
No
## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] 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
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [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
<!-- Add any other context, implementation notes, or design decisions
-->
- Updated integration tests to include assertions for `meta` being
`null` in the `listTools`, `listResources`, `readResource`, and
`callTool` results.
- Renamed test cases in `SseServerIntegrationTest` for clarity.
- Added (deprecated) synthetic constructors for various request
parameter classes.
- Enhanced naming conventions and structure in integration test cases.
- Replaced `throw Error(...)` with `error(...)` for cleaner error
handling.
## Motivation and Context
To verify backwards-compatibility after schema change
## How Has This Been Tested?
CI, integration tests, regression tests (samples)
## Breaking Changes
<!-- Will users need to update their code or configurations? -->
## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] 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
- [x] Test update
## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] 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
## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->