Use the existing jsonrpc2 preemption mechanism to implement MCP cancellation. This was mostly straightforward, except where I got confused about ID unmarshaling. Leave a note about using omitempty when it is available. Change-Id: I13e073f08c5d5c2cc78d882da4e6ff47f09fb340 Reviewed-on: https://go-review.googlesource.com/c/tools/+/667578 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
21 lines
950 B
Go
21 lines
950 B
Go
// Copyright 2025 The Go MCP SDK Authors. All rights reserved.
|
|
// Use of this source code is governed by an MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// The mcp package provides an SDK for writing model context protocol clients
|
|
// and servers. It is a work-in-progress. As of writing, it is a prototype to
|
|
// explore the design space of client/server lifecycle and binding.
|
|
//
|
|
// To get started, create an MCP client or server with [NewClient] or
|
|
// [NewServer], then add features to your client or server using Add<feature>
|
|
// methods, then connect to a peer using a [Transport] instance and a call to
|
|
// [Client.Connect] or [Server.Connect].
|
|
//
|
|
// TODO:
|
|
// - Support pagination.
|
|
// - Support all client/server operations.
|
|
// - Support Streamable HTTP transport.
|
|
// - Support multiple versions of the spec.
|
|
// - Implement proper JSON schema support, with both client-side and
|
|
// server-side validation..
|
|
package mcp
|