kotlin-sdk/kotlin-sdk-client
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Andre.Kalberer 7fa438ce00
feat(client): send MCP standard POST headers (#894)
## Problem

SEP-2243 requires Streamable HTTP clients to mirror applicable JSON-RPC
request metadata into standard HTTP headers. The Kotlin client currently
sends `Mcp-Protocol-Version` and session metadata but does not emit
`Mcp-Method` or `Mcp-Name`.

## Solution

- Add `Mcp-Method` for JSON-RPC requests and notifications.
- Add `Mcp-Name` from a string `params.name`, falling back to a string
`params.uri`.
- Omit both headers for JSON-RPC responses.
- Add focused transport tests for name-, URI-, notification-, and
response-based behavior.

## Validation

- `.\gradlew.bat :kotlin-sdk-client:jvmTest --tests
"io.modelcontextprotocol.kotlin.sdk.client.streamable.http.StreamableHttpClientTransportTest"`
- `.\gradlew.bat :kotlin-sdk-client:ktlintCheck
:kotlin-sdk-client:detekt :kotlin-sdk-client:apiCheck`
- `git diff --check`

Closes #787

AI assistance was used while preparing this PR. I reviewed the final
change, ran the validation listed above, and take responsibility for it.

---------

Co-authored-by: Pavel Gorgulov <devcrocod@gmail.com>
2026-07-27 15:29:51 +02:00
..
api feat(core): concurrent inbound dispatch behind an initialization gate (#884) 2026-07-15 12:33:29 +02:00
src feat(client): send MCP standard POST headers (#894) 2026-07-27 15:29:51 +02:00
build.gradle.kts test: remove mokksy dependency (#754) 2026-05-18 12:17:26 +02:00
detekt-baseline-main.xml refactor: explicit locked detekt config (#729) 2026-04-29 12:31:49 +02:00
Module.md docs: Update readme, enable Knit (#162) (#510) 2026-02-06 18:40:31 +02:00