kotlin-sdk/integration-test
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Takuya Akamatsu 737b46f032
feat(server): validate accepted elicitation content against the requested schema (#896)
Validate accepted form-mode elicitation `content` against the
`requestedSchema` on the server, rejecting mismatches with an
`INVALID_PARAMS` error.

fixes #895

<!-- Provide a brief summary of your changes -->

## Motivation and Context
<!-- Why is this change needed? What problem does it solve? -->
`createElicitation` returned accepted content to server code as-is. The
specification's
form-mode security guidance says "Servers SHOULD validate received data
matches the requested
schema" ([2025-11-25, Form Mode
Security](https://modelcontextprotocol.io/specification/2025-11-25/client/elicitation#form-mode-security)).
Comparable validation already exists in the TypeScript SDK's
`elicitInput` and Python's `elicit_with_validation` helper. Details and
design notes are in #895.

## How Has This Been Tested?
<!-- Have you tested this in a real application? Which scenarios were
tested? -->
New unit tests for the validator and integration tests over an in-memory
client–server pair.

## Breaking Changes
<!-- Will users need to update their code or configurations? -->
No API changes. Behavioral note: an accepted form-mode response that
does not match the requested schema now fails `createElicitation` with
`McpException` (`INVALID_PARAMS`) instead of being returned to the
caller.

## 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

Co-authored-by: Pavel Gorgulov <devcrocod@gmail.com>
2026-07-21 18:17:16 +02:00
..
src feat(server): validate accepted elicitation content against the requested schema (#896) 2026-07-21 18:17:16 +02:00
build.gradle.kts refactor: explicit locked detekt config (#729) 2026-04-29 12:31:49 +02:00