Commit graph go-sdk/design
Author SHA1 Message Date
Rob Findley
dac5be2c50 internal/mcp: simplify content
Now that the protocol package is merged into the mcp package, clean up
the higher level 'Content' union types, in favor of types constructors.

Change-Id: I37bedb0ff0a296eef799ba65c37ca7f94ee1dbbe
Reviewed-on: https://go-review.googlesource.com/c/tools/+/672415
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Bypass: Jonathan Amsterdam <jba@google.com>
2025-05-13 15:03:25 -07:00
Sam Thanawalla
a7e8f02389 internal/mcp/design: add pagination
Design for pagination.

Change-Id: I8257a499b1e4691382b5681b84a52030344ab0e3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/671135
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2025-05-13 13:20:30 -07:00
Jonathan Amsterdam
f43c749c93 internal/mcp: describe standard rpc signature
Mention that all methods from the spec have the same signature,
and then don't repeat those method declarations.

Modify all method calls in the doc to take a Params struct, even if
the current MCP spec says it is empty.

Change `string` to `[]byte` in some of the listed struct fields.
The current code generator incorrectly generates these as strings.
(I have a forthcoming CL to fix that.)

Also, elaborate the logging design.

Change-Id: I5f323d4d98a4b6045d3cdef770d13b4bfdcb1044
Reviewed-on: https://go-review.googlesource.com/c/tools/+/671358
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Bypass: Jonathan Amsterdam <jba@google.com>
2025-05-13 08:26:52 -07:00
Jonathan Amsterdam
acd35cb7e5 internal/mcp: add resource subscriptions
Handle resource subscriptions by delegating to the user.

We don't need to use the word "Resource" in the handlers because
the Subscribe and Unsubscribe methods in the spec don't use that
name. If the spec adds another kind of subscription, they will pick
a new name.

The need for two handlers is dictated by backward compatibility.
We must pass the RPC params to the subscription handler, which means
we need different signatures for subscribe and unsubscribe.

Change-Id: I045abaf52dc9c3e96181331728d50cf36cc8ed91
Reviewed-on: https://go-review.googlesource.com/c/tools/+/671895
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Bypass: Jonathan Amsterdam <jba@google.com>
2025-05-13 08:26:31 -07:00
Jonathan Amsterdam
cbb874302f internal/mcp: design.md: adjust resource design
Add handlers for reading resources.

Change-Id: Ibe0553a02c6fa2b5159cc406c7c4481984b1a460
Reviewed-on: https://go-review.googlesource.com/c/tools/+/671357
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Bypass: Jonathan Amsterdam <jba@google.com>
2025-05-12 13:15:17 -07:00
Jonathan Amsterdam
92ee792363 internal/mcp: fix roots design
Minor changes to the roots part of the design.

Change-Id: I8125aecc5da297594f74d8d7dc5ef3d94dfa8519
Reviewed-on: https://go-review.googlesource.com/c/tools/+/671356
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Bypass: Jonathan Amsterdam <jba@google.com>
2025-05-12 06:39:01 -07:00
Jonathan Amsterdam
b767218505 internal/mcp/design.md: minor changes
Fix typos and formatting, reword slightly.

Also, change names in the middleware section.

Change-Id: Ie86e5f633a07675ab188a8aaf70e51a48b0878bb
Reviewed-on: https://go-review.googlesource.com/c/tools/+/671555
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Bypass: Jonathan Amsterdam <jba@google.com>
2025-05-09 12:29:46 -07:00
Rob Findley
0f2d85336d internal/mcp/design: weave discussion of differences with mcp-go
Put discussion of mcp-go up front, and address differences in the
individual sections. I think this leads to easier reading for the user
who is concerned about our divergence in design.

Change-Id: Ifd21f6b9eb570ad4a325b8a8800b7868dac12205
Reviewed-on: https://go-review.googlesource.com/c/tools/+/671556
TryBot-Bypass: Robert Findley <rfindley@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Commit-Queue: Robert Findley <rfindley@google.com>
2025-05-09 12:14:29 -07:00
Rob Findley
7df3da6467 internal/mcp/design: remove the protocol package; update tools
Per discussion, remove the separate protocol package in favor of a
single mcp package. Update the tools section accordingly, and add more
discussion about the decision of the NewTool API.

Change-Id: Ifb259555ca9d493ce63bc4f71e5f2fa295bdf09c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/671496
TryBot-Bypass: Robert Findley <rfindley@google.com>
Commit-Queue: Robert Findley <rfindley@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2025-05-09 09:55:46 -07:00
Rob Findley
47f4506702 internal/design: minor cleanup; add 'errors' and 'ping' sections
Perform some minor cleanup:
- Resolve semantic conflicts updating ServerConnection->ServerSession
- Use 'go' code blocks throughout

Also, add brief sections discussing error handling and 'ping/keepalive'.

Change-Id: I9ee888a7f0506ca380c2d4d4f9965a4c399aac19
Reviewed-on: https://go-review.googlesource.com/c/tools/+/671495
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Commit-Queue: Robert Findley <rfindley@google.com>
TryBot-Bypass: Robert Findley <rfindley@google.com>
2025-05-09 09:54:58 -07:00
Jonathan Amsterdam
d07cf5f246 internal/mcp/design.md: prompts and resources
Change-Id: I5663e14846e3a37bea6947a12fbe57117b07174b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/671497
TryBot-Bypass: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2025-05-09 09:37:35 -07:00
Jonathan Amsterdam
d7848c9e90 internal/mcp: progress notifications
Change-Id: I3dad9326a88c14d08d62395f603862f71f887a75
Reviewed-on: https://go-review.googlesource.com/c/tools/+/671475
TryBot-Bypass: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2025-05-09 09:25:50 -07:00
Rob Findley
e2248b0f80 internal/mcp/design: add a section on cancellation
Change-Id: If18a7d8efa37a6f34ae42f4d1896464800ebcdc7
Reviewed-on: https://go-review.googlesource.com/c/tools/+/671435
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-05-09 08:10:55 -07:00
Rob Findley
c8966c94f3 internal/mcp/design: add section on clients and servers
After much deliberation, revert back to the symmetrical many-to-one form
of the client APIs. Every time I tried to write the asymmetrical form, I
couldn't justify it. Furthermore, I think the names 'ClientSession' and
'ServerSession' significantly clarify the meaning.

Change-Id: I5c5e1eaf0d5de5ac7c98dab7aad9c0f31c3ff4e1
Reviewed-on: https://go-review.googlesource.com/c/tools/+/671177
Auto-Submit: Robert Findley <rfindley@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-05-09 08:10:30 -07:00
Jonathan Amsterdam
814865c687 internal/mcp/design.md: completions
Design for the completions feature.
Change-Id: Ia793091a10adb9c51472a9d3d4acdce8d6932536
Reviewed-on: https://go-review.googlesource.com/c/tools/+/671376
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Bypass: Jonathan Amsterdam <jba@google.com>
2025-05-09 08:03:51 -07:00
Jonathan Amsterdam
62401f56bd internal/mcp/design.md: client features
Change-Id: Iaed3461bcb35ca65c3118cafa0a5bbddfbd41ecc
Reviewed-on: https://go-review.googlesource.com/c/tools/+/671375
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Bypass: Jonathan Amsterdam <jba@google.com>
2025-05-09 08:03:31 -07:00
Jonathan Amsterdam
908c91313e internal/mcp: tool section of design
Describe our tool design. This is short because most of the interesting
part is in the JSON Schema section.

Change-Id: I017fca3055aef881285280a379e9f235bf95e75d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/671355
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Bypass: Jonathan Amsterdam <jba@google.com>
2025-05-09 08:03:14 -07:00
Jonathan Amsterdam
74880af5fb internal/mcp: JSON Schema design
Describe how we use JSON Schema.

Change-Id: I488a09854333ba7280401e3bed5f50f83f481cd2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/671215
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Bypass: Jonathan Amsterdam <jba@google.com>
2025-05-09 03:51:36 -07:00
Jonathan Amsterdam
8ea274d324 internal/mcp/design: describe mcp-go delta
Describe the differences with mcp-go, and justify our choices.

Change-Id: Ib9b7ed87b8038f0b7cbc0eeffc5d7a7075eeae30
Reviewed-on: https://go-review.googlesource.com/c/tools/+/671017
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Bypass: Jonathan Amsterdam <jba@google.com>
2025-05-09 03:26:29 -07:00
Rob Findley
d174d6405a internal/mcp/design: discuss generated protocol types
Discuss generated protocol types, and expand on the section on package
layout to make it clearer how they fit in to the SDK.

Change-Id: I3beaa86c2396e0cee41dcc8eac06d93c54cb96df
Reviewed-on: https://go-review.googlesource.com/c/tools/+/671016
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-05-08 13:02:41 -07:00
Rob Findley
e0d4191c70 internal/mcp: a new extensibility point for HTTP transports
Expose the SSEServerTransport type, so that clients can customize the
handling of sessions and endpoints by writing their own HTTP handler.
This is similar to the behavior of the typescript SDK.

Also, finish documenting transports in the design doc.

Change-Id: Ief5aa8424ba2946a9615e366969a4750f40224a8
Reviewed-on: https://go-review.googlesource.com/c/tools/+/671015
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-08 12:19:33 -07:00
Jonathan Amsterdam
f1015cdc35 internal/mcp/design: logging
Design for logging.

Change-Id: I787bb51318337bd09f973e04d0e4dbf526e09fb6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/670935
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Auto-Submit: Jonathan Amsterdam <jba@google.com>
2025-05-08 08:16:01 -07:00
Rob Findley
390d437d4f internal/mcp/design: start a full design doc, with stubs
Start writing up a formal design doc for an MCP SDK based on what we've
learned from the prototype. Include discussion of package layout,
jsonrpc2, and transport. Lay out the rest of the design sections,
leaving stub comments describing what they should cover.

Change-Id: Id0e5b408eac8c0acb5ef90a32d0d69473d8e83f0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/670536
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
2025-05-07 13:50:30 -07:00