mcp: fix broken client root capabilities (#698)
To address #607, add ClientCapabilities.RootsV2, and populate it when constructing sending and receiving InitializeParams. Fixes #607
This commit is contained in:
parent
307e32c2b3
commit
a5e369ed12
2 changed files with 288 additions and 57 deletions
|
|
@ -30,3 +30,9 @@ v2.
|
|||
|
||||
- `AudioContent.MarshalJSON` should have had a pointer receiver, to be
|
||||
consistent with other content types.
|
||||
|
||||
- `ClientCapabilities.Roots` should have been a distinguished struct pointer
|
||||
([see #607](https://github.com/modelcontextprotocol/go-sdk/issues/607)).
|
||||
|
||||
**Workaround**: use `ClientCapabilities.RootsV2`, which aligns with the
|
||||
semantics of other capability fields.
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ func ExampleLoggingTransport() {
|
|||
|
||||
// Output:
|
||||
// read: {"jsonrpc":"2.0","id":1,"result":{"capabilities":{"logging":{}},"protocolVersion":"2025-06-18","serverInfo":{"name":"server","version":"v0.0.1"}}}
|
||||
// write: {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"capabilities":{"roots":{"listChanged":true}},"clientInfo":{"name":"client","version":"v0.0.1"},"protocolVersion":"2025-06-18"}}
|
||||
// write: {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"client","version":"v0.0.1"},"protocolVersion":"2025-06-18","capabilities":{"roots":{"listChanged":true}}}}
|
||||
// write: {"jsonrpc":"2.0","method":"notifications/initialized","params":{}}
|
||||
}
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in a new issue