go-sdk/internal/jsonrpc2
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Rob Findley e2bbd8002d internal/mcp: add JSON conformance tests, and fix some bugs
Add the beginnings of some testdata-driven conformance tests that check
JSON-level compatibility of SDK messages, and fix some bugs in our JSON
message handling:

- "params" can be missing
- "_meta" should not be null
- lists of tools/prompts/resources should not be null

In order to implement this, we need to be able to know when the server
is done processing messages. In general, this is a hard problem; for
gopls we do this with a complicated system of progress reporting and
accounting. However, the new synctest package makes this trivial, as we
can call synctest.Wait to detect when the server is idle. Therefore,
this test requires 1.25 (it uses synctest.Test, added in 1.25, and so
can't run at 1.24 with GOEXPERIMENT=synctest).

Change-Id: I97fa28b56868340ece266a58e1eb3c3bf8cfe0e9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/676538
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
2025-05-28 10:00:05 -07:00
..
conn.go internal/mcp: implement HTTP SSE transport 2025-04-23 19:15:20 -07:00
frame.go internal/mcp: add batching support 2025-04-22 14:39:09 -07:00
jsonrpc2.go x/tools: modernize interface{} -> any 2025-02-19 15:14:27 -08:00
jsonrpc2_test.go internal/mcp: an MCP SDK prototype 2025-04-22 14:37:47 -07:00
messages.go internal/mcp: add JSON conformance tests, and fix some bugs 2025-05-28 10:00:05 -07:00
net.go internal/jsonrpc2_v2: update for go1.16+ 2025-05-27 10:50:54 -07:00
serve.go internal/mcp: implement HTTP SSE transport 2025-04-23 19:15:20 -07:00
serve_test.go internal/mcp: an MCP SDK prototype 2025-04-22 14:37:47 -07:00
wire.go x/tools: modernize interface{} -> any 2025-02-19 15:14:27 -08:00
wire_test.go x/tools: modernize interface{} -> any 2025-02-19 15:14:27 -08:00