Skip to content

Commit f85b332

Browse files
hyperlint-ai[bot]kodster28
authored andcommitted
Enhance OAuth Provider Documentation and Transport Methods (#22128)
* Hyperlint Automation Fix * Hyperlint Automation Fix * Hyperlint Automation Fix * Hyperlint Automation Fix * Hyperlint Automation Fix * Hyperlint Automation Fix * Hyperlint Automation Fix * Hyperlint Automation Fix * Hyperlint Automation Fix * Hyperlint Automation Fix * Hyperlint Automation Fix * Hyperlint Automation Fix * Hyperlint Automation Fix * Hyperlint Automation Fix * Hyperlint Automation Fix * Hyperlint Automation Fix * Hyperlint Automation Fix * Hyperlint Automation Fix * Hyperlint Automation Fix * Hyperlint Automation Fix * Update src/content/docs/agents/model-context-protocol/authorization.mdx * Update src/content/docs/agents/model-context-protocol/transport.mdx * Update src/content/docs/agents/model-context-protocol/index.mdx --------- Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com> Co-authored-by: Kody Jackson <[email protected]>
1 parent 2ba2772 commit f85b332

File tree

9 files changed

+16
-17
lines changed

9 files changed

+16
-17
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ Read the docs for the [Workers oAuth Provider Library](https://github.com/cloudf
126126

127127
If your application already implements an Oauth Provider itself, or you use [Stytch](https://stytch.com/), [Auth0](https://auth0.com/), [WorkOS](https://workos.com/), 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).
128128

129-
You can use the auth provider to:
129+
You can use the auth provider to:
130130
- Allow users to authenticate to your MCP server through email, social logins, SSO (single sign-on), and MFA (multi-factor authentication).
131131
- Define scopes and permissions that directly map to your MCP tools.
132132
- Present users with a consent page corresponding with the requested permissions.
133-
- Enforce the permissions so that agents can only invoke permitted tools.
133+
- Enforce the permissions so that agents can only invoke permitted tools.
134134

135135
#### Stytch
136-
Get started with a [remote MCP server that uses Stytch](https://stytch.com/docs/guides/connected-apps/mcp-servers) to allow users to sign in with email, Google login or enterprise SSO and authorize their AI agent to view and manage their companys OKRs on their behalf. Stytch will handle restricting the scopes granted to the AI agent based on the users role and permissions within their organization. When authorizing the MCP Client, each user will see a consent page that outlines the permissions that the agent is requesting that they are able to grant based on their role.
136+
Get started with a [remote MCP server that uses Stytch](https://stytch.com/docs/guides/connected-apps/mcp-servers) to allow users to sign in with email, Google login or enterprise SSO and authorize their AI agent to view and manage their company's OKRs on their behalf. Stytch will handle restricting the scopes granted to the AI agent based on the user's role and permissions within their organization. When authorizing the MCP Client, each user will see a consent page that outlines the permissions that the agent is requesting that they are able to grant based on their role.
137137

138138
[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/ai/tree/main/demos/mcp-stytch-b2b-okr-manager)
139139

@@ -144,11 +144,11 @@ For more consumer use cases, deploy a remote MCP server for a To Do app that use
144144
#### Auth0
145145
Get started with a remote MCP server that uses Auth0 to authenticate users through email, social logins, or enterprise SSO to interact with their todos and personal data through AI agents. The MCP server securely connects to API endpoints on behalf of users, showing exactly which resources the agent will be able to access once it gets consent from the user. In this implementation, access tokens are automatically refreshed during long running interactions.
146146

147-
To set it up, first deploy the protected API endpoint:
147+
To set it up, first deploy the protected API endpoint:
148148

149149
[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-auth0/todos-api)
150150

151-
Then, deploy the MCP server that handles authentication through Auth0 and securely connects AI agents to your API endpoint.
151+
Then, deploy the MCP server that handles authentication through Auth0 and securely connects AI agents to your API endpoint.
152152

153153
[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-auth0/mcp-auth0-oidc)
154154

@@ -190,7 +190,6 @@ function requirePermission(permission, handler) {
190190
return async (request, context) => {
191191
// Check if user has the required permission
192192
const userPermissions = context.props.permissions || [];
193-
194193
if (!userPermissions.includes(permission)) {
195194
return {
196195
content: [{ type: "text", text: `Permission denied: requires ${permission}` }],

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ The MCP standard supports two modes of operation:
2727
- **Local MCP connections**: MCP clients connect to MCP servers on the same machine, using [stdio](https://spec.modelcontextprotocol.io/specification/draft/basic/transports/#stdio) as a local transport method.
2828

2929
### Best Practices
30-
- **Tool design**: Don’t treat your MCP server as a wrapper around your full API schema. Instead, build tools that are optimized for specific user goals and reliable outcomes. Fewer, well-designed tools often outperform many granular ones, especially for agents with small context windows or tight latency budgets.
30+
- **Tool design**: Do not treat your MCP server as a wrapper around your full API schema. Instead, build tools that are optimized for specific user goals and reliable outcomes. Fewer, well-designed tools often outperform many granular ones, especially for agents with small context windows or tight latency budgets.
3131
- **Scoped permissions**: Deploying several focused MCP servers, each with narrowly scoped permissions, reduces the risk of over-privileged access and makes it easier to manage and audit what each server is allowed to do.
3232
- **Tool descriptions**: Detailed parameter descriptions help agents understand how to use your tools correctly — including what values are expected, how they affect behavior, and any important constraints. This reduces errors and improves reliability.
33-
- **Evaluation tests**: Use evaluation tests (evals) to measure the agent’s ability to use your tools correctly. Run these after any updates to your server or tool descriptions to catch regressions early and track improvements over time.
33+
- **Evaluation tests**: Use evaluation tests ('evals') to measure the agent’s ability to use your tools correctly. Run these after any updates to your server or tool descriptions to catch regressions early and track improvements over time.
3434

3535
### Get Started
3636

src/content/docs/agents/model-context-protocol/mcp-agent-api.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ But if you want your MCP server to:
4646
You can use the APIs below in order to do so.
4747

4848
#### Hibernation Support
49-
`McpAgent` instances automatically support [WebSockets Hibernation](https://developers.cloudflare.com/durable-objects/best-practices/websockets/#websocket-hibernation-api), allowing stateful MCP servers to sleep during inactive periods while preserving their state. This means your agents only consume compute resources when actively processing requests, optimizing costs while maintaining the full context and conversation history.
49+
`McpAgent` instances automatically support [WebSockets Hibernation](/durable-objects/best-practices/websockets/#websocket-hibernation-api), allowing stateful MCP servers to sleep during inactive periods while preserving their state. This means your agents only consume compute resources when actively processing requests, optimizing costs while maintaining the full context and conversation history.
5050

5151
### State synchronization APIs
5252

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The Model Context Protocol (MCP) specification defines three standard [transport
1212

1313
1. **stdio, communication over standard in and standard out** — designed for local MCP connections.
1414
2. **Server-Sent Events (SSE)** — Currently supported by most remote MCP clients, but is expected to be replaced by Streamable HTTP over time. It requires two endpoints: one for sending requests, another for receiving streamed responses.
15-
3. **Streamable HTTP** New transport method [introduced](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http) in March 2025. It simplifies the communication by using a single HTTP endpoint for bidirectional messaging. It's currently gaining adoption among remote MCP clients, but is expected to become the standard transport in the future.
15+
3. **Streamable HTTP** New transport method [introduced](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http) in March 2025. It simplifies the communication by using a single HTTP endpoint for bidirectional messaging. It is currently gaining adoption among remote MCP clients, but it is expected to become the standard transport in the future.
1616

1717
MCP servers built with the [Agents SDK](/agents) can support both remote transport methods (SSE and Streamable HTTP), with the [`McpAgent` class](https://github.com/cloudflare/agents/blob/2f82f51784f4e27292249747b5fbeeef94305552/packages/agents/src/mcp.ts) automatically handling the transport configuration.
1818

@@ -78,7 +78,7 @@ export default app
7878
```
7979
</TabItem> </Tabs>
8080
81-
#### MCP Server with Authentication
81+
#### MCP Server with Authentication
8282
If your MCP server implements authentication & authorization using the [Workers OAuth Provider](https://github.com/cloudflare/workers-oauth-provider) Library, then you can configure it to support both transport methods using the `apiHandlers` property.
8383
8484
```js
@@ -105,6 +105,6 @@ To use apiHandlers, update to @cloudflare/workers-oauth-provider v0.0.4 or later
105105
With these few changes, your MCP server will support both transport methods, making it compatible with both existing and new clients.
106106
107107
### Testing with MCP Clients
108-
While most MCP clients haven't yet adopted the new Streamable HTTP transport, you can start testing it today using [`mcp-remote`](https://www.npmjs.com/package/mcp-remote), an adapter that lets MCP clients that otherwise only support local connections work with remote MCP servers.
108+
While most MCP clients have not yet adopted the new Streamable HTTP transport, you can start testing it today using [`mcp-remote`](https://www.npmjs.com/package/mcp-remote), an adapter that lets MCP clients that otherwise only support local connections work with remote MCP servers.
109109
110110
Follow [this guide](/agents/guides/test-remote-mcp-server/) for instructions on how to connect to your remote MCP server from Claude Desktop, Cursor, Windsurf, and other local MCP clients, using the [`mcp-remote` local proxy](https://www.npmjs.com/package/mcp-remote).

src/content/docs/agents/platform/limits.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Many limits are inherited from those applied to Workers scripts and/or Durable O
1818
| Max definitions per account | ~250,000+ [^2]
1919
| Max state stored per unique Agent | 1 GB |
2020
| Max compute time per Agent | 30 seconds (refreshed per HTTP request / incoming WebSocket message) [^3] |
21-
| Duration (wall clock) per step [^3] | Unlimited (e.g. waiting on a database call or an LLM response) |
21+
| Duration (wall clock) per step [^3] | Unlimited (for example, waiting on a database call or an LLM response) |
2222

2323
---
2424

src/content/docs/ai-gateway/configuration/caching.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Enable and customize your gateway cache to serve requests directly from Cloudfla
1515

1616
Currently caching is supported only for text and image responses, and it applies only to identical requests.
1717

18-
This is helpful for use cases when there are limited prompt options - for example, a support bot that asks "How can I help you?" and lets the user select an answer from a limited set of options works well with the current caching configuration.
18+
This configuration benefits use cases with limited prompt options. For example, a support bot that asks "How can I help you?" and lets the user select an answer from a limited set of options works well with the current caching configuration.
1919
We plan on adding semantic search for caching in the future to improve cache hit rates.
2020
:::
2121

src/content/docs/ai-gateway/configuration/websockets-api/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The AI Gateway WebSockets API provides a persistent connection for AI interactio
1111
- **Realtime APIs** - Designed for AI providers that offer low-latency, multimodal interactions over WebSockets.
1212
- **Non-Realtime APIs** - Supports standard WebSocket communication for AI providers, including those that do not natively support WebSockets.
1313

14-
## When to use WebSockets?
14+
## When to use WebSockets
1515

1616
WebSockets are long-lived TCP connections that enable bi-directional, real-time and non realtime communication between client and server. Unlike HTTP connections, which require repeated handshakes for each request, WebSockets maintain the connection, supporting continuous data exchange with reduced overhead. WebSockets are ideal for applications needing low-latency, real-time data, such as voice assistants.
1717

src/content/docs/ai-gateway/evaluations/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sidebar:
1010

1111
Understanding your application's performance is essential for optimization. Developers often have different priorities, and finding the optimal solution involves balancing key factors such as cost, latency, and accuracy. Some prioritize low-latency responses, while others focus on accuracy or cost-efficiency.
1212

13-
AI Gateway's Evaluations provide the data needed to make informed decisions on how to optimize your AI application. Whether it's adjusting the model, provider, or prompt, this feature delivers insights into key metrics around performance, speed, and cost. It empowers developers to better understand their application's behavior, ensuring improved accuracy, reliability, and customer satisfaction.
13+
AI Gateway's Evaluations provide the data needed to make informed decisions on how to optimize your AI application. Whether it is adjusting the model, provider, or prompt, this feature delivers insights into key metrics around performance, speed, and cost. It empowers developers to better understand their application's behavior, ensuring improved accuracy, reliability, and customer satisfaction.
1414

1515
Evaluations use datasets which are collections of logs stored for analysis. You can create datasets by applying filters in the Logs tab, which help narrow down specific logs for evaluation.
1616

src/content/docs/ai-gateway/get-started.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Now that your provider is connected to the AI Gateway, you can view analytics fo
5555

5656
:::note[Note]
5757

58-
The cost metric is an estimation based on the number of tokens sent and received in requests. While this metric can help you monitor and predict cost trends, refer to your providers dashboard for the most accurate cost details.
58+
The cost metric is an estimation based on the number of tokens sent and received in requests. While this metric can help you monitor and predict cost trends, refer to your provider's dashboard for the most accurate cost details.
5959

6060
:::
6161

0 commit comments

Comments
 (0)