all: minor cleanup and README improvements (#30)

Clean up some inaccurate comments, and update the README to strengthen
warnings about the current status.
This commit is contained in:
Robert Findley 2025-06-25 13:12:39 -04:00 • committed by GitHub
commit 5aabc33c9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 18 additions and 42 deletions

View file

@ -6,13 +6,14 @@ module, once it exists. -->
[![PkgGoDev](https://pkg.go.dev/badge/golang.org/x/tools)](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) [![PkgGoDev](https://pkg.go.dev/badge/golang.org/x/tools)](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk)
This repository contains an implementation of the official Go software This repository contains an unreleased implementation of the official Go
development kit (SDK) for the Model Context Protocol (MCP). software development kit (SDK) for the Model Context Protocol (MCP).
**WARNING**: The SDK is currently unstable and subject to breaking changes. **WARNING**: The SDK should be considered unreleased, and is currently unstable
Please test it out and file bug reports or API proposals. The [TODO](#todo) and subject to breaking changes. Please test it out and file bug reports or API
section below outlines outstanding release blockers. We aim to release a stable proposals, but don't use it in real projects. See the issue tracker for known
version of the SDK in August, 2025. issues and missing features. We aim to release a stable version of the SDK in
August, 2025.
## Package documentation ## Package documentation
@ -111,18 +112,6 @@ func main() {
The `examples/` directory contains more example clients and servers. The `examples/` directory contains more example clients and servers.
## TODO
The following TODOs block the release of this SDK:
- Better support for resumability in the Streamable HTTP transport: a
server-side event store and client-side retry configuration.
- OAuth support (or examples of implementing OAuth using middleware).
- Support for the changes in the
[2025-06-18](https://modelcontextprotocol.io/specification/2025-06-18/changelog)
version of the MCP spec.
- More examples and documentation.
## Design ## Design
The design doc for this SDK is at [design.md](./design/design.md), which was The design doc for this SDK is at [design.md](./design/design.md), which was

View file

@ -30,8 +30,6 @@ func SayHi(ctx context.Context, ss *mcp.ServerSession, params *mcp.CallToolParam
}, nil }, nil
} }
// TODO(jba): it should be OK for args to be a pointer, but this fails in
// jsonschema. Needs investigation.
func PromptHi(ctx context.Context, ss *mcp.ServerSession, params *mcp.GetPromptParams) (*mcp.GetPromptResult, error) { func PromptHi(ctx context.Context, ss *mcp.ServerSession, params *mcp.GetPromptParams) (*mcp.GetPromptResult, error) {
return &mcp.GetPromptResult{ return &mcp.GetPromptResult{
Description: "Code review prompt", Description: "Code review prompt",

View file

@ -5,13 +5,14 @@ module, once it exists. -->
[![PkgGoDev](https://pkg.go.dev/badge/golang.org/x/tools)](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) [![PkgGoDev](https://pkg.go.dev/badge/golang.org/x/tools)](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk)
This repository contains an implementation of the official Go software This repository contains an unreleased implementation of the official Go
development kit (SDK) for the Model Context Protocol (MCP). software development kit (SDK) for the Model Context Protocol (MCP).
**WARNING**: The SDK is currently unstable and subject to breaking changes. **WARNING**: The SDK should be considered unreleased, and is currently unstable
Please test it out and file bug reports or API proposals. The [TODO](#todo) and subject to breaking changes. Please test it out and file bug reports or API
section below outlines outstanding release blockers. We aim to release a stable proposals, but don't use it in real projects. See the issue tracker for known
version of the SDK in August, 2025. issues and missing features. We aim to release a stable version of the SDK in
August, 2025.
## Package documentation ## Package documentation
@ -40,18 +41,6 @@ with its client over stdin/stdout:
The `examples/` directory contains more example clients and servers. The `examples/` directory contains more example clients and servers.
## TODO
The following TODOs block the release of this SDK:
- Better support for resumability in the Streamable HTTP transport: a
server-side event store and client-side retry configuration.
- OAuth support (or examples of implementing OAuth using middleware).
- Support for the changes in the
[2025-06-18](https://modelcontextprotocol.io/specification/2025-06-18/changelog)
version of the MCP spec.
- More examples and documentation.
## Design ## Design
The design doc for this SDK is at [design.md](./design/design.md), which was The design doc for this SDK is at [design.md](./design/design.md), which was

View file

@ -26,13 +26,13 @@ type ToolHandlerFor[In, Out any] func(context.Context, *ServerSession, *CallTool
// A rawToolHandler is like a ToolHandler, but takes the arguments as as json.RawMessage. // A rawToolHandler is like a ToolHandler, but takes the arguments as as json.RawMessage.
type rawToolHandler = func(context.Context, *ServerSession, *CallToolParamsFor[json.RawMessage]) (*CallToolResult, error) type rawToolHandler = func(context.Context, *ServerSession, *CallToolParamsFor[json.RawMessage]) (*CallToolResult, error)
// A Tool is a tool definition that is bound to a tool handler. // A ServerTool is a tool definition that is bound to a tool handler.
type ServerTool struct { type ServerTool struct {
Tool *Tool Tool *Tool
Handler ToolHandler Handler ToolHandler
// Set in NewServerTool or Server.AddToolsErr. // Set in NewServerTool or Server.addToolsErr.
rawHandler rawToolHandler rawHandler rawToolHandler
// Resolved tool schemas. Set in Server.AddToolsErr. // Resolved tool schemas. Set in Server.addToolsErr.
inputResolved, outputResolved *jsonschema.Resolved inputResolved, outputResolved *jsonschema.Resolved
} }

View file

@ -26,7 +26,7 @@ var ErrConnectionClosed = errors.New("connection closed")
// and server. // and server.
// //
// Transports should be used for at most one call to [Server.Connect] or // Transports should be used for at most one call to [Server.Connect] or
// [Client.Start]. // [Client.Connect].
type Transport interface { type Transport interface {
// Connect returns the logical JSON-RPC connection.. // Connect returns the logical JSON-RPC connection..
// //