You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/specification/2025-03-26/basic/authorization.md
+9-32Lines changed: 9 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,17 +54,18 @@ while maintaining simplicity:
54
54
OAuth specifies different flows or grant types, which in essence, are different ways of obtaining an access token.
55
55
Each of these targets different use cases and scenarios.
56
56
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:
58
58
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.
61
61
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.
63
63
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.
66
64
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.
68
69
69
70
A human user completes the OAuth flow through a web browser, obtaining an access token that identifies them personally and allows the
70
71
client to act on their behalf.
@@ -97,32 +98,8 @@ sequenceDiagram
97
98
C->>M: MCP Request with Access Token
98
99
Note over C,M: Begin standard MCP message exchange
99
100
```
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
0 commit comments