容器沙箱MCP服务器

一个支持远程MCP连接并集成沙箱容器工具的服务器,用于在安全环境中运行任意代码。

作者 By cloudflare
本地部署 容器沙箱 远程MCP
GitHub

Cloudflare容器沙盒MCP服务器

这是一个 模型上下文协议(MCP) 支持远程MCP连接的服务器,内置Cloudflare OAuth。

它将运行沙盒容器的工具与MCP客户端集成在一起。使用此服务器,您可以允许LLM在安全的沙盒环境中运行任意代码,如Node或Python。

工具

类别工具描述
容器生命周期container_initialize(重新)启动容器。容器是短暂的,不保存任何状态。集装箱只能保证使用约10米。
container_pingPing容器以实现连接
文件系统container_file_write写入文件
container_files_list列出工作目录中的所有文件
container_file_read读取单个文件或目录的内容
container_file_delete删除单个文件或目录
执行container_exec在shell中运行命令

此MCP服务器仍在开发中,我们计划在未来添加更多工具。

提示示例

  • Create a visualization using matplotlib. Run it in the container that you can start
  • Clone and explore this github repo: [repo link]. Setup and run the tests in your development environment
  • Analyze this data using Python

从任何MCP客户端访问远程MCP服务器

如果您的MCP客户端对远程MCP服务器具有一流的支持,则客户端将提供一种接受服务器URL的方法(https://containers.mcp.cloudflare.com)直接在其界面内(例如 Cloudflare AI游乐场).

如果您的客户端尚不支持远程MCP服务器,则需要使用设置其相应的配置文件 mcp遥控器 指定您的客户端可以访问哪些服务器。

用以下配置替换内容:

JSON``` 1 2 3 4 5 6 7 8{ “mcpServers”: { “cloudflare”: { “command”: “npx”, “args”: [“mcp-remote”, “https://containers.mcp.cloudflare.com/mcp”] } } }


设置好配置文件后,重新启动MCP客户端,将打开一个浏览器窗口,显示您的OAuth登录页面。继续执行身份验证流程,以授予客户端访问MCP服务器的权限。授予访问权限后,这些工具将可供您使用。


有兴趣贡献并在本地运行此服务器吗?看 贡献.md 开始吧。