Skip to content

Commit 5f05f8a

Browse files
authored
many: minor cosmetic changes (#529)
1 parent b9c1419 commit 5f05f8a

File tree

14 files changed

+21
-21
lines changed

14 files changed

+21
-21
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The SDK consists of several importable packages:
3333
their own transports.
3434
- The
3535
[`github.com/modelcontextprotocol/go-sdk/auth`](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/auth)
36-
package provides some primitives for supporting oauth.
36+
package provides some primitives for supporting OAuth.
3737
- The
3838
[`github.com/modelcontextprotocol/go-sdk/oauthex`](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/oauthex)
3939
package provides extensions to the OAuth protocol, such as ProtectedResourceMetadata.
@@ -78,7 +78,7 @@ func main() {
7878
// Create a server with a single tool.
7979
server := mcp.NewServer(&mcp.Implementation{Name: "greeter", Version: "v1.0.0"}, nil)
8080
mcp.AddTool(server, &mcp.Tool{Name: "greet", Description: "say hi"}, SayHi)
81-
// Run the server over stdin/stdout, until the client disconnects
81+
// Run the server over stdin/stdout, until the client disconnects.
8282
if err := server.Run(context.Background(), &mcp.StdioTransport{}); err != nil {
8383
log.Fatal(err)
8484
}
@@ -106,7 +106,7 @@ func main() {
106106
// Create a new client, with no features.
107107
client := mcp.NewClient(&mcp.Implementation{Name: "mcp-client", Version: "v1.0.0"}, nil)
108108

109-
// Connect to a server over stdin/stdout
109+
// Connect to a server over stdin/stdout.
110110
transport := &mcp.CommandTransport{Command: exec.Command("myserver")}
111111
session, err := client.Connect(ctx, transport, nil)
112112
if err != nil {

auth/auth.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ func TokenInfoFromContext(ctx context.Context) *TokenInfo {
5656
// If verification succeeds, the [TokenInfo] is added to the request's context and the request proceeds.
5757
// If verification fails, the request fails with a 401 Unauthenticated, and the WWW-Authenticate header
5858
// is populated to enable [protected resource metadata].
59-
//
60-
6159
//
6260
// [protected resource metadata]: https://datatracker.ietf.org/doc/rfc9728
6361
func RequireBearerToken(verifier TokenVerifier, opts *RequireBearerTokenOptions) func(http.Handler) http.Handler {

internal/jsonrpc2/messages.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ type ID struct {
1616
value any
1717
}
1818

19-
// MakeID coerces the given Go value to an ID. The value is assumed to be the
20-
// default JSON marshaling of a Request identifier -- nil, float64, or string.
19+
// MakeID coerces the given Go value to an ID. The value should be the
20+
// default JSON marshaling of a Request identifier: nil, float64, or string.
2121
//
2222
// Returns an error if the value type was not a valid Request ID type.
2323
//

internal/readme/README.src.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The SDK consists of several importable packages:
3232
their own transports.
3333
- The
3434
[`github.com/modelcontextprotocol/go-sdk/auth`](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/auth)
35-
package provides some primitives for supporting oauth.
35+
package provides some primitives for supporting OAuth.
3636
- The
3737
[`github.com/modelcontextprotocol/go-sdk/oauthex`](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/oauthex)
3838
package provides extensions to the OAuth protocol, such as ProtectedResourceMetadata.

internal/readme/client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func main() {
1919
// Create a new client, with no features.
2020
client := mcp.NewClient(&mcp.Implementation{Name: "mcp-client", Version: "v1.0.0"}, nil)
2121

22-
// Connect to a server over stdin/stdout
22+
// Connect to a server over stdin/stdout.
2323
transport := &mcp.CommandTransport{Command: exec.Command("myserver")}
2424
session, err := client.Connect(ctx, transport, nil)
2525
if err != nil {

internal/readme/server/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func main() {
3232
// Create a server with a single tool.
3333
server := mcp.NewServer(&mcp.Implementation{Name: "greeter", Version: "v1.0.0"}, nil)
3434
mcp.AddTool(server, &mcp.Tool{Name: "greet", Description: "say hi"}, SayHi)
35-
// Run the server over stdin/stdout, until the client disconnects
35+
// Run the server over stdin/stdout, until the client disconnects.
3636
if err := server.Run(context.Background(), &mcp.StdioTransport{}); err != nil {
3737
log.Fatal(err)
3838
}

jsonrpc/jsonrpc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ type (
1919
Response = jsonrpc2.Response
2020
)
2121

22-
// MakeID coerces the given Go value to an ID. The value is assumed to be the
23-
// default JSON marshaling of a Request identifier -- nil, float64, or string.
22+
// MakeID coerces the given Go value to an ID. The value should be the
23+
// default JSON marshaling of a Request identifier: nil, float64, or string.
2424
//
2525
// Returns an error if the value type was not a valid Request ID type.
2626
func MakeID(v any) (ID, error) {

mcp/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ func (cs *ClientSession) callProgressNotificationHandler(ctx context.Context, pa
668668
// NotifyProgress sends a progress notification from the client to the server
669669
// associated with this session.
670670
// This can be used if the client is performing a long-running task that was
671-
// initiated by the server
671+
// initiated by the server.
672672
func (cs *ClientSession) NotifyProgress(ctx context.Context, params *ProgressNotificationParams) error {
673673
return handleNotify(ctx, notificationProgress, newClientRequest(cs, orZero[Params](params)))
674674
}
@@ -701,7 +701,7 @@ func (cs *ClientSession) Resources(ctx context.Context, params *ListResourcesPar
701701

702702
// ResourceTemplates provides an iterator for all resource templates available on the server,
703703
// automatically fetching pages and managing cursors.
704-
// The `params` argument can set the initial cursor.
704+
// The params argument can set the initial cursor.
705705
// Iteration stops at the first encountered error, which will be yielded.
706706
func (cs *ClientSession) ResourceTemplates(ctx context.Context, params *ListResourceTemplatesParams) iter.Seq2[*ResourceTemplate, error] {
707707
if params == nil {

mcp/content.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,15 @@ type ResourceContents struct {
189189
Meta Meta `json:"_meta,omitempty"`
190190
}
191191

192-
func (r ResourceContents) MarshalJSON() ([]byte, error) {
192+
func (r *ResourceContents) MarshalJSON() ([]byte, error) {
193193
// If we could assume Go 1.24, we could use omitzero for Blob and avoid this method.
194194
if r.URI == "" {
195195
return nil, errors.New("ResourceContents missing URI")
196196
}
197197
if r.Blob == nil {
198198
// Text. Marshal normally.
199199
type wireResourceContents ResourceContents // (lacks MarshalJSON method)
200-
return json.Marshal((wireResourceContents)(r))
200+
return json.Marshal((wireResourceContents)(*r))
201201
}
202202
// Blob.
203203
if r.Text != "" {

mcp/event.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ type EventStore interface {
176176
// with all of its streams.
177177
// A store cannot rely on this method being called for cleanup. It should institute
178178
// additional mechanisms, such as timeouts, to reclaim storage.
179-
//
180179
SessionClosed(_ context.Context, sessionID string) error
181180

182181
// There is no StreamClosed method. A server doesn't know when a stream is finished, because

0 commit comments

Comments
 (0)