Skip to content

Commit d80fa76

Browse files
jonathanhefnerbhosmer-ant
authored andcommitted
Remove hardcoded section numbers
This removes hardcoded section numbers from the Authorization guide and the Security Best Practices guide, and updates links to reflect the new URLs. In some cases, prose has been modified to remove references to specific section numbers.
1 parent 009478f commit d80fa76

File tree

4 files changed

+80
-75
lines changed

4 files changed

+80
-75
lines changed

docs/specification/2025-03-26/basic/authorization.mdx

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22
title: Authorization
33
---
44

5+
<div id="enable-section-numbers" />
6+
57
<Info>**Protocol Revision**: 2025-03-26</Info>
68

7-
## 1. Introduction
9+
## Introduction
810

9-
### 1.1 Purpose and Scope
11+
### Purpose and Scope
1012

1113
The Model Context Protocol provides authorization capabilities at the transport level,
1214
enabling MCP clients to make requests to restricted MCP servers on behalf of resource
1315
owners. This specification defines the authorization flow for HTTP-based transports.
1416

15-
### 1.2 Protocol Requirements
17+
### Protocol Requirements
1618

1719
Authorization is **OPTIONAL** for MCP implementations. When supported:
1820

@@ -22,7 +24,7 @@ Authorization is **OPTIONAL** for MCP implementations. When supported:
2224
- Implementations using alternative transports **MUST** follow established security best
2325
practices for their protocol.
2426

25-
### 1.3 Standards Compliance
27+
### Standards Compliance
2628

2729
This authorization mechanism is based on established specifications listed below, but
2830
implements a selected subset of their features to ensure security and interoperability
@@ -34,9 +36,9 @@ while maintaining simplicity:
3436
- OAuth 2.0 Dynamic Client Registration Protocol
3537
([RFC7591](https://datatracker.ietf.org/doc/html/rfc7591))
3638

37-
## 2. Authorization Flow
39+
## Authorization Flow
3840

39-
### 2.1 Overview
41+
### Overview
4042

4143
1. MCP auth implementations **MUST** implement OAuth 2.1 with appropriate security
4244
measures for both confidential and public clients.
@@ -49,7 +51,7 @@ while maintaining simplicity:
4951
that do not support Authorization Server Metadata **MUST** follow the default URI
5052
schema.
5153

52-
### 2.1.1 OAuth Grant Types
54+
### OAuth Grant Types
5355

5456
OAuth specifies different flows or grant types, which are different ways of obtaining an
5557
access token. Each of these targets different use cases and scenarios.
@@ -63,7 +65,7 @@ audience. For instance:
6365
- For instance, an agent calls a secure MCP tool to check inventory at a specific
6466
store. No need to impersonate the end user.
6567

66-
### 2.2 Example: authorization code grant
68+
### Example: authorization code grant
6769

6870
This demonstrates the OAuth 2.1 flow for the authorization code grant type, used for user
6971
auth.
@@ -104,7 +106,7 @@ sequenceDiagram
104106
Note over C,M: Begin standard MCP message exchange
105107
```
106108

107-
### 2.3 Server Metadata Discovery
109+
### Server Metadata Discovery
108110

109111
For server capability discovery:
110112

@@ -132,15 +134,15 @@ sequenceDiagram
132134
Note over C: Continue with authorization flow
133135
```
134136

135-
#### 2.3.1 Server Metadata Discovery Headers
137+
#### Server Metadata Discovery Headers
136138

137139
MCP clients _SHOULD_ include the header `MCP-Protocol-Version: <protocol-version>` during
138140
Server Metadata Discovery to allow the MCP server to respond based on the MCP protocol
139141
version.
140142

141143
For example: `MCP-Protocol-Version: 2024-11-05`
142144

143-
#### 2.3.2 Authorization Base URL
145+
#### Authorization Base URL
144146

145147
The authorization base URL **MUST** be determined from the MCP server URL by discarding
146148
any existing `path` component. For example:
@@ -154,11 +156,11 @@ If the MCP server URL is `https://api.example.com/v1/mcp`, then:
154156
This ensures authorization endpoints are consistently located at the root level of the
155157
domain hosting the MCP server, regardless of any path components in the MCP server URL.
156158

157-
#### 2.3.3 Fallbacks for Servers without Metadata Discovery
159+
#### Fallbacks for Servers without Metadata Discovery
158160

159161
For servers that do not implement OAuth 2.0 Authorization Server Metadata, clients
160-
**MUST** use the following default endpoint paths relative to the authorization base URL
161-
(as defined in [Section 2.3.2](#2-3-2-authorization-base-url)):
162+
**MUST** use the following default endpoint paths relative to the [authorization base
163+
URL](#authorization-base-url):
162164

163165
| Endpoint | Default Path | Description |
164166
| ---------------------- | ------------ | ------------------------------------ |
@@ -177,7 +179,7 @@ Clients **MUST** first attempt to discover endpoints via the metadata document b
177179
falling back to default paths. When using default paths, all other protocol requirements
178180
remain unchanged.
179181

180-
### 2.4 Dynamic Client Registration
182+
### Dynamic Client Registration
181183

182184
MCP clients and servers **SHOULD** support the
183185
[OAuth 2.0 Dynamic Client Registration Protocol](https://datatracker.ietf.org/doc/html/rfc7591)
@@ -200,7 +202,7 @@ these servers, MCP clients will have to either:
200202
OAuth client themselves (e.g., through a configuration interface hosted by the
201203
server).
202204

203-
### 2.5 Authorization Flow Steps
205+
### Authorization Flow Steps
204206

205207
The complete Authorization flow proceeds as follows:
206208

@@ -233,7 +235,7 @@ sequenceDiagram
233235
C->>M: API Requests with Access Token
234236
```
235237

236-
#### 2.5.1 Decision Flow Overview
238+
#### Decision Flow Overview
237239

238240
```mermaid
239241
flowchart TD
@@ -257,9 +259,9 @@ flowchart TD
257259
N --> O[Use Access Token]
258260
```
259261

260-
### 2.6 Access Token Usage
262+
### Access Token Usage
261263

262-
#### 2.6.1 Token Requirements
264+
#### Token Requirements
263265

264266
Access token handling **MUST** conform to
265267
[OAuth 2.1 Section 5](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-12#section-5)
@@ -285,7 +287,7 @@ Host: mcp.example.com
285287
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
286288
```
287289

288-
#### 2.6.2 Token Handling
290+
#### Token Handling
289291

290292
Resource servers **MUST** validate access tokens as described in
291293
[Section 5.2](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-12#section-5.2).
@@ -294,7 +296,7 @@ If validation fails, servers **MUST** respond according to
294296
error handling requirements. Invalid or expired tokens **MUST** receive a HTTP 401
295297
response.
296298

297-
### 2.7 Security Considerations
299+
### Security Considerations
298300

299301
The following security requirements **MUST** be implemented:
300302

@@ -304,7 +306,7 @@ The following security requirements **MUST** be implemented:
304306
4. Servers **MUST** validate redirect URIs to prevent open redirect vulnerabilities
305307
5. Redirect URIs **MUST** be either localhost URLs or HTTPS URLs
306308

307-
### 2.8 Error Handling
309+
### Error Handling
308310

309311
Servers **MUST** return appropriate HTTP status codes for authorization errors:
310312

@@ -314,22 +316,22 @@ Servers **MUST** return appropriate HTTP status codes for authorization errors:
314316
| 403 | Forbidden | Invalid scopes or insufficient permissions |
315317
| 400 | Bad Request | Malformed authorization request |
316318

317-
### 2.9 Implementation Requirements
319+
### Implementation Requirements
318320

319321
1. Implementations **MUST** follow OAuth 2.1 security best practices
320322
2. PKCE is **REQUIRED** for all clients
321323
3. Token rotation **SHOULD** be implemented for enhanced security
322324
4. Token lifetimes **SHOULD** be limited based on security requirements
323325

324-
### 2.10 Third-Party Authorization Flow
326+
### Third-Party Authorization Flow
325327

326-
#### 2.10.1 Overview
328+
#### Overview
327329

328330
MCP servers **MAY** support delegated authorization through third-party authorization
329331
servers. In this flow, the MCP server acts as both an OAuth client (to the third-party
330332
auth server) and an OAuth authorization server (to the MCP client).
331333

332-
#### 2.10.2 Flow Description
334+
#### Flow Description
333335

334336
The third-party authorization flow comprises these steps:
335337

@@ -363,7 +365,7 @@ sequenceDiagram
363365
M->>C: MCP access token
364366
```
365367

366-
#### 2.10.3 Session Binding Requirements
368+
#### Session Binding Requirements
367369

368370
MCP servers implementing third-party authorization **MUST**:
369371

@@ -372,7 +374,7 @@ MCP servers implementing third-party authorization **MUST**:
372374
3. Implement appropriate token lifecycle management
373375
4. Handle third-party token expiration and renewal
374376

375-
#### 2.10.4 Security Considerations
377+
#### Security Considerations
376378

377379
When implementing third-party authorization, servers **MUST**:
378380

@@ -382,9 +384,9 @@ When implementing third-party authorization, servers **MUST**:
382384
4. Consider security implications of token chaining
383385
5. Implement proper error handling for third-party auth failures
384386

385-
## 3. Best Practices
387+
## Best Practices
386388

387-
#### 3.1 Local clients as Public OAuth 2.1 Clients
389+
#### Local clients as Public OAuth 2.1 Clients
388390

389391
We strongly recommend that local clients implement OAuth 2.1 as a public client:
390392

@@ -394,13 +396,13 @@ We strongly recommend that local clients implement OAuth 2.1 as a public client:
394396
3. Following token refresh best practices to maintain sessions
395397
4. Properly handling token expiration and renewal
396398

397-
#### 3.2 Authorization Metadata Discovery
399+
#### Authorization Metadata Discovery
398400

399401
We strongly recommend that all clients implement metadata discovery. This reduces the
400402
need for users to provide endpoints manually or clients to fallback to the defined
401403
defaults.
402404

403-
#### 3.3 Dynamic Client Registration
405+
#### Dynamic Client Registration
404406

405407
Since clients do not know the set of MCP servers in advance, we strongly recommend the
406408
implementation of dynamic client registration. This allows applications to automatically

0 commit comments

Comments
 (0)