Skip to content

Commit fccadd6

Browse files
committed
updates
1 parent 2c21a45 commit fccadd6

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

src/content/docs/agents/model-context-protocol/authorization.mdx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ The following sections describe each of these options and link to runnable code
2828

2929
## Authorization options
3030

31-
### (1) Your MCP Server handles authorization itself
31+
### (1) Your MCP Server handles authorization and authentication itself
3232

33-
Your MCP Server, using [`workers-mcp`](/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.
33+
Your MCP Server, using the [OAuth Provider Library](https://github.com/cloudflare/ai/demos/remote-mcp-server/lib/workers-oauth-provider), can handle the complete OAuth authorization flow, without any third-party involvement.
3434

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.
35+
The [Workers OAuth Provider Library](https://github.com/cloudflare/ai/demos/remote-mcp-server/lib/workers-oauth-provider) is a Cloudflare Worker that implements a [`fetch()` handler](/workers/runtime-apis/handlers/fetch/), and handles incoming requests to your MCP server.
3636

3737
You provide your own handlers for your MCP Server's API, and autentication and authorization logic, and URI paths for the OAuth endpoints, as shown below:
3838

@@ -42,13 +42,17 @@ export default new OAuthProvider({
4242
// Your MCP server:
4343
apiHandler: MyMCPServer.Router,
4444
// Your handler for authentication and authorization:
45-
defaultHandler: OAuthProvider.defaultHandler,
45+
defaultHandler: MyAuthHandler,
4646
authorizeEndpoint: "/authorize",
4747
tokenEndpoint: "/token",
4848
clientRegistrationEndpoint: "/register",
4949
});
5050
```
5151

52+
Refer to the [getting started example](/agents/model-context-protocol/mcp-server/getting-started/) for a complete example of the `OAuthProvider` in use, with a mock authentication flow.
53+
54+
The authorization flow in this case works like this:
55+
5256
```mermaid
5357
sequenceDiagram
5458
participant B as User-Agent (Browser)
@@ -73,11 +77,11 @@ Remember — [authentication is different from authorization](https://www.cloud
7377

7478
### (2) Third-party OAuth Provider
7579

76-
The OAuth Provider Library can be configured to use a third-party OAuth provider, such as GitHub or Google. You can see a complete example of this in the [GitHub example](/agents/model-context-protocol/mcp-server/examples/github/).
80+
The [OAuth Provider Library](https://github.com/cloudflare/ai/demos/remote-mcp-server/lib/workers-oauth-provider) can be configured to use a third-party OAuth provider, such as GitHub or Google. You can see a complete example of this in the [GitHub example](/agents/guides/remote-mcp-server-github).
7781

7882
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.
7983

80-
```ts ins="MyAuthHandler"
84+
```ts ins="defaultHandler: MyAuthHandler,"
8185
import MyAuthHandler from "./auth-handler";
8286

8387
export default new OAuthProvider({
@@ -116,7 +120,7 @@ sequenceDiagram
116120
M->>C: MCP access token
117121
```
118122

119-
Read the docs for the [Workers oAuth Provider Library](/agents/model-context-protocol/mcp-server/authorization/oauth-provider-api-reference/) for more details.
123+
Read the docs for the [Workers oAuth Provider Library](https://github.com/cloudflare/ai/demos/remote-mcp-server/lib/workers-oauth-provider) for more details.
120124

121125
### (3) Bring your own OAuth Provider
122126

src/content/docs/agents/model-context-protocol/transport.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ The Model Context Protocol (MCP) specification defines [two standard transport m
1212
1. **stdio, communication over standard in and standard out** — designed for local MCP connections
1313
2. **HTTP with Server-Sent Events (SSE)** — designed for remote MCP connections
1414

15-
`workers-mcp` supports remote MCP connections, using HTTP with Server-Sent Events (SSE) as transport. SSE requires a persistent HTTP connection, which is supported by Cloudflare [Durable Objects](/durable-objects/).
15+
The [remote MCP examples](/agents/model-context-protocol/mcp-server/getting-started/) support remote MCP connections, using HTTP with Server-Sent Events (SSE) as transport. SSE requires a persistent HTTP connection, which is supported by Cloudflare [Durable Objects](/durable-objects/). Transport is configured and handled automatically. You don't need to configure anything — it just works.
1616

17-
Transport is configured and handled automatically by `workers-mcp`. You don't need to configure anything — it just works.
17+
:::note
18+
If you are looking to deploy a MCP server that supports _local_ MCP connections, you should follow the [guide](/agents/guides/build-mcp-server/) for building local MCP servers using Cloudflare Workers.
19+
:::

0 commit comments

Comments
 (0)