适用于 IDE 的 Cloudflare MCP 服务器
模型上下文协议 (MCP) 是一种新的标准化协议,用于管理大型语言模型 (LLM) 与外部系统之间的上下文。在此存储库中,我们提供了Cloudflare API 的安装程序和 MCP 服务器。
这使您可以使用 Claude Desktop 和 VSCode(Cline)和 Windsurf 等 IDE 或任何 MCP 客户端,使用自然语言在您的 Cloudflare 帐户上完成操作,例如:
Please deploy me a new Worker with an example durable object.
Can you tell me about the data in my D1 database named '...'?
Can you copy all the entries from my KV namespace '...' into my R2 bucket '...'?
演示
设置
- 运行
npx @gutmutcode/mcp-server-cloudflare init
- 重新启动 Claude Desktop,您应该会看到一个小的🔨图标,其中显示以下可用的工具:
- 检查 Cline 配置文件,您应该会看到一个包含您的 Cloudflare 帐户 ID 的
cloudflare
部分。 - 检查你的 Windsurf MCP 配置文件,你也应该会看到一个
cloudflare
部分。Windsurf 对 MCP 工具的使用有所限制,所以你不能同时使用太多工具。(与 Cline 和 Claude 不同)
特征
KV门店管理
get_kvs
:列出您帐户中的所有 KV 命名空间kv_get
:从 KV 命名空间获取值kv_put
:将值存储在 KV 命名空间中kv_list
:列出 KV 命名空间中的键kv_delete
:从 KV 命名空间中删除一个键
R2 存储管理
r2_list_buckets
:列出您帐户中的所有 R2 存储桶r2_create_bucket
:创建一个新的 R2 存储桶r2_delete_bucket
:删除 R2 存储桶r2_list_objects
:列出 R2 存储桶中的对象r2_get_object
:从 R2 存储桶中获取对象r2_put_object
:将对象放入 R2 存储桶r2_delete_object
:从 R2 存储桶中删除对象
D1 数据库管理
d1_list_databases
:列出您账户中的所有 D1 数据库d1_create_database
:创建一个新的 D1 数据库d1_delete_database
:删除 D1 数据库d1_query
:对 D1 数据库执行 SQL 查询
工人管理
worker_list
:列出您账户中的所有工人worker_get
:获取 Worker 的脚本内容worker_put
:创建或更新 Worker 脚本worker_delete
:删除 Worker 脚本
分析
analytics_get
:检索域的分析数据- 包括请求、带宽、威胁和页面浏览量等指标
- 支持日期范围过滤
发展
在当前项目文件夹中,运行:
然后,在第二个终端中:
这会将 Claude Desktop 与您本地安装的版本链接起来以供您测试。
Claude 之外的用法
要在本地运行服务器,请运行node dist/index run <account-id>
。
如果您正在使用其他 MCP 客户端,或者在本地进行测试,请执行tools/list
命令以获取所有可用工具的最新列表。然后,您可以使用tools/call
命令直接调用这些工具。
工人
KV商店
R2 存储
D1 数据库
分析
贡献
欢迎贡献代码!欢迎提交 Pull 请求。
This server cannot be installed
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.
MCP 服务器允许使用自然语言通过 Claude Desktop、VSCode 和其他 MCP 客户端管理 Cloudflare 资源(Workers、KV、R2、D1)。
Related Resources
Related MCP Servers
- -securityAlicense-qualityLets you use Claude Desktop, or any MCP Client, to use natural language to accomplish things on your Cloudflare account.Last updated -2,4132,244TypeScriptApache 2.0
- -securityAlicense-qualityA lightweight MCP server for managing DNS records, purging cache, and interacting with the Cloudflare API through natural language commands.Last updated -13TypeScriptMIT License
Workers MCPofficial
-securityAlicense-qualityA package that connects Claude Desktop and other MCP clients to Cloudflare Workers, enabling custom functionality to be accessed via natural language through the Model Context Protocol.Last updated -1,942457TypeScriptApache 2.0- -securityFlicense-qualityA deployable MCP (Model Context Protocol) server on Cloudflare Workers that doesn't require authentication, allowing users to create and access custom AI tools through Claude Desktop or the Cloudflare AI Playground.Last updated -TypeScript