Skip to content
4 changes: 2 additions & 2 deletions src/content/docs/agents/api-reference/using-ai-models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You can also use the model routing features in [AI Gateway](/ai-gateway/) to rou

Because Agents are built on top of [Durable Objects](/durable-objects/), each Agent or chat session is associated with a stateful compute instance. Traditional serverless architectures often present challenges for persistent connections needed in real-time applications like chat.

A user can disconnect during a long-running response from a modern reasoning model (such as `o3-mini` or DeepSeek R1), or lose conversational context when refreshing the browser. Instead of relying on request-response patterns and managing an external database to track & store conversation state, state can be stored directly within the Agent. If a client disconnects, the Agent can write to its own distributed storage, and catch the client up as soon as it reconnects: even if it's hours or days later.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bllchmbrs, I suppose this means I need to be hyper aggressive everywhere about saying, only change the contraction?

If a client disconnects, the Agent can write to its own distributed storage, and catch the client up as soon as it reconnects: even if it is hours or days later.

## Calling AI Models

Expand Down Expand Up @@ -174,7 +174,7 @@ export class MyAgent extends Agent<Env> {

</TypeScriptExample>

Your wrangler configuration will need an `ai` binding added. This is shared across both Workers AI and AI Gateway.
To configure your wrangler setup, include an `ai` binding, which is applicable for both Workers AI and AI Gateway.
<WranglerConfig>

```toml
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/agents/concepts/human-in-the-loop.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sidebar:
order: 5
---

### What is Human-in-the-Loop?
### What is Human-in-the-Loop

Human-in-the-Loop (HITL) workflows integrate human judgment and oversight into automated processes. These workflows pause at critical points for human review, validation, or decision-making before proceeding. This approach combines the efficiency of automation with human expertise and oversight where it matters most.

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/agents/concepts/tools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar:

---

### What are tools?
### What are tools

Tools enable AI systems to interact with external services and perform actions. They provide a structured way for agents and workflows to invoke APIs, manipulate data, and integrate with external systems. Tools form the bridge between AI decision-making capabilities and real-world actions.

Expand All @@ -15,7 +15,7 @@ Tools enable AI systems to interact with external services and perform actions.
In an AI system, tools are typically implemented as function calls that the AI can use to accomplish specific tasks. For example, a travel booking agent might have tools for:

- Searching flight availability
- Checking hotel rates
- Checking hotel rates
- Processing payments
- Sending confirmation emails

Expand Down
8 changes: 4 additions & 4 deletions src/content/docs/agents/concepts/what-are-agents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ sidebar:

import { Render } from "~/components";

### What are agents?
### What are agents

An agent is an AI system that can autonomously execute tasks by making decisions about tool usage and process flow. Unlike traditional automation that follows predefined paths, agents can dynamically adapt their approach based on context and intermediate results. Agents are also distinct from co-pilots (e.g. traditional chat applications) in that they can fully automate a task, as opposed to simply augmenting and extending human input.
Agents are also distinct from co-pilots (for example, traditional chat applications) in that they can fully automate a task, as opposed to simply augmenting and extending human input.

- **Agents** → non-linear, non-deterministic (can change from run to run)
- **Workflows** → linear, deterministic execution paths
- **Co-pilots** → augmentative AI assistance requiring human intervention

### Example: Booking vacations

If this is your first time working with, or interacting with agents, this example will illustrate how an agent works within a context like booking a vacation. If you are already familiar with the topic, read on.
If this is your first time working with, or interacting with agents, this example will illustrate how an agent works within a context like booking a vacation. If you are already familiar with the topic, read on.

Imagine you're trying to book a vacation. You need to research flights, find hotels, check restaurant reviews, and keep track of your budget.

Expand Down Expand Up @@ -55,7 +55,7 @@ An agent combines AI's ability to make judgements and call the relevant tools to

![An agent diagram](~/assets/images/agents/agent-workflow.svg)

An agents can dynamically generate an itinerary and execute on booking reservations, similarly to what you would expect from a travel agent.
An agents can dynamically generate an itinerary and execute on booking reservations, similarly to what you would expect from a travel agent.

### Three primary components of agent systems:

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/agents/concepts/workflows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar:

import { Render } from "~/components";

## What are workflows?
## What are workflows

A workflow is the orchestration layer that coordinates how an agent's components work together. It defines the structured paths through which tasks are processed, tools are called, and results are managed. While agents make dynamic decisions about what to do, workflows provide the underlying framework that governs how those decisions are executed.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ You can also run an Agent locally using the `wrangler` CLI:
$ npx wrangler dev
```
```sh output
Your Worker and resources are simulated locally via Miniflare. For more information, see: https://developers.cloudflare.com/workers/testing/local-development.
Your Worker and resources are simulated locally via Miniflare. For more information, see: /workers/testing/local-development.

Your worker has access to the following bindings:
- Durable Objects:
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/agents/guides/build-mcp-client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ external_link: https://github.com/cloudflare/ai/tree/main/demos/mcp-client
sidebar:
order: 7
head: []
description: Build an AI Agent that acts as a remote MCP client.
description: Build an AI Agent that acts as a remote MCP client.
---
8 changes: 4 additions & 4 deletions src/content/docs/agents/guides/remote-mcp-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The button below will guide you through everything you need to do to deploy this

[![Deploy to Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-authless)

Once deployed, this server will be live at your workers.dev subdomain (e.g. remote-mcp-server-authless.your-account.workers.dev/sse). You can connect to it immediately using the [AI Playground](https://playground.ai.cloudflare.com/) (a remote MCP client), [MCP inspector](https://github.com/modelcontextprotocol/inspector) or [other MCP clients](/agents/guides/remote-mcp-server/#connect-your-remote-mcp-server-to-claude-and-other-mcp-clients-via-a-local-proxy). Then, once you're ready, you can customize the MCP server and add your own [tools](/agents/model-context-protocol/tools/).
Once deployed, this server will be live at your workers.dev subdomain (for example, remote-mcp-server-authless.your-account.workers.dev/sse). You can connect to it immediately using the [AI Playground](https://playground.ai.cloudflare.com/) (a remote MCP client), [MCP inspector](https://github.com/modelcontextprotocol/inspector) or [other MCP clients](/agents/guides/remote-mcp-server/#connect-your-remote-mcp-server-to-claude-and-other-mcp-clients-via-a-local-proxy). Then, once you're ready, you can customize the MCP server and add your own [tools](/agents/model-context-protocol/tools/).

If you're using the "Deploy to Cloudflare" button, a new git repository will be set up on your GitHub or GitLab account for your MCP server, configured to automatically deploy to Cloudflare each time you push a change or merge a pull request to the main branch of the repository. You can then clone this repository, [develop locally](/agents/guides/remote-mcp-server/#local-development), and start writing code and building.

Expand Down Expand Up @@ -80,7 +80,7 @@ After deploying, take the URL of your deployed MCP server, and enter it in the M

### Connect your Remote MCP server to Claude and other MCP Clients via a local proxy

Now that your MCP server is running, you can use the [`mcp-remote` local proxy](https://www.npmjs.com/package/mcp-remote) to connect Claude Desktop or other MCP clients to it — even though these tools aren't yet _remote_ MCP clients, and don't support remote transport or authorization on the client side. This lets you test what an interaction with your MCP server will be like with a real MCP client.
Now that your MCP server is running, you can use the [`mcp-remote` local proxy](https://www.npmjs.com/package/mcp-remote) to connect Claude Desktop or other MCP clients to it — even though these tools are not yet _remote_ MCP clients, and do not support remote transport or authorization on the client side. This allows you to test what an interaction with your MCP server will be like with a real MCP client.

Update your Claude Desktop configuration to point to the URL of your MCP server. You can use either the `localhost:8787/sse` URL, or the URL of your deployed MCP server:

Expand All @@ -104,11 +104,11 @@ Learn more about other ways of using remote MCP servers with MCP clients here in

## Add Authentication

Now that youve deployed a public MCP server, lets walk through how to enable user authentication using OAuth.
Now that you've deployed a public MCP server, let's walk through how to enable user authentication using OAuth.

The public server example you deployed earlier allows any client to connect and invoke tools without logging in. To add authentication, you’ll update your MCP server to act as an OAuth provider, handling secure login flows and issuing access tokens that MCP clients can use to make authenticated tool calls.

This is especially useful if users already need to log in to use your service. Once authentication is enabled, users can sign in with their existing account and grant their AI agent permission to interact with the tools exposed by your MCP server, using scoped permissions.
Enabling authentication is especially useful if users already need to log in to use your service.

In this example, we use GitHub as an OAuth provider, but you can connect your MCP server with any [OAuth provider](/agents/model-context-protocol/authorization/#2-third-party-oauth-provider) that supports the OAuth 2.0 specification, including Google, Slack, [Stytch](/agents/model-context-protocol/authorization/#stytch), [Auth0](/agents/model-context-protocol/authorization/#stytch), [WorkOS](/agents/model-context-protocol/authorization/#stytch), and more.

Expand Down
6 changes: 3 additions & 3 deletions src/content/docs/agents/guides/test-remote-mcp-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Render } from "~/components";

Remote, authorized connections are an evolving part of the [Model Context Protocol (MCP) specification](https://spec.modelcontextprotocol.io/specification/draft/basic/authorization/). Not all MCP clients support remote connections yet.

This guide will show you options for how to start using your remote MCP server with MCP clients that support remote connections. If you haven't yet created and deployed a remote MCP server, you should follow the [Build a Remote MCP Server](/agents/guides/remote-mcp-server/) guide first.
This guide will show you options for how to start using your remote MCP server with MCP clients that support remote connections. If you have not yet created and deployed a remote MCP server, you should follow the [Build a Remote MCP Server](/agents/guides/remote-mcp-server/) guide first.

## The Model Context Protocol (MCP) inspector

Expand All @@ -31,7 +31,7 @@ Once you have authenticated, you will be redirected back to the inspector. You s

## Connect your remote MCP server to Claude Desktop via a local proxy

Even though [Claude Desktop](https://claude.ai/download) doesn't yet support remote MCP clients, you can use the [`mcp-remote` local proxy](https://www.npmjs.com/package/mcp-remote) to connect it to your remote MCP server. This lets you to test what an interaction with your remote MCP server will be like with a real-world MCP client.
Even though [Claude Desktop](https://claude.ai/download) does not yet support remote MCP clients, you can use the [`mcp-remote` local proxy](https://www.npmjs.com/package/mcp-remote) to connect it to your remote MCP server. This lets you to test what an interaction with your remote MCP server will be like with a real-world MCP client.

1. Open Claude Desktop and navigate to Settings -> Developer -> Edit Config. This opens the configuration file that controls which MCP servers Claude can access.
2. Replace the content with a configuration like this:
Expand All @@ -55,7 +55,7 @@ Once authenticated, you'll be able to see your tools by clicking the tools icon

## Connect your remote MCP server to Cursor

To connect [Cursor](https://www.cursor.com/) with your remote MCP server, choose `Type`: "Command" and in the `Command` field, combine the command and args fields into one (e.g.`npx mcp-remote https://your-worker-name.your-account.workers.dev/sse`).
To connect [Cursor](https://www.cursor.com/) with your remote MCP server, choose `Type`: "Command" and in the `Command` field, combine the command and args fields into one (for example, `npx mcp-remote https://your-worker-name.your-account.workers.dev/sse`).

## Connect your remote MCP server to Windsurf

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/agents/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class MyAgent extends Agent {

Dive into the [Agent SDK reference](/agents/api-reference/agents-api/) to learn more about how to use the Agents SDK package and defining an `Agent`.

### Why build agents on Cloudflare?
### Why build agents on Cloudflare

We built the Agents SDK with a few things in mind:

Expand Down Expand Up @@ -95,7 +95,7 @@ Observe and control your AI applications with caching, rate limiting, request re

<RelatedProduct header="Vectorize" href="/vectorize/" product="vectorize">

Build full-stack AI applications with Vectorize, Cloudflares vector database. Adding Vectorize enables you to perform tasks such as semantic search, recommendations, anomaly detection or can be used to provide context and memory to an LLM.
Build full-stack AI applications with Vectorize, Cloudflare's vector database. Adding Vectorize enables you to perform tasks such as semantic search, recommendations, anomaly detection or can be used to provide context and memory to an LLM.

</RelatedProduct>

Expand Down
Loading