Skip to content

Commit 843fb58

Browse files
committed
feat: enhance auth server discovery with OAuth2 and OpenID metadata support
1 parent eba3959 commit 843fb58

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

docs/specification/draft/basic/authorization.mdx

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,12 @@ specifies how an MCP server indicates the location of its corresponding authoriz
6363
1. MCP servers **MUST** implement OAuth 2.0 Protected Resource Metadata ([RFC9728](https://datatracker.ietf.org/doc/html/rfc9728)).
6464
MCP clients **MUST** use OAuth 2.0 Protected Resource Metadata for authorization server discovery.
6565

66-
1. MCP authorization servers **MUST** provide OAuth 2.0 Authorization
67-
Server Metadata ([RFC8414](https://datatracker.ietf.org/doc/html/rfc8414)).
68-
MCP clients **MUST** use the OAuth 2.0 Authorization Server Metadata.
66+
1. MCP authorization servers **MUST** provide at least one of the following discovery mechanisms:
67+
68+
- OAuth 2.0 Authorization Server Metadata ([RFC8414](https://datatracker.ietf.org/doc/html/rfc8414))
69+
- [OpenID Connect Discovery 1.0](https://openid.net/specs/openid-connect-discovery-1_0.html)
70+
71+
MCP clients **MUST** support both discovery mechanisms to obtain the information required to interact with the authorization server.
6972

7073
### Authorization Server Discovery
7174

@@ -91,11 +94,6 @@ as described in [RFC9728 Section 5.1 "WWW-Authenticate Response"](https://datatr
9194

9295
MCP clients **MUST** be able to parse `WWW-Authenticate` headers and respond appropriately to `HTTP 401 Unauthorized` responses from the MCP server.
9396

94-
#### Server Metadata Discovery
95-
96-
MCP clients **MUST** follow the OAuth 2.0 Authorization Server Metadata [RFC8414](https://datatracker.ietf.org/doc/html/rfc8414)
97-
specification to obtain the information required to interact with the authorization server.
98-
9997
#### Sequence Diagram
10098

10199
The following diagram outlines an example flow:
@@ -114,7 +112,11 @@ sequenceDiagram
114112
M-->>C: Resource metadata with authorization server URL
115113
Note over C: Validate RS metadata,<br />build AS metadata URL
116114
117-
C->>A: GET /.well-known/oauth-authorization-server
115+
alt OAuth 2.0 Authorization Server Metadata
116+
C->>A: GET /.well-known/oauth-authorization-server
117+
else OpenID Connect Discovery
118+
C->>A: GET /.well-known/openid-configuration
119+
end
118120
A-->>C: Authorization server metadata
119121
120122
Note over C,A: OAuth 2.1 authorization flow happens here
@@ -170,7 +172,11 @@ sequenceDiagram
170172
171173
Note over C: Parse metadata and extract authorization server(s)<br/>Client determines AS to use
172174
173-
C->>A: GET /.well-known/oauth-authorization-server
175+
alt OAuth 2.0 Authorization Server Metadata
176+
C->>A: GET /.well-known/oauth-authorization-server
177+
else OpenID Connect Discovery
178+
C->>A: GET /.well-known/openid-configuration
179+
end
174180
A->>C: Authorization server metadata response
175181
176182
alt Dynamic client registration

docs/specification/draft/changelog.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ the previous revision, [2025-06-18](/specification/2025-06-18).
99

1010
## Major changes
1111

12+
1. Enhance authorization server discovery with support for [OpenID Connect Discovery 1.0](https://openid.net/specs/openid-connect-discovery-1_0.html). (PR [#797](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/797))
13+
1214
## Other schema changes
1315

1416
## Full changelog

0 commit comments

Comments
 (0)