Skip to content

Commit 803c3ce

Browse files
feedback
1 parent 1624f0d commit 803c3ce

File tree

1 file changed

+9
-32
lines changed

1 file changed

+9
-32
lines changed

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

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,18 @@ while maintaining simplicity:
5454
OAuth specifies different flows or grant types, which in essence, are different ways of obtaining an access token.
5555
Each of these targets different use cases and scenarios.
5656

57-
This specification focuses on two authorization scenarios:
57+
MCP servers **SHOULD** support the OAuth grant types that better align with the intended audience. For instance:
5858

59-
1. User to system: The client is operated by the end user (a human), allowing the client to operate on the user's behalf.
60-
* For instance, an agent calls an MCP tool to get the weather forecast at a particular location. This tool is backed by a secure weather service with usage quotas. The user will first authenticate with the weather service, allowing the agent to query it on the user's behalf.
59+
1. Authorization Code: Useful when the client is acting on behalf of a (human) end user.
60+
* For instance, an agent calls an MCP tool implemented by a SaaS system.
6161
2. System to system: The client is another application (not a human)
62-
* For instance, an agent calls a secure MCP tool to check inventory at a specific store.
62+
* For instance, an agent calls a secure MCP tool to check inventory at a specific store. No need to impersonate the end user.
6363

64-
**NOTE**: For simplicity’s sake, the following examples will assume the MCP server to also function as the authorization server. However,
65-
in a real implementation the authorization server may be deployed as its own distinct service.
6664

67-
### 2.2 OAuth 2.1 User to System through the Authorization Code Grant Type
65+
### 2.2 Example: OAuth 2.1 flow for the Authorization Code Grant Type (User to system)
66+
67+
**NOTE**: For simplicity’s sake, the following examples will assume the MCP server to also function as the authorization server. However,
68+
in real implementations the authorization server may be deployed as its own distinct service.
6869

6970
A human user completes the OAuth flow through a web browser, obtaining an access token that identifies them personally and allows the
7071
client to act on their behalf.
@@ -97,32 +98,8 @@ sequenceDiagram
9798
C->>M: MCP Request with Access Token
9899
Note over C,M: Begin standard MCP message exchange
99100
```
100-
### 2.3 OAuth 2.1 System to System through the Client Credentials Grant Type
101-
102-
In this case, the client acts not in behalf of a human user but a system. Therefore, the access token is obtained by only sharing the client
103-
credentials and doesn't require browser interaction.
104-
105-
When authorization is required and not yet proven by the client, servers **MUST** respond
106-
with _HTTP 401 Unauthorized_.
107-
108-
Clients initiate the
109-
[OAuth 2.1 IETF DRAFT](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-12#name-client-credentials-grant)
110-
Client Credentials flow after receiving the _HTTP 401 Unauthorized_.
111-
112-
```mermaid
113-
sequenceDiagram
114-
participant C as Client
115-
participant M as MCP Server
116-
117-
C->>M: MCP Request
118-
M->>C: HTTP 401 Unauthorized
119-
C->>M: Token Request with client_id + client_secret
120-
M->>C: Access Token (+ Refresh Token)
121-
C->>M: MCP Request with Access Token
122-
Note over C,M: Begin standard MCP message exchange
123-
```
124101

125-
### 2.4 Server Metadata Discovery
102+
### 2.2 Server Metadata Discovery
126103

127104
For server capability discovery:
128105

0 commit comments

Comments
 (0)