This is a preliminary implementation of OAuth 2.1 for the client. When a StreamableClientTransport encounters a 401 Unauthorized response from the server, it initiates the OAuth flow described in thec authorization section of the MCP spec (https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization). On success, the transport obtains an access token which it passes to all subsequent requests. Much remains to be done here: * Resource Indicators, as described in section 2.5.1 of the MCP spec. * All of this is unexported, so it is available only to our own StreamingClientTransport. We should add API so people can use it with their own transports. * And, of course, tests. We should test against fake implementations but also, if we can find any, real reference implementations. For #19 Co-authored-by: Jonathan Amsterdam <jba@google.com> --------- Co-authored-by: Jonathan Amsterdam <jba@google.com>
12 lines
280 B
Modula-2
12 lines
280 B
Modula-2
module github.com/modelcontextprotocol/go-sdk
|
|
|
|
go 1.23.0
|
|
|
|
require (
|
|
github.com/golang-jwt/jwt/v5 v5.2.2
|
|
github.com/google/go-cmp v0.7.0
|
|
github.com/google/jsonschema-go v0.3.0
|
|
github.com/yosida95/uritemplate/v3 v3.0.2
|
|
golang.org/x/oauth2 v0.30.0
|
|
golang.org/x/tools v0.34.0
|
|
)
|