Skip to content

Releases: modelcontextprotocol/go-sdk

v0.2.0

11 Jul 13:17
@jba jba
78a66a4
Compare
Choose a tag to compare

Breaking Changes

  • The plural Server.AddXXX methods have been removed, along with the ServerXXX types and the NewServerTool function.
    Instead use the singular Server methods AddTool, AddPrompt, AddResource and AddResourceTemplate.
    The AddTool function partially replaces NewServerTool.

  • All ToolOptions have been removed. Instead, construct a jsonschema.Schema directly, using a struct literal for example, or infer a schema from a struct with jsonschema.For[T]. Struct inference now supports property descriptions by means of the jsonschema struct tag.

  • The NewClient and NewServer functions take an Implementation 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 the Implementation type.

  • The four symbols beginning JSONPRC have been moved into a separate jsonrpc 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

Previous Contributors

Full Changelog: v0.1.0...v0.2.0