mcp: add 2026-07-28 to the supported protocol versions (#1020)

This PR adds the protocol version `2026-07-28` to the list of supported
protocol versions and fixes legacy tests hardcoding the legacy protocol
version for those use cases.
This commit is contained in:
Guglielmo Colombo 2026-06-24 12:02:56 +02:00 • committed by GitHub
commit 7f4aa4a0ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 355 additions and 218 deletions

View file

@ -0,0 +1,39 @@
The client sends a discover request
carrying the required per-request _meta triple (protocolVersion, clientInfo,
clientCapabilities), and the server replies with the protocol versions it
supports, its capabilities, and its identity.
-- client --
{
"jsonrpc": "2.0",
"id": 1,
"method": "server/discover",
"params": {
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientInfo": { "name": "ExampleClient", "version": "1.0.0" },
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}
-- server --
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"supportedVersions": [
"2026-07-28",
"2025-11-25",
"2025-06-18",
"2025-03-26",
"2024-11-05"
],
"capabilities": {
"logging": {}
},
"serverInfo": {
"name": "testServer",
"version": "v1.0.0"
}
}
}

View file

@ -0,0 +1,85 @@
Check the multi-round-trip request pattern under protocol version
2026-07-28. The server's tool handler returns an
InputRequiredResult on the first call, requesting elicitation input from the
client and providing an opaque RequestState token. The client fulfills the
input request and retries the tool call with the responses and the echoed
RequestState; the handler then returns the final result.
-- tools --
confirmThenGreet
-- client --
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientInfo": { "name": "ExampleClient", "version": "1.0.0" },
"io.modelcontextprotocol/clientCapabilities": { "elicitation": {} }
},
"name": "confirmThenGreet",
"arguments": {}
}
}
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientInfo": { "name": "ExampleClient", "version": "1.0.0" },
"io.modelcontextprotocol/clientCapabilities": { "elicitation": {} }
},
"name": "confirmThenGreet",
"arguments": {},
"requestState": "step=1",
"inputResponses": {
"who": {
"method": "elicitation/create",
"result": { "action": "accept", "content": { "name": "MCP Go" } }
}
}
}
}
-- server --
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": null,
"requestState": "step=1",
"resultType": "input_required",
"inputRequests": {
"who": {
"method": "elicitation/create",
"params": {
"mode": "",
"message": "What is your name?",
"requestedSchema": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
}
}
}
}
}
}
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"content": [
{
"type": "text",
"text": "hello MCP Go"
}
],
"resultType": "complete"
}
}