fix: validate protocol version header on initialization requests (#697)
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
This commit is contained in:
parent
eb24803547
commit
bce6811b66
1 changed files with 49 additions and 24 deletions
|
|
@ -12,7 +12,7 @@ import kotlinx.serialization.json.JsonObject
|
|||
public const val LATEST_PROTOCOL_VERSION: String = "2025-11-25"
|
||||
|
||||
/** The default protocol version used when negotiation is not performed. */
|
||||
public const val DEFAULT_NEGOTIATED_PROTOCOL_VERSION: String = "2025-06-18"
|
||||
public const val DEFAULT_NEGOTIATED_PROTOCOL_VERSION: String = "2025-03-26"
|
||||
|
||||
/** All MCP protocol versions supported by this SDK. */
|
||||
public val SUPPORTED_PROTOCOL_VERSIONS: List<String> = listOf(
|
||||
|
|
|
|||
Loading…
Reference in a new issue