go-sdk/mcp
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
..
testdata internal/mcp: add JSON conformance tests, and fix some bugs 2025-05-28 10:00:05 -07:00
client.go internal/mcp: meta and progress token 2025-05-27 12:53:53 -07:00
cmd.go internal/mcp: add a command transport for connecting to a sidecar 2025-05-01 17:43:04 -07:00
cmd_test.go internal/mcp: reinstate ClientSession 2025-05-14 12:41:58 -07:00
conformance_test.go internal/mcp: add JSON conformance tests, and fix some bugs 2025-05-28 10:00:05 -07:00
content.go all: fix some function names and typos in comment 2025-05-23 10:44:52 -07:00
content_test.go internal/mcp: pointerize all the things 2025-05-14 06:22:56 -07:00
features.go internal/mcp: keep an ordered list of feature keys 2025-05-20 13:37:12 -07:00
features_test.go internal/mcp: keep an ordered list of feature keys 2025-05-20 13:37:12 -07:00
generate.go internal/mcp: meta and progress token 2025-05-27 12:53:53 -07:00
logging.go internal/mcp: implement logging 2025-05-22 15:02:13 -07:00
mcp.go internal/mcp: construct README with weave 2025-05-21 16:21:26 -07:00
mcp_test.go internal/mcp: add JSON conformance tests, and fix some bugs 2025-05-28 10:00:05 -07:00
prompt.go internal/mcp: future-proof prompt handling 2025-05-22 15:06:03 -07:00
prompt_test.go internal/mcp: future-proof prompt handling 2025-05-22 15:06:03 -07:00
protocol.go internal/mcp: meta and progress token 2025-05-27 12:53:53 -07:00
resource.go internal/mcp: sampling 2025-05-19 11:15:58 -07:00
resource_go124.go internal/mcp: add the FileResourceHandler method 2025-05-19 11:15:23 -07:00
resource_pre_go124.go internal/mcp: add the FileResourceHandler method 2025-05-19 11:15:23 -07:00
resource_test.go internal/mcp: add the FileResourceHandler method 2025-05-19 11:15:23 -07:00
root.go internal/mcp: implement roots 2025-05-13 07:52:49 -07:00
server.go internal/mcp: add JSON conformance tests, and fix some bugs 2025-05-28 10:00:05 -07:00
server_example_test.go internal/mcp: add pagination for prompts 2025-05-28 07:06:31 -07:00
server_test.go internal/mcp: add pagination for resources 2025-05-27 12:29:32 -07:00
shared.go internal/mcp: add JSON conformance tests, and fix some bugs 2025-05-28 10:00:05 -07:00
shared_test.go internal/mcp: meta and progress token 2025-05-27 12:53:53 -07:00
sse.go all: fix some function names and typos in comment 2025-05-23 10:44:52 -07:00
sse_example_test.go internal/mcp: reinstate ClientSession 2025-05-14 12:41:58 -07:00
sse_test.go internal/mcp: reinstate ClientSession 2025-05-14 12:41:58 -07:00
tool.go internal/mcp/design: further clean-up 2025-05-14 14:28:07 -07:00
tool_test.go internal/mcp/design: further clean-up 2025-05-14 14:28:07 -07:00
transport.go internal/mcp: dispatcher middleware 2025-05-16 11:24:52 -07:00
transport_test.go internal/mcp: implement HTTP SSE transport 2025-04-23 19:15:20 -07:00
util.go internal/mcp: meta and progress token 2025-05-27 12:53:53 -07:00
util_test.go internal/mcp: meta and progress token 2025-05-27 12:53:53 -07:00