MCPInstall
Sandbox Container logo

Sandbox Container

Featured
by cloudflare 4,424 stars cloudflare/mcp-server-cloudflare

Provides a secure, sandboxed environment for executing Python, Node.js, and shell commands in ephemeral containers with file management capabilities for code testing, visualization, and data analysis.

READMEHEAD

Cloudflare Container Sandbox MCP Server

This is a Model Context Protocol (MCP) server that supports remote MCP connections, with Cloudflare OAuth built-in.

It integrates tools for running a sandbox container with your MCP client. With this server you can allow your LLM to run arbitrary code, such as Node or Python, in a secure, sandboxed environment.

The /mcp URL uses a stateless SDK v2 handler that creates a fresh server for every request. The retired /sse URL returns 410 Gone pointing at /mcp. UserContainer and ContainerManager remain application Durable Objects for per-user container lifecycle and capacity management; there is no MCP protocol session or protocol Durable Object.

Each user's sandbox is a Container controlled by their UserContainer Durable Object through the native ctx.container API, with the durable_object scheduling policy. Every tool runs as a process with ctx.container.exec(); the container itself runs no server.

Sandboxes start from a snapshot of the Cloudflare-managed cloudflare/debian-trixie image with Python, pip, git, build tools and pnpm installed. One UserContainer instance, __sandbox-template__, builds that snapshot the first time a sandbox starts and keeps the handle (server/sandboxTemplate.ts). Every restore refreshes the snapshot's 30-day lifetime; if a restore fails, for example because the snapshot expired, the template is rebuilt.

Tools

CategoryToolDescription
Container Lifecyclecontainer_initialize(Re)start a container. Containers are intended to be ephemeral and don't save any state. Containers are only guaranteed to last ~10m.
container_pingPing a container for connectivity
Filesystemcontainer_file_writeWrite to a file
container_files_listList all files in the work directory
container_file_readRead the contents of a single file or directory
container_file_deleteDelete a single file or directory
Executioncontainer_execRun a command in the shell

This MCP server is still a work in progress, and we plan to add more tools in the future.

Prompt Examples

  • 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

Connect to the MCP server

Connect your MCP client directly to https://containers.mcp.cloudflare.com/mcp. If prompted, complete the Cloudflare OAuth flow in your browser. The tools become available after authorization.

Interested in contributing, and running this server locally? See CONTRIBUTING.md to get started.

More Developer Tools MCP servers

Similar servers from the same category.

Sourcebot

sourcebot-dev

Enables code search across multiple repository hosts including GitHub, GitLab, Gitea, Gerrit, and Bitbucket with advanced filtering options for exploring large codebases through natural language queries.

searchgit

CodeAlive

codealive-ai

Provides a bridge to CodeAlive's platform for semantic code search, repository exploration, and context-aware chat completions that leverage deep understanding of entire codebases including documentation and dependencies.

search

NovaCV

lightbaby

Integrates with NovaCV API to generate, analyze, and convert resumes in various formats without dealing with complex document formatting

PDFSupport+5

Pipedream

pipedreamhq

Access hosted MCP servers or deploy your own for 2,500+ APIs like Slack, GitHub, Notion, Google Drive, and more, all with built-in auth and 10k tools.

git