Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions public/__redirects
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
/agents/guides/build-mcp-server/ /agents/guides/remote-mcp-server/ 301
/agents/capabilities/mcp-server/ /agents/model-context-protocol/ 301
/agents/api-reference/calling-agents/ /agents/api-reference/routing/ 301
/agents/model-context-protocol/mcp-servers-for-cloudflare/ /cloudflare-for-agents/mcp-servers/ 301

# ai
/ai/ /use-cases/ai/ 301
Expand Down

This file was deleted.

65 changes: 65 additions & 0 deletions src/content/docs/cloudflare-for-agents/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
title: Cloudflare for Agents
pcx_content_type: overview
sidebar:
order: 1
head:
- tag: title
content: Cloudflare for Agents
---

import { Description, Feature, LinkButton } from "~/components";

<Description>

Services and tools that help AI agents interact with Cloudflare and the web.

</Description>

Cloudflare provides services that AI agents can use to browse the web, process content, access Cloudflare APIs, and more. These services work with any AI agent, whether built with the [Cloudflare Agents SDK](/agents/) or other frameworks.

<LinkButton href="/cloudflare-for-agents/mcp-servers/">
Browse MCP servers
</LinkButton>

---

## Services

<Feature
header="Skills"
href="https://github.com/cloudflare/skills"
cta="Browse Skills"
>
Modular capabilities for AI agents to connect to tools, services, and APIs.
Skills provide reusable building blocks for agent functionality.
</Feature>

<Feature
header="MCP servers"
href="/cloudflare-for-agents/mcp-servers/"
cta="View MCP servers"
>
Connect to Cloudflare's managed MCP servers for documentation, observability,
browser rendering, and more. Works with Claude, Cursor, Windsurf, and other
MCP clients.
</Feature>

<Feature
header="Markdown for Agents"
href="/cloudflare-for-agents/markdown-for-agents/"
cta="Enable Markdown for Agents"
>
Convert any page on your zone to Markdown using content negotiation. Agents
request pages with `Accept: text/markdown` and receive clean, token-efficient
Markdown.
</Feature>

<Feature
header="Wrangler CLI"
href="/cloudflare-for-agents/wrangler-cli/"
cta="Set up Wrangler for agents"
>
Give agents the ability to deploy Workers, manage KV, R2, D1, and other
Cloudflare resources using the Wrangler CLI with API tokens.
</Feature>
106 changes: 106 additions & 0 deletions src/content/docs/cloudflare-for-agents/markdown-for-agents.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
---
title: Markdown for Agents
pcx_content_type: how-to
sidebar:
order: 3
---

import { Tabs, TabItem, Plan } from "~/components";

<Plan type="pro" />

Markdown for Agents converts HTML pages to Markdown in real-time using [content negotiation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Content_negotiation). When enabled on a zone, clients can request any page with the `Accept: text/markdown` header and receive clean, token-efficient Markdown.

Markdown's explicit structure enables reliable chunking and retrieval, and reduces token usage compared to raw HTML.

## Enable Markdown for Agents

<Tabs>
<TabItem label="Dashboard">

1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account.
2. Select your zone.
3. In the sidebar under **Quick Actions**, toggle **Markdown for Agents** to enable.

</TabItem>
<TabItem label="API">

Send a `PATCH` request to enable markdown conversion:

```bash
curl -X PATCH "https://api.cloudflare.com/client/v4/zones/{zone_id}/settings/content_converter" \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{"value": "on"}'
```

You need an API token with **Zone Settings:Edit** permission.

</TabItem>
</Tabs>

## Request Markdown content

Add the `Accept: text/markdown` header to request Markdown instead of HTML.

### curl example

```bash
curl "https://example.com/docs/getting-started/" \
--header "Accept: text/markdown"
```

### JavaScript example

```js
const response = await fetch("https://example.com/docs/getting-started/", {
headers: {
Accept: "text/markdown",
},
});

const tokenCount = response.headers.get("x-markdown-tokens");
const markdown = await response.text();
```

## Response headers

Markdown responses include these headers:

| Header | Description |
| ------------------- | ---------------------------------------------- |
| `content-type` | Set to `text/markdown` |
| `x-markdown-tokens` | Estimated token count of the converted content |

The `x-markdown-tokens` header helps estimate context window usage and calculate costs when integrating with AI systems.

### Example response

```txt
HTTP/2 200
content-type: text/markdown
x-markdown-tokens: 1234

# Getting Started

Welcome to our documentation...
```

## Other Markdown conversion options

Cloudflare provides additional ways to convert content to Markdown:

| Service | Use case |
| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| [Workers AI toMarkdown](/workers-ai/features/markdown-conversion/) | Convert documents (PDF, images) to Markdown with AI-powered summarization |
| [Browser Rendering /markdown](/browser-rendering/rest-api/markdown-endpoint/) | Render JavaScript-heavy pages then convert to Markdown |

## Availability

Markdown for Agents is available to Pro and Business plans, and SSL for SaaS customers at no additional cost.

## Limitations

- Converts HTML only. Other document types are not supported.
- Compressed responses from the origin are not supported.
- This is a zone-level setting. For different settings on subdomains, use separate zones.
26 changes: 26 additions & 0 deletions src/content/docs/cloudflare-for-agents/mcp-servers.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: MCP servers
pcx_content_type: reference
sidebar:
order: 2
---

import { Render } from "~/components";

Cloudflare runs a catalog of managed remote [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) servers that you can connect to using OAuth on clients like [Claude](https://modelcontextprotocol.io/quickstart/user), [Windsurf](https://docs.windsurf.com/windsurf/cascade/mcp), [Cloudflare AI Playground](https://playground.ai.cloudflare.com/), or any [SDK that supports MCP](https://github.com/cloudflare/agents/tree/main/packages/agents/src/mcp).

These MCP servers allow your MCP client to read configurations from your account, process information, make suggestions based on data, and make changes for you. All servers support both `streamable-http` transport via `/mcp` and SSE transport (deprecated) via `/sse`.

## Connect to MCP servers

<Render file="mcp-connection-tabs" product="agents" />

## Available servers

<Render file="mcp-servers-table" product="agents" />

For more information on each server, visit the [GitHub repository](https://github.com/cloudflare/mcp-server-cloudflare).

## Build your own MCP server

To build and deploy your own MCP server on Cloudflare, refer to the [MCP documentation](/agents/model-context-protocol/) in the Agents SDK.
9 changes: 9 additions & 0 deletions src/content/docs/cloudflare-for-agents/skills.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
pcx_content_type: navigation
title: Skills
external_link: https://github.com/cloudflare/skills
sidebar:
order: 4
head: []
description: Modular capabilities for AI agents to connect to tools, services, and APIs.
---
Loading
Loading