Skip to content

Commit 5d82238

Browse files
Added Code Mode docs & cross-refs. (#28343)
* [Agents] Add Codemode cross-references and expand MCP server docs - Expand mcp-servers-for-cloudflare.mdx with detailed Cloudflare API MCP server section: Codemode explanation, token comparison table, connection instructions, and agent/IDE plugin install guides - Move Cloudflare API server from table row into its own H2 section - Reorganize remaining servers under 'Product-specific MCP servers' - Add Codemode cross-reference section to worker-loader.mdx - Fix style issues: lowercase 'MCP servers'/'MCP client', standard link phrasing, list marker consistency, code indentation * Fixing nit to trigger compiles action --------- Co-authored-by: ask-bonk[bot] <ask-bonk[bot]@users.noreply.github.com> Co-authored-by: Jun Lee <junlee@cloudflare.com>
1 parent 1e85765 commit 5d82238

2 files changed

Lines changed: 200 additions & 119 deletions

File tree

src/content/docs/agents/model-context-protocol/mcp-servers-for-cloudflare.mdx

Lines changed: 77 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,86 @@ sidebar:
77
order: 8
88
---
99

10-
Cloudflare runs a catalog of managed remote MCP Servers which you can connect to using OAuth on clients like [Claude](https://modelcontextprotocol.io/quickstart/user), [Windsurf](https://docs.windsurf.com/windsurf/cascade/mcp), our own [AI Playground](https://playground.ai.cloudflare.com/) or any [SDK that supports MCP](/agents/api-reference/mcp-client-api/).
10+
Cloudflare runs a catalog of managed remote MCP servers which you can connect to using OAuth on clients like [Claude](https://modelcontextprotocol.io/quickstart/user), [Windsurf](https://docs.windsurf.com/windsurf/cascade/mcp), our own [AI Playground](https://playground.ai.cloudflare.com/) or any [SDK that supports MCP](https://github.com/cloudflare/agents/tree/main/packages/agents/src/mcp).
1111

12-
These MCP servers allow your MCP Client to read configurations from your account, process information, make suggestions based on data, and even make those suggested changes for you. All of these actions can happen across Cloudflare's many services including application development, security and performance. They support both the `streamable-http` transport via `/mcp` and the `sse` transport (deprecated) via `/sse`.
12+
These MCP servers allow your MCP client to read configurations from your account, process information, make suggestions based on data, and even make those suggested changes for you. All of these actions can happen across Cloudflare's many services including application development, security and performance. They support both the `streamable-http` transport via `/mcp` and the `sse` transport (deprecated) via `/sse`.
13+
14+
## Cloudflare API MCP server
15+
16+
The [Cloudflare API MCP server](https://github.com/cloudflare/mcp) provides access to the entire [Cloudflare API](/api/) — over 2,500 endpoints across DNS, Workers, R2, Zero Trust, and every other product — through just two tools: `search()` and `execute()`.
17+
18+
It uses [Codemode](/agents/api-reference/codemode/), a technique where the model writes JavaScript against a typed representation of the OpenAPI spec and the Cloudflare API client, rather than loading individual tool definitions for each endpoint. The generated code runs inside an isolated [Dynamic Worker](/workers/runtime-apis/bindings/worker-loader/) sandbox.
19+
20+
This approach uses approximately 1,000 tokens regardless of how many API endpoints exist. An equivalent MCP server that exposed every endpoint as a native tool would consume over 1 million tokens — more than the entire context window of most foundation models.
21+
22+
| Approach | Tools | Token cost |
23+
| --------------------------------- | ----- | ---------- |
24+
| Native MCP (full schemas) | 2,594 | ~1,170,000 |
25+
| Native MCP (required params only) | 2,594 | ~244,000 |
26+
| Codemode | 2 | ~1,000 |
27+
28+
### Connect to the Cloudflare API MCP server
29+
30+
Add the following configuration to your MCP client:
31+
32+
```json
33+
{
34+
"mcpServers": {
35+
"cloudflare-api": {
36+
"url": "https://mcp.cloudflare.com/mcp"
37+
}
38+
}
39+
}
40+
```
41+
42+
When you connect, you will be redirected to Cloudflare to authorize via OAuth and select the permissions to grant to your agent.
43+
44+
For CI/CD or automation, you can create a [Cloudflare API token](https://dash.cloudflare.com/profile/api-tokens) with the permissions you need and pass it as a bearer token in the `Authorization` header. Both user tokens and account tokens are supported.
45+
46+
For more information, refer to the [Cloudflare MCP repository](https://github.com/cloudflare/mcp).
47+
48+
### Install via agent and IDE plugins
49+
50+
You can install the [Cloudflare Skills plugin](https://github.com/cloudflare/skills), which bundles the Cloudflare MCP servers alongside contextual skills and slash commands for building on Cloudflare. The plugin works with any agent that supports the Agent Skills standard, including Claude Code, OpenCode, OpenAI Codex, and Pi.
51+
52+
#### Claude Code
53+
54+
Install using the [plugin marketplace](https://code.claude.com/docs/en/discover-plugins#add-from-github):
55+
56+
```txt
57+
/plugin marketplace add cloudflare/skills
58+
```
59+
60+
#### Cursor
61+
62+
Install from the **Cursor Marketplace**, or add manually via **Settings** > **Rules** > **Add Rule** > **Remote Rule (Github)** with `cloudflare/skills`.
63+
64+
#### npx skills
65+
66+
Install using the [`npx skills`](https://skills.sh) CLI:
67+
68+
```sh
69+
npx skills add https://github.com/cloudflare/skills
70+
```
71+
72+
#### Clone or copy
73+
74+
Clone the [cloudflare/skills](https://github.com/cloudflare/skills) repository and copy the skill folders into the appropriate directory for your agent:
75+
76+
| Agent | Skill directory | Docs |
77+
| ------------ | ---------------------------- | ---------------------------------------------------------------------------------------------------- |
78+
| Claude Code | `~/.claude/skills/` | [Claude Code skills](https://code.claude.com/docs/en/skills) |
79+
| Cursor | `~/.cursor/skills/` | [Cursor skills](https://cursor.com/docs/context/skills) |
80+
| OpenCode | `~/.config/opencode/skills/` | [OpenCode skills](https://opencode.ai/docs/skills/) |
81+
| OpenAI Codex | `~/.codex/skills/` | [OpenAI Codex skills](https://developers.openai.com/codex/skills/) |
82+
| Pi | `~/.pi/agent/skills/` | [Pi coding agent skills](https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent#skills) |
83+
84+
## Product-specific MCP servers
85+
86+
In addition to the Cloudflare API MCP server, Cloudflare provides product-specific MCP servers for targeted use cases:
1387

1488
| Server Name | Description | Server URL |
1589
| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------- |
16-
| [Cloudflare API server](https://github.com/cloudflare/mcp) | Access the full Cloudflare API (2500+ endpoints) via Code Mode | `https://mcp.cloudflare.com/mcp` |
1790
| [Documentation server](https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/docs-vectorize) | Get up to date reference information on Cloudflare | `https://docs.mcp.cloudflare.com/mcp` |
1891
| [Workers Bindings server](https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/workers-bindings) | Build Workers applications with storage, AI, and compute primitives | `https://bindings.mcp.cloudflare.com/mcp` |
1992
| [Workers Builds server](https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/workers-builds) | Get insights and manage your Cloudflare Workers Builds | `https://builds.mcp.cloudflare.com/mcp` |
@@ -31,4 +104,4 @@ These MCP servers allow your MCP Client to read configurations from your account
31104
| [GraphQL server](https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/graphql/) | Get analytics data using Cloudflare's GraphQL API | `https://graphql.mcp.cloudflare.com/mcp` |
32105
| [Agents SDK Documentation server](https://github.com/cloudflare/agents/tree/main/site/agents) | Token-efficient search of the Cloudflare Agents SDK documentation | `https://agents.cloudflare.com/mcp` |
33106

34-
Check our [GitHub page](https://github.com/cloudflare/mcp-server-cloudflare) to know how to use Cloudflare's remote MCP servers with different MCP clients.
107+
Check the [GitHub page](https://github.com/cloudflare/mcp-server-cloudflare) to learn how to use Cloudflare's remote MCP servers with different MCP clients.

0 commit comments

Comments
 (0)