mcp-server-cloudflare

Official

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Allows management of Cloudflare resources including Workers, KV namespaces, R2 storage buckets, D1 databases, and analytics. Capabilities include deploying Workers, querying D1 databases, manipulating data in KV stores, managing R2 buckets and objects, and retrieving analytics data for domains.

Cloudflare MCP 服务器

模型上下文协议 (MCP) 是一种新的标准化协议,用于管理大型语言模型 (LLM) 与外部系统之间的上下文。在此存储库中,我们提供了Cloudflare API 的安装程序和 MCP 服务器。

这使您可以使用 Claude Desktop 或任何 MCP 客户端,使用自然语言在您的 Cloudflare 帐户上完成操作,例如:

  • List all the Cloudflare workers on my <some-email>@gmail.com account.
  • Can you tell me about any potential issues on this particular worker '...'?

从 Claude Desktop 访问远程 MCP 服务器

打开 Claude Desktop,前往“设置”->“开发者”->“编辑配置”。这将打开配置文件,该文件控制 Claude 可以访问哪些 MCP 服务器。

将内容替换为以下配置。重启 Claude Desktop 后,将打开一个浏览器窗口,显示您的 OAuth 登录页面。完成身份验证流程,授予 Claude 访问您的 MCP 服务器的权限。授予访问权限后,您就可以使用这些工具了。

{ "mcpServers": { "cloudflare": { "command": "npx", "args": [ "mcp-remote", "https://observability.mcp.cloudflare.com/sse" ] } } }

需要访问更多 Cloudflare 工具吗?

我们正在逐步将功能迁移至此远程 MCP 服务器仓库。在此期间,请查看仅限本地的 mcp-server-cloudflare 软件包,该软件包目前提供更多工具。

访问https://www.npmjs.com/package/@cloudflare/mcp-server-cloudflare

付费功能

某些功能可能需要付费的 Cloudflare Workers 套餐。请确保您的 Cloudflare 帐户具有所需功能的必要订阅级别。

特征

工人管理

  • worker_list :列出您账户中的所有工人
  • worker_get_worker :获取 Worker 的脚本内容

工人日志

  • worker_logs_by_worker_name :按工作人员名称分析 Cloudflare Worker 的最新日志
  • worker_logs_by_ray_id :根据 Cloudflare Ray ID 分析所有工作人员针对特定请求的最新日志
  • worker_logs_keys :获取 Cloudflare Worker 可用的遥测密钥

发展

应用程序

套餐

  • eslint-config:所有应用程序和包使用的 Eslint 配置。
  • typescript-config:所有应用程序和包使用的 tsconfig。
  • mcp-common:共享常用工具和脚本来帮助管理此 repo。

有关此 monorepo 中开发的更多详细信息,请查看 apps/workers-observability

测试

该项目使用 Vitest 作为测试框架,并使用 MSW(Mock Service Worker)进行 API 模拟。

运行测试

运行所有测试:

pnpm test

要运行特定的测试文件:

pnpm test -- tests/tools/queues.test.ts

在监视模式下运行测试(在开发过程中很有用):

pnpm test:watch

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

-
security - not tested
A
license - permissive license
-
quality - not tested

让您使用 Claude Desktop 或任何 MCP 客户端,使用自然语言在您的 Cloudflare 帐户上完成操作。

  1. Access the remote MCP server from Claude Desktop
    1. Need access to more Cloudflare tools?
      1. Paid Features
        1. Features
          1. Workers Management
          2. Workers Logs
        2. Developing
          1. Apps
          2. Packages
        3. Testing
          1. Running Tests
        4. Contributing
          ID: uw9yuno75g