mcpField
B
Building a Remote MCP Server on Cloudflare (Without Auth)

Building a Remote MCP Server on Cloudflare (Without Auth)

本地服务
github.com/dinasaur404开发工具081 周前更新

关于 Building a Remote MCP Server on Cloudflare (Without Auth)

这是一个 Cloudflare Workers 示例,演示如何构建并部署无需身份验证的远程 MCP 服务,并提供本地开发以及连接 Cloudflare AI Playground 和 Claude Desktop 的说明。

主要功能

  1. 01无需身份验证的远程 MCP 服务
  2. 02部署到 Cloudflare Workers
  3. 03本地开发配置
  4. 04连接 Cloudflare AI Playground
  5. 05连接 Claude Desktop

适用场景

  1. 01构建免验证的 MCP 端点原型
  2. 02在本地运行并测试服务
  3. 03将 Worker 服务连接到 MCP 客户端

MCP 相关

演示在 Cloudflare Workers 上运行远程 MCP 服务,以及 Cloudflare AI Playground、Claude Desktop 等 MCP 客户端如何连接。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

暂未收录安装方式

我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。

代码仓库

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

在 Cloudflare 上构建远程 MCP 服务(无需身份验证)

此示例演示如何在 Cloudflare Workers 上创建无需身份验证的远程 MCP 服务。

设置与安装

# Clone the repository
git clone [email protected]:cloudflare/ai.git

# Navigate to the project directory
cd ai/demos/remote-mcp-authless/

# Install dependencies
pnpm install

# Deploy your worker
pnpm run deploy

你的 MCP 服务将部署到类似以下 URL 的地址:remote-mcp-server-authless.your-account.workers.dev/sse

# Run locally 
npm run dev

你的服务将在 http://localhost:8787/sse 上提供。

连接到 Cloudflare AI Playground

你可以通过 Cloudflare AI Playground(一个远程 MCP 客户端)连接到你的 MCP 服务:

  1. 前往 https://playground.ai.cloudflare.com/
  2. 输入已部署的 MCP 服务 URL(worker-name.account-name.workers.dev/sse)
  3. 现在,你可以直接在 Playground 中使用 MCP 工具,无需任何身份验证!

将 Claude Desktop 连接到你的 MCP 服务

按照 Anthropic 的快速入门指南操作,然后在 Claude Desktop 中前往 Settings > Developer > Edit Config。

使用以下配置进行更新:

{
  "mcpServers": {
    "calculator": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://localhost:8787/sse"  // or at remote-mcp-server-authless.your-account.workers.dev/sse
      ]
    }
  }
}

重启 Claude 后,你应该会看到可用的工具。

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。