diff --git a/README.md b/README.md index f545645..9338072 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ func main() { // Create a server with a single tool. server := mcp.NewServer("greeter", "v1.0.0", nil) server.AddTools(mcp.NewTool("greet", "say hi", SayHi)) - // Run the server over stdin/stdout, until the client diconnects + // Run the server over stdin/stdout, until the client disconnects _ = server.Run(context.Background(), mcp.NewStdIOTransport()) } ``` diff --git a/internal/readme/server/server.go b/internal/readme/server/server.go index d63da8d..9644828 100644 --- a/internal/readme/server/server.go +++ b/internal/readme/server/server.go @@ -25,7 +25,7 @@ func main() { // Create a server with a single tool. server := mcp.NewServer("greeter", "v1.0.0", nil) server.AddTools(mcp.NewTool("greet", "say hi", SayHi)) - // Run the server over stdin/stdout, until the client diconnects + // Run the server over stdin/stdout, until the client disconnects _ = server.Run(context.Background(), mcp.NewStdIOTransport()) } diff --git a/internal/util/util.go b/internal/util/util.go index 03a5dbb..87daa2b 100644 --- a/internal/util/util.go +++ b/internal/util/util.go @@ -12,7 +12,7 @@ import ( // Helpers below are copied from gopls' moremaps package. -// sorted returns an iterator over the entries of m in key order. +// Sorted returns an iterator over the entries of m in key order. func Sorted[M ~map[K]V, K cmp.Ordered, V any](m M) iter.Seq2[K, V] { // TODO(adonovan): use maps.Sorted if proposal #68598 is accepted. return func(yield func(K, V) bool) { @@ -26,7 +26,7 @@ func Sorted[M ~map[K]V, K cmp.Ordered, V any](m M) iter.Seq2[K, V] { } } -// keySlice returns the keys of the map M, like slices.Collect(maps.Keys(m)). +// KeySlice returns the keys of the map M, like slices.Collect(maps.Keys(m)). func KeySlice[M ~map[K]V, K comparable, V any](m M) []K { r := make([]K, 0, len(m)) for k := range m { diff --git a/jsonschema/resolve_test.go b/jsonschema/resolve_test.go index 3b15094..9f03b62 100644 --- a/jsonschema/resolve_test.go +++ b/jsonschema/resolve_test.go @@ -132,7 +132,7 @@ func TestResolveURIs(t *testing.T) { func TestRefCycle(t *testing.T) { // Verify that cycles of refs are OK. - // The test suite doesn't check this, suprisingly. + // The test suite doesn't check this, surprisingly. schemas := map[string]*Schema{ "root": {Ref: "a"}, "a": {Ref: "b"}, diff --git a/mcp/content.go b/mcp/content.go index fcc0055..d8eb87d 100644 --- a/mcp/content.go +++ b/mcp/content.go @@ -114,7 +114,7 @@ func NewTextResourceContents(uri, mimeType, text string) *ResourceContents { } } -// NewTextResourceContents returns a [ResourceContents] containing a byte slice. +// NewBlobResourceContents returns a [ResourceContents] containing a byte slice. func NewBlobResourceContents(uri, mimeType string, blob []byte) *ResourceContents { // The only way to distinguish text from blob is a non-nil Blob field. if blob == nil { diff --git a/mcp/server.go b/mcp/server.go index a8543cd..297f82e 100644 --- a/mcp/server.go +++ b/mcp/server.go @@ -43,7 +43,7 @@ type Server struct { type ServerOptions struct { // Optional instructions for connected clients. Instructions string - // If non-nil, called when "notifications/intialized" is received. + // If non-nil, called when "notifications/initialized" is received. InitializedHandler func(context.Context, *ServerSession, *InitializedParams) // PageSize is the maximum number of items to return in a single page for // list methods (e.g. ListTools). @@ -122,7 +122,7 @@ func (s *Server) RemoveTools(names ...string) { func() bool { return s.tools.remove(names...) }) } -// AddResource adds the given resource to the server and associates it with +// AddResources adds the given resource to the server and associates it with // a [ResourceHandler], which will be called when the client calls [ClientSession.ReadResource]. // If a resource with the same URI already exists, this one replaces it. // AddResource panics if a resource URI is invalid or not absolute (has an empty scheme). diff --git a/mcp/shared.go b/mcp/shared.go index c88f132..4262620 100644 --- a/mcp/shared.go +++ b/mcp/shared.go @@ -144,7 +144,7 @@ const ( // See https://modelcontextprotocol.io/specification/2025-03-26/server/resources#error-handling // However, the code they chose is in the wrong space // (see https://github.com/modelcontextprotocol/modelcontextprotocol/issues/509). - // so we pick a different one, arbirarily for now (until they fix it). + // so we pick a different one, arbitrarily for now (until they fix it). // The immediate problem is that jsonprc2 defines -32002 as "server closing". CodeResourceNotFound = -31002 // The error code if the method exists and was called properly, but the peer does not support it. diff --git a/mcp/sse.go b/mcp/sse.go index 81a5130..1c72e71 100644 --- a/mcp/sse.go +++ b/mcp/sse.go @@ -102,7 +102,7 @@ type SSEServerTransport struct { incoming chan jsonrpc2.Message // queue of incoming messages; never closed // We must guard both pushes to the incoming queue and writes to the response - // writer, because incoming POST requests are abitrarily concurrent and we + // writer, because incoming POST requests are arbitrarily concurrent and we // need to ensure we don't write push to the queue, or write to the // ResponseWriter, after the session GET request exits. mu sync.Mutex @@ -431,7 +431,7 @@ func (c *SSEClientTransport) Connect(ctx context.Context) (Stream, error) { // An sseClientStream is a logical jsonrpc2 stream that implements the client // half of the SSE protocol: -// - Writes are POSTS to the sesion endpoint. +// - Writes are POSTS to the session endpoint. // - Reads are SSE 'message' events, and pushes them onto a buffered channel. // - Close terminates the GET request. type sseClientStream struct {