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: src/content/docs/agents/model-context-protocol/mcp-server/authorization/index.mdx
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,9 @@ When building a [Model Context Protocol (MCP)](https://modelcontextprotocol.io)
16
16
17
17
The Model Context Protocol uses [a subset of OAuth 2.1 for authorization](https://spec.modelcontextprotocol.io/specification/draft/basic/authorization/). OAuth allows your users to grant limited access to resources, without them having to share API keys or other credentials.
18
18
19
-
Cloudflare provides an OAuth SDK that implements the provider side of the OAuth 2.1 protocol, allowing you to easily add authorization to your MCP server.
19
+
Cloudflare provides an [OAuth Provider Library](https://github.com/geelen/mcp-remote-examples/tree/main/.vendor/workers-oauth-provider) that implements the provider side of the OAuth 2.1 protocol, allowing you to easily add authorization to your MCP server.
20
20
21
-
You can use the OAuth SDK in three ways:
21
+
You can use the OAuth Provider Library in three ways:
22
22
23
23
1.**Your Worker handles authorization itself.** Your MCP server, running on Cloudflare, handles the complete OAuth flow. ([Example](/agents/model-context-protocol/mcp-server/getting-started/))
24
24
2.**Integrate with a third-party OAuth provider**, such as GitHub or Google. ([Example](/agents/model-context-protocol/mcp-server/examples/third-party-oauth-provider/))
@@ -30,12 +30,12 @@ The following sections describe each of these options and link to runnable code
30
30
31
31
### (1) Your MCP Server handles authorization itself
32
32
33
-
Your MCP Server, using the Cloudflare MCP Server and OAuth Provider SDKs, can handle the complete OAuth authorization flow, without any third-party involvement.
33
+
Your MCP Server, using the Cloudflare [MCP Server SDK](/agents/model-context-protocol/mcp-server/getting-started/)and [OAuth Provider Library](/agents/model-context-protocol/mcp-server/authorization/oauth-provider-api-reference/), can handle the complete OAuth authorization flow, without any third-party involvement.
34
34
35
-
The [Workers OAuth Provider SDK](/agents/model-context-protocol/mcp-server/authorization/oauth-sdk/) is a Cloudflare Worker that implements a [`fetch()` handler](/workers/runtime-apis/handlers/fetch/), and handles incoming requests to your MCP server. You provide your own handlers for your MCP Server's API, and autentication and authorization logic, and URI paths for the OAuth endpoints, and the SDK handles the rest.
35
+
The [Workers OAuth Provider Library](/agents/model-context-protocol/mcp-server/authorization/oauth-provider-api-reference/) is a Cloudflare Worker that implements a [`fetch()` handler](/workers/runtime-apis/handlers/fetch/), and handles incoming requests to your MCP server. You provide your own handlers for your MCP Server's API, and autentication and authorization logic, and URI paths for the OAuth endpoints, and the SDK handles the rest.
36
36
37
37
{/* TODO: Update link */}
38
-
The OAuth Provider SDK comes with an [example handler implementation](https://github.com/geelen/mcp-remote-examples/tree/main/02-user-password/src/routes) for autentication and authorization, referenced below as `defaultHandler`:
38
+
The OAuth Provider Library comes with an [example handler implementation](https://github.com/geelen/mcp-remote-examples/tree/main/02-user-password/src/routes) for autentication and authorization, referenced below as `defaultHandler`:
39
39
40
40
{/* TODO: GithubCodeComponent */}
41
41
@@ -82,7 +82,7 @@ For a step-by-step example, refer to the [Worker as OAuth Provider](/agents/mode
82
82
83
83
### (2) Third-party OAuth Provider
84
84
85
-
The OAuth Provider SDK can be configured to use a third-party OAuth provider, such as [GitHub](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) or [Google](https://developers.google.com/identity/protocols/oauth2).
85
+
The OAuth Provider Library can be configured to use a third-party OAuth provider, such as [GitHub](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) or [Google](https://developers.google.com/identity/protocols/oauth2).
86
86
87
87
When you use a third-party OAuth provider, you must provide a handler to the `OAuthProvider` that implements the OAuth flow for the third-party provider.
88
88
@@ -128,19 +128,19 @@ sequenceDiagram
128
128
M->>C: MCP access token
129
129
```
130
130
131
-
Read the docs for the [Workers oAuth Provider SDK](/agents/model-context-protocol/mcp-server/authorization/oauth-sdk/) for more details.
131
+
Read the docs for the [Workers oAuth Provider Library](/agents/model-context-protocol/mcp-server/authorization/oauth-provider-api-reference/) for more details.
132
132
133
133
### (3) Bring your own OAuth Provider
134
134
135
-
If your application already implements an Oauth Provider itself, or you use Stytch, Auth0, or authorization-as-a-service provider, you can use this in the same way that you would use a third-party OAuth provider, described above.
135
+
If your application already implements an Oauth Provider itself, or you use Stytch, Auth0, or authorization-as-a-service provider, you can use this in the same way that you would use a third-party OAuth provider, described above in (2).
136
136
137
-
The following examples show how to use the OAuth Provider SDK with an external OAuth provider:
137
+
The following examples show how to use the OAuth Provider Library with an external OAuth provider:
Refer to the [GitHub OAuth Provider example](https://github.com/geelen/mcp-remote-examples/tree/main/04-oauth-pivot) for a complete example of how to use a third-party OAuth provider with the MCP Server SDK.
0 commit comments