Add mcp-stateless module: migrate an MCP server from the 2025 stateful protocol to 2026-07-28 on Spring AI 2.1.0
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b4tJPXfq5UyiLSFr49
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
3aa20a1dce
commit
26e0a3875a
@@ -0,0 +1,29 @@
|
||||
# 2026-07-28 server (protocol MODERN): no handshake, no session, three self-contained POSTs
|
||||
|
||||
## 1. server/discover replaces initialize
|
||||
> POST /mcp
|
||||
> MCP-Protocol-Version: 2026-07-28
|
||||
> Mcp-Method: server/discover
|
||||
> {"jsonrpc":"2.0","id":1,"method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"wire-test","version":"1"},"io.modelcontextprotocol/clientCapabilities":{"elicitation":{"form":{}}}}}}
|
||||
< 200
|
||||
< Content-Type: application/json
|
||||
< {"jsonrpc":"2.0","id":1,"result":{"supportedVersions":["2026-07-28"],"capabilities":{"completions":{},"prompts":{"listChanged":true},"resources":{"subscribe":false,"listChanged":true},"tools":{"listChanged":true}},"instructions":"Order lookup server used to compare the 2025 and 2026-07-28 MCP protocol generations.","ttlMs":300000,"cacheScope":"public","resultType":"complete","_meta":{"io.modelcontextprotocol/serverInfo":{"name":"orders","version":"1.0.0"}}}}
|
||||
|
||||
## 2. tools/list
|
||||
> POST /mcp
|
||||
> MCP-Protocol-Version: 2026-07-28
|
||||
> Mcp-Method: tools/list
|
||||
> {"jsonrpc":"2.0","id":2,"method":"tools/list","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"wire-test","version":"1"},"io.modelcontextprotocol/clientCapabilities":{"elicitation":{"form":{}}}}}}
|
||||
< 200
|
||||
< Content-Type: application/json
|
||||
< {"jsonrpc":"2.0","id":2,"result":{"tools":[{"name":"cancel_order","title":"cancel_order","description":"Cancels an order after the user confirms","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"orderId":{"type":"string","description":"Order id such as A-101"}},"required":["orderId"]},"annotations":{"title":"","readOnlyHint":false,"destructiveHint":true,"idempotentHint":true,"openWorldHint":false}},{"name":"order_status","title":"order_status","description":"Looks up the status of an order by its id","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"orderId":{"type":"string","description":"Order id such as A-101"}},"required":["orderId"]},"annotations":{"title":"","readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}}],"ttlMs":300000,"cacheScope":"public","resultType":"complete","_meta":{"io.modelcontextprotocol/serverInfo":{"name":"orders","version":"1.0.0"}}}}
|
||||
|
||||
## 3. tools/call carries the tool name in a header as well as in the body
|
||||
> POST /mcp
|
||||
> MCP-Protocol-Version: 2026-07-28
|
||||
> Mcp-Method: tools/call
|
||||
> Mcp-Name: order_status
|
||||
> {"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"order_status","arguments":{"orderId":"A-101"},"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"wire-test","version":"1"},"io.modelcontextprotocol/clientCapabilities":{"elicitation":{"form":{}}}}}}
|
||||
< 200
|
||||
< Content-Type: application/json
|
||||
< {"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"order A-101 is SHIPPED (answered by instance M1)"}],"isError":false,"resultType":"complete","_meta":{"io.modelcontextprotocol/serverInfo":{"name":"orders","version":"1.0.0"}}}}
|
||||
Reference in New Issue
Block a user