Skip to content

Commit 2c21a45

Browse files
committed
More fixes
1 parent a8d0846 commit 2c21a45

File tree

9 files changed

+54
-78
lines changed

9 files changed

+54
-78
lines changed

src/content/docs/agents/guides/build-mcp-server.mdx

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
pcx_content_type: tutorial
3-
title: Build an MCP Server
3+
title: Build a Local MCP Server
44
sidebar:
55
order: 100
66
group:
@@ -19,7 +19,7 @@ import { Aside } from "@astrojs/starlight/components";
1919

2020
[Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) is an open standard that allows AI agents and assistants (like [Claude Desktop](https://claude.ai/download) or [Cursor](https://www.cursor.com/)) to interact with services directly. If you want users to access your service through an AI assistant, you can spin up an MCP server for your application.
2121

22-
### Building an MCP Server on Workers
22+
### Building a local MCP Server on Workers
2323

2424
With Cloudflare Workers, you can turn any API or service into an MCP server with minimal setup.
2525

@@ -36,11 +36,9 @@ Below we will run you through an example of building an MCP server that fetches
3636

3737
Follow these steps to create and deploy your own MCP server on Cloudflare Workers.
3838

39-
<Aside type="note">
40-
Remote MCP servers are not supported yet. The workers-mcp tooling creates a
41-
local proxy that forwards requests to your Worker, allowing the server to be
42-
used by an MCP client.
43-
</Aside>
39+
:::note
40+
Looking to deploy a MCP server that supports _remote_ connections over the Internet, with authentication and authorization? Check out our [guide](/docs/agents/model-context-protocol/getting-started) for building and deploying remote MCP servers to Cloudflare.
41+
:::
4442

4543
### Create a new Worker
4644

@@ -63,8 +61,14 @@ cd my-mcp-worker
6361
When you run the setup command, it will build your Worker using the configuration in your wrangler.toml or wrangler.jsonc file. By default, no additional configuration is needed, but if you have multiple Cloudflare accounts, you'll need to specify your account ID as shown below.
6462

6563
<WranglerConfig>
66-
```toml name = "my-mcp-worker" main = "src/index.ts" compatibility_date =
67-
"2025-03-03" account_id = "your-account-id" ```
64+
65+
```toml
66+
name = "my-mcp-worker"
67+
main = "src/index.ts"
68+
compatibility_date = "2025-03-03"
69+
account_id = "your-account-id"
70+
```
71+
6872
</WranglerConfig>
6973

7074
### Install the MCP tooling
@@ -224,11 +228,8 @@ For [Windsurf](https://modelcontextprotocol.io/clients#windsurf-editor) and othe
224228

225229
Make sure to replace the placeholders with your actual server name, URL, and project path.
226230

227-
### Coming soon
231+
## Next steps
228232

229-
The Model Context Protocol spec is [actively evolving](https://github.com/modelcontextprotocol/specification/discussions) and we're working on expanding Cloudflare's MCP support. Here's what we're working on:
233+
Now that you've built an MCP server that users can install and run locally, you should consider building a remote MCP server that supports _remote_ connections over the Internet.
230234

231-
- **Remote MCP support**: Connect to MCP servers directly without requiring a local proxy
232-
- **Authentication**: OAuth support for secure MCP server connections
233-
- **Real-time communication**: SSE (Server-Sent Events) and WebSocket support for persistent connections and stateful interactions between clients and servers
234-
- **Extended capabilities**: Native support for more MCP protocol capabilities like [resources](https://modelcontextprotocol.io/docs/concepts/resources), [prompts](https://modelcontextprotocol.io/docs/concepts/prompts) and [sampling](https://modelcontextprotocol.io/docs/concepts/sampling)
235+
Cloudflare provides [everything you need to start building a remote MCP server](/agents/model-context-protocol/getting-started), so that you're ready for when MCP clients become capable of connecting to remote servers.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
pcx_content_type: example
3-
title: GitHub as Oauth Provider
3+
title: Build a Remote MCP Server with GitHub Auth
44
description: An example MCP server that uses GitHub as an OAuth provider
55
external_link: https://github.com/cloudflare/ai/demos/remote-mcp-server-github
66
sidebar:
7-
order: 2
7+
order: 8
88
---
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
pcx_content_type: example
3-
title: Slack MCP Server
3+
title: Build a Remote MCP Server that exposes Slack as a tool
44
description: An MCP server that uses Slack as an OAuth provider, and allows MCP clients to send messages to a Slack channel.
55
external_link: https://github.com/cloudflare/ai/demos/remote-mcp-server-slack
66
sidebar:
7-
order: 3
7+
order: 9
88
---
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
pcx_content_type: example
3+
title: Build a Remote MCP Server
4+
description: Complete example of a remote MCP server, with authorization built-in, that you can deploy to Cloudflare
5+
external_link: https://github.com/cloudflare/ai/demos/remote-mcp-server
6+
sidebar:
7+
order: 7
8+
---

src/content/docs/agents/model-context-protocol/examples/hello-world.mdx

Lines changed: 0 additions & 8 deletions
This file was deleted.

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

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/content/docs/agents/model-context-protocol/getting-started.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,29 @@ sidebar:
77

88
import { Details, Render, PackageManagers } from "~/components";
99

10+
You can build both local and remote MCP servers on Cloudflare.
11+
12+
Local MCP servers rely on running a local proxy on the same machine as your application. Remote MCP servers run on Cloudflare and support remote, authenticated connections over the Internet.
13+
14+
This guide will teach you how to build and deploy your first remote MCP server to Cloudflare. If you want to build a local MCP server, see the [build a local MCP server](/agents/guides/build-mcp-server/) guide.
15+
16+
### What is the Model Context Protocol (MCP)?
17+
18+
[Model Context Protocol (MCP)](https://modelcontextprotocol.io) is an open standard that connects AI systems with external applications. Think of MCP like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect your devices to various accessories, MCP provides a standardized way to connect AI agents to different services.
19+
20+
#### MCP Terminology
21+
22+
- **MCP Hosts**: AI assistants (like [Claude](http://claude.ai) or [Cursor](http://cursor.com)), AI agents, or applications that need to access external capabilities.
23+
- **MCP Clients**: Clients embedded within the MCP hosts that connect to MCP servers and invoke tools. Each MCP client instance has a single connection to an MCP server.
24+
- **MCP Servers**: Applications that expose [tools](/agents/model-context-protocol/mcp-server/tools/), [prompts](https://modelcontextprotocol.io/docs/concepts/prompts), and [resources](https://modelcontextprotocol.io/docs/concepts/resources) that MCP clients can use.
25+
26+
#### Remote vs. local MCP connections
27+
28+
The MCP standard supports two modes of operation:
29+
30+
- **Remote MCP connections**: MCP clients connect to MCP servers over the Internet, establishing a [long-lived connection using HTTP and Server-Sent Events (SSE)](/agents/model-context-protocol/mcp-server/transport/), and authorizing the MCP client access to resources on the user's account using [OAuth](/agents/model-context-protocol/mcp-server/authorization/).
31+
- **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.
32+
1033
## Deploy your first MCP server
1134

1235
This guide will walk you through how to deploy an [example MCP server](https://github.com/cloudflare/ai/demos/remote-mcp-server) to your Cloudflare account. You will then customize this example to suit your needs.

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

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,5 @@ pcx_content_type: navigation
44
sidebar:
55
order: 4
66
group:
7-
hideIndex: false
7+
hideIndex: true
88
---
9-
10-
# Deploy MCP Servers to Cloudflare
11-
12-
You can build and deploy MCP servers on Cloudflare, using the [`workers-mcp` package](https://github.com/cloudflare/workers-mcp), which provides an SDK for [authorization](/agents/model-context-protocol/mcp-server/authorization/), [transport](/agents/model-context-protocol/mcp-server/transport/), and [tool definition and discovery](/agents/model-context-protocol/mcp-server/tools/).
13-
14-
The [getting started section](/agents/model-context-protocol/mcp-server/getting-started/) will guide you to build and deploy your first MCP server to Cloudflare.
15-
16-
### What is the Model Context Protocol (MCP)?
17-
18-
[Model Context Protocol (MCP)](https://modelcontextprotocol.io) is an open standard that connects AI systems with external applications. Think of MCP like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect your devices to various accessories, MCP provides a standardized way to connect AI agents to different services.
19-
20-
#### MCP Terminology
21-
22-
- **MCP Hosts**: AI assistants (like [Claude](http://claude.ai) or [Cursor](http://cursor.com)), AI agents, or applications that need to access external capabilities.
23-
- **MCP Clients**: Clients embedded within the MCP hosts that connect to MCP servers and invoke tools. Each MCP client instance has a single connection to an MCP server.
24-
- **MCP Servers**: Applications that expose [tools](/agents/model-context-protocol/mcp-server/tools/), [prompts](https://modelcontextprotocol.io/docs/concepts/prompts), and [resources](https://modelcontextprotocol.io/docs/concepts/resources) that MCP clients can use.
25-
26-
#### Remote vs. local MCP connections
27-
28-
The MCP standard supports two modes of operation:
29-
30-
- **Remote MCP connections**: MCP clients connect to MCP servers over the Internet, establishing a [long-lived connection using HTTP and Server-Sent Events (SSE)](/agents/model-context-protocol/mcp-server/transport/), and authorizing the MCP client access to resources on the user's account using [OAuth](/agents/model-context-protocol/mcp-server/authorization/).
31-
- **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.
32-
33-
[`workers-mcp`](https://github.com/cloudflare/workers-mcp) is designed to support remote MCP connections. Remote MCP connections allow MCP clients that run in web browsers, mobile apps, and other environments outside of the end-user's machine to connect to your MCP server, such as [Claude.ai](https://www.anthropic.com/claude), and other AI agents.
34-
35-
### Why deploy your MCP server to Cloudflare?
36-
37-
- Authorization is [built-in](/agents/model-context-protocol/mcp-server/authorization/). Cloudflare handles the hard parts of the OAuth flow for you.
38-
- Transport over HTTP with Server-Sent Events (SSE) is [built-in](/agents/model-context-protocol/mcp-server/transport/)
39-
40-
### Next step — deploy your first MCP server to Cloudflare
41-
42-
Go to [getting started](/agents/model-context-protocol/mcp-server/getting-started/) to learn how to build and deploy MCP servers to Cloudflare.

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ import { Render } from "~/components";
99

1010
Model Context Protocol (MCP) tools are functions that a [MCP Server](/agents/model-context-protocol/mcp-server) provides and MCP clients can call.
1111

12-
When you build MCP Servers with the `@cloudflare/model-context-protocol` package, you can define tools using the `@modelcontextprotocol/typescript-sdk` package.
12+
When you build MCP Servers with the `@cloudflare/model-context-protocol` package, you can define tools the [same way as shown in the `@modelcontextprotocol/typescript-sdk` package's examples](https://github.com/modelcontextprotocol/typescript-sdk?tab=readme-ov-file#tools).
1313

14-
For example, the following code defines a simple MCP server that adds two numbers together:
15-
16-
{/* TODO: Reference code in Github, link to a runnable example, use Deploy to Workers button */}
14+
For example, the following code from [this example MCP server](https://github.com/cloudflare/ai/demos/remote-mcp-server) defines a simple MCP server that adds two numbers together:
1715

1816
```ts title="src/index.ts"
1917
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp";

0 commit comments

Comments
 (0)