Releases: modelcontextprotocol/go-sdk
v0.2.0
Breaking Changes
-
The plural
Server.AddXXX
methods have been removed, along with theServerXXX
types and theNewServerTool
function.
Instead use the singularServer
methodsAddTool
,AddPrompt
,AddResource
andAddResourceTemplate
.
TheAddTool
function partially replacesNewServerTool
. -
All
ToolOption
s have been removed. Instead, construct ajsonschema.Schema
directly, using a struct literal for example, or infer a schema from a struct withjsonschema.For[T]
. Struct inference now supports property descriptions by means of thejsonschema
struct tag. -
The
NewClient
andNewServer
functions take anImplementation
as a first argument instead of a name and version. This allows the implementation title to be provided, and future-proofs against subsequent additions to theImplementation
type. -
The four symbols beginning
JSONPRC
have been moved into a separatejsonrpc
package.
What's Changed
-
Protocol version negotiation now follows the algorithm of the TypeScript SDK.
-
Servers advertise that they have a capability only if the corresponding feature was added. For example, a server will advertise the "prompts" capability only if
AddPrompt
was called before the client and server exchange initialization messages. -
Resource template matching is now done by the full-featured github.com/yosida95/uritemplate/v3 package. By @cryo-zd.
-
The
jsonchema.For[T]
function now detects cycles instead of crashing. By @albertsundjaja. -
Server.Run
now honors context cancellation. By @chriscasola. -
examples/memory
is a knowledge-graph memory server based on the one in the servers repo. By @MegaGrindStone. -
examples/rate-limiting
shows how to perform session-based rate limiting. By @samthanawalla.
New Contributors
- @martinemde made their first contribution in #91
- @crspeller made their first contribution in #105
- @chriscasola made their first contribution in #111
Previous Contributors
Full Changelog: v0.1.0...v0.2.0