MCP Code Sandbox MCP Server

An extensible Message Communication Protocol (MCP) server that provides secure code execution capabilities in isolated sandbox environments. This

Local serverstdioPython

What is the MCP Code Sandbox MCP Server?

An extensible Message Communication Protocol (MCP) server that provides secure code execution capabilities in isolated sandbox environments. This server follows the

What it actually does

  • Create isolated sandbox environments for code execution
  • Execute Python code securely
  • Perform file operations (listing, reading, writing)
  • Install Python packages in the sandbox
  • Extensible architecture with abstracted code interpreter interface
  • Modular design with clean separation of concerns

Configuration

  • Python 3.10 or higher - E2B API key (for the default E2B interpreter)

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
create_sandboxCreate a new sandbox environment
close_sandboxClose and clean up a sandbox
get_sandbox_statusCheck status of sandboxes
execute_codeRun Python code in a sandbox
install_packageInstall a Python package
create_run_closeAll-in-one tool that creates a sandbox, runs code, and cleans up
list_filesList files in the sandbox
read_fileRead the contents of a file
write_fileWrite content to a file
upload_fileUpload a file to the sandbox
sandbox_tools.pyTools for sandbox administration
code_execution_tools.pyTools for code execution
file_tools.pyTools for file operations

How to install the MCP Code Sandbox MCP Server

{
  "mcpServers": {
    "code-sandbox": {
      "command": "python",
      "args": [
        "/ABSOLUTE/PATH/TO/main.py"
      ]
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Configuration

  • Python 3.10 or higher - E2B API key (for the default E2B interpreter)

Example prompts to try

  • “Use MCP Code Sandbox to sandbox tools.py.”
  • “Use MCP Code Sandbox to code execution tools.py.”
  • “Use MCP Code Sandbox to file tools.py.”

Frequently asked questions

An extensible Message Communication Protocol (MCP) server that provides secure code execution capabilities in isolated sandbox environments. This server follows the Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.