feat: implement MCP-Protocol-Version header requirement for HTTP transport (#898)

This commit is contained in:
Felix Weinberger
2025-06-12 18:01:53 +01:00
committed by GitHub
parent 0bcecffc4c
commit df15e9566d
6 changed files with 268 additions and 21 deletions

View File

@@ -24,6 +24,14 @@ for reference.
LATEST_PROTOCOL_VERSION = "2025-03-26"
"""
The default negotiated version of the Model Context Protocol when no version is specified.
We need this to satisfy the MCP specification, which requires the server to assume a
specific version if none is provided by the client. See section "Protocol Version Header" at
https://modelcontextprotocol.io/specification
"""
DEFAULT_NEGOTIATED_VERSION = "2025-03-26"
ProgressToken = str | int
Cursor = str
Role = Literal["user", "assistant"]