kotlin-sdk/kotlin-sdk-client/src
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
..
commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/client feat(client): send MCP standard POST headers (#894) 2026-07-27 15:29:51 +02:00
commonTest/kotlin/io/modelcontextprotocol/kotlin/sdk/client feat(client): send MCP standard POST headers (#894) 2026-07-27 15:29:51 +02:00
jvmTest test: remove mokksy dependency (#754) 2026-05-18 12:17:26 +02:00