## 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>
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
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
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
<!-- 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>
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
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
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
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>
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
## 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
<!-- 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>
# [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
- 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
-->
# Refactor and enhance prompt handling logic and tests, update Kotest
version and modularize `AbstractTransport`
- Added more post-conditions/scenarios to ServerPromptsTest
- Extracted `AbstractTransport` to a dedicated file for modularity.
- Improved Protocol connection state validation: When disconnected, the
Protocol will throw `IllegalStateException` instead of `Error`.
- Minor Kotlin fixes and suppressions to improve code quality.
## Motivation and Context
Improve test scenarios in ServerPromptsTest
## How Has This Been Tested?
Integration tests updated
## Breaking Changes
When disconnected, the Protocol will throw `IllegalStateException`
instead of `Error`.
## 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)
- [x] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [x] Test 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
## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->
Add properties for types of new schema
## Motivation and Context
Added getters to simplify access to properties in request and
notification types.
## How Has This Been Tested?
All tests pass
## 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
Implement the last version of the mcp schema and complete restructuring
of the mcp schema implementation from a monolithic `types.kt` file into
separate files.
- #158
- #185
- #353
- #298
- #248
## Motivation and Context
The previous implementation of the mcp schema was outdated and contained
several issues. In addition, it stored all mcp types in a single large
file, which made maintenance and further development more difficult
## How Has This Been Tested?
All tests passed
## Breaking Changes
Yes. The new types are now located in a separate package. Additionally,
many types have new parameters and modified constructors
## 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
## Additional context
to adopt the new structure:
**Before:**
```kotlin
import io.modelcontextprotocol.kotlin.sdk.InitializeRequest
import io.modelcontextprotocol.kotlin.sdk.Resource
```
**After:**
```kotlin
import io.modelcontextprotocol.kotlin.sdk.types.InitializeRequest
import io.modelcontextprotocol.kotlin.sdk.types.Resource
```
Replace `Instant` with `String` for `lastModified` in `Annotations`
## Motivation and Context
To fix serialization/kotlin library version conflicts
## How Has This Been Tested?
Unit test
## Breaking Changes
Yes
## 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)
- [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
<!-- Add any other context, implementation notes, or design decisions
-->
<!-- Provide a brief summary of your changes -->
## Motivation and Context
The recently released openAI [Apps SDK
](https://developers.openai.com/apps-sdk/reference/#_meta-fields-the-client-provides)adds
a '__meta_' field on the Tool Descriptor. This would be in addition to
it being available on Messages. It remains optional and defaults to an
empty json object, following existing conventions.
## How Has This Been Tested?
Unit tests for serialization added
## Breaking Changes
N/A
## 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
https://developers.openai.com/apps-sdkhttps://developers.openai.com/apps-sdk/reference/#_meta-fields-the-client-provides
---------
Co-authored-by: Pavel Gorgulov <devcrocod@gmail.com>
<!-- Provide a brief summary of your changes -->
## Motivation and Context
The
[schema](cca15204f6/schema/2025-03-26/schema.ts (L192))
for the InitializeResult contains an optional 'instructions' string
## Additional context
The instructions string is included in the schema for for version
"2025-03-26"
The instructions in the Server class are given as a provider function
with the result of the provider propagated to the underlying
ServerSession. As the ServerSession change is meant to allow for a
'Singleton scoped' server class, this provides the ability to
dynamically modify the instructions at the server level but have them be
immutable per session.
This also refactors the `serverInfo` and `instructions` properties to be
protected. This `Server` class is open and meant to be overridden, there
is no harm in having these immutable properties available to subclasses.
This adds the serverInstructions to the client as returned from the
InitializeResult. This is used to verify the response in the Server
tests.
One may run it manually to generate classes from JSON Schema
## Motivation and Context
Most of the generated classes could not be used in the current API
today.
On the other hand, it is useful to be able to generate such classes to
simplify manual API synchronization. So, Gradle plugin configuration is
preserved, but detached from the build pipeline.
- Add OpenAPI Generator to build system to automatically generate MCP
protocol data classes from the official schema.
- Configure code quality tools to exclude generated files
- Add deserialization test
## Motivation and Context
Writing classes by hand is error-prone, when json schema exists. See
#185,
Also, autogenerating model classes ensures the SDK is in sync with the
protocol and can quickly catch up with its changes (see #218)
## How Has This Been Tested?
Regression tests
## 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)
- [ ] 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
-->
* chore: rename ResourceReference to ResourceTemplateReference
* rename resource references in tests and update api
---------
Co-authored-by: devcrocod <devcrocod@gmail.com>
* Modularize SDK: migrated client and server implementations to separate modules. Removed old configuration files and reorganized the source code structure
* add support native targets and update js/wasm configurations
* Refactor sample projects: add samples as composite builds, replace hardcoded dependencies with version catalog, remove obsolete gradle wrapper files
* Update .gitignore: exclude SWE agent directories (.claude/ and .junie/)
* Refine CodeQL workflow: update Kotlin build steps to target individual modules separately instead of building all at once