go-sdk/internal/jsonrpc2
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Guglielmo Colombo c60a318d22
mcp: Implement support for SEP-2575 on client side (#975)
Implements the client half of the SEP-2575 / `2026-06-30` protocol. This
CL is client-only; server-side `server/discover` is still a
`MethodNotFound` stub.
### Changes
- **`server/discover` probe in `Client.Connect()`** (`client.go`). When
the caller opts into `protocolVersion >= 2026-06-30`, the client probes
the server with `server/discover` before falling back to the legacy
`initialize`
  handshake.
- **Per-request `_meta` injection** (`shared.go`, `injectRequestMeta`).
For`>= 2026-06-30` sessions every outgoing request gets the SEP-2575
triple (`protocolVersion`, `clientInfo`, `clientCapabilities`).
- **Server-side fix**: `ServerSession.handle` no longer pre-populates
`state.InitializeParams` from a `server/discover` request's `_meta`, so
a subsequent fallback `initialize` is not rejected as a duplicate.
### Fallback rules
Client falls back to the legacy `initialize` handshake when discover
returns:
- `MethodNotFound` (-32601),
- `UnsupportedProtocolVersionError` (-32004),
- an HTTP `Bad Request` (substring-matched on the error message, to
interop
  with pre-2026-06-30 servers).

Fixes #966
2026-06-02 14:17:01 +02:00
..
conn.go mcp: Implement support for SEP-2575 on client side (#975) 2026-06-02 14:17:01 +02:00
jsonrpc2.go internal/jsonrpc2: remove unused code (#910) 2026-04-28 09:56:15 +02:00
messages.go MCPGODEBUG update for 1.6.0 (#893) 2026-04-30 09:54:32 +02:00
wire.go mcp: Implement support for SEP-2575 on client side (#975) 2026-06-02 14:17:01 +02:00
wire_test.go x/tools: modernize interface{} -> any 2025-02-19 15:14:27 -08:00