oauthex: new package for oauth extensions (#429)

This package will hold externally visible parts of internal/oauthex.

For now, just add an alias to the ProtectedResourceMetadata struct. This
lets one write MCP-compliant servers.
This commit is contained in:
Jonathan Amsterdam 2025-09-18 08:25:24 -04:00 • committed by GitHub
commit 208bfe25fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 2 deletions

View file

@ -21,7 +21,7 @@ software development kit (SDK) for the Model Context Protocol (MCP).
## Package documentation ## Package documentation
The SDK consists of three importable packages: The SDK consists of several importable packages:
- The - The
[`github.com/modelcontextprotocol/go-sdk/mcp`](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/mcp) [`github.com/modelcontextprotocol/go-sdk/mcp`](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/mcp)
@ -34,6 +34,10 @@ The SDK consists of three importable packages:
[`github.com/modelcontextprotocol/go-sdk/auth`](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/auth) [`github.com/modelcontextprotocol/go-sdk/auth`](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/auth)
package provides some primitives for supporting oauth. package provides some primitives for supporting oauth.
- The
[`github.com/modelcontextprotocol/go-sdk/oauthex`](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/oauthex)
package provides extensions to the OAuth protocol, such as ProtectedResourceMetadata.
## Getting started ## Getting started
To get started creating an MCP server, create an `mcp.Server` instance, add To get started creating an MCP server, create an `mcp.Server` instance, add

View file

@ -20,7 +20,7 @@ software development kit (SDK) for the Model Context Protocol (MCP).
## Package documentation ## Package documentation
The SDK consists of three importable packages: The SDK consists of several importable packages:
- The - The
[`github.com/modelcontextprotocol/go-sdk/mcp`](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/mcp) [`github.com/modelcontextprotocol/go-sdk/mcp`](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/mcp)
@ -33,6 +33,10 @@ The SDK consists of three importable packages:
[`github.com/modelcontextprotocol/go-sdk/auth`](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/auth) [`github.com/modelcontextprotocol/go-sdk/auth`](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/auth)
package provides some primitives for supporting oauth. package provides some primitives for supporting oauth.
- The
[`github.com/modelcontextprotocol/go-sdk/oauthex`](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/oauthex)
package provides extensions to the OAuth protocol, such as ProtectedResourceMetadata.
## Getting started ## Getting started
To get started creating an MCP server, create an `mcp.Server` instance, add To get started creating an MCP server, create an `mcp.Server` instance, add

10
oauthex/oauthex.go Normal file
View file

@ -0,0 +1,10 @@
// Copyright 2025 The Go MCP SDK Authors. All rights reserved.
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
// Package oauthex implements extensions to OAuth2.
package oauthex
import "github.com/modelcontextprotocol/go-sdk/internal/oauthex"
type ProtectedResourceMetadata = oauthex.ProtectedResourceMetadata