Skip to content
Back to search

code-sandbox-mcp

An MCP server to create secure code sandbox environment for executing code within Docker containers. This MCP server provides AI applications with a safe and isolated environment for running code while maintaining security through containerization.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/automata-labs-team--code-sandbox-mcp/badge.svg)](/listings/automata-labs-team--code-sandbox-mcp)

HTML

<a href="/listings/automata-labs-team--code-sandbox-mcp"><img src="/api/listings/automata-labs-team--code-sandbox-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

These steps run a script from the network that findsafeskills does not scan.

Prerequisites

- Docker installed and running - [Install Docker for Linux](https://docs.docker.com/engine/install/) - [Install Docker Desktop for macOS](https://docs.docker.com/desktop/install/mac/) - [Install Docker Desktop for Windows](https://docs.docker.com/desktop/install/windows-install/)

Quick Install

Linux, MacOS

curl -fsSL https://raw.githubusercontent.com/Automata-Labs-team/code-sandbox-mcp/main/install.sh | bash

Windows

# Run in PowerShell
irm https://raw.githubusercontent.com/Automata-Labs-team/code-sandbox-mcp/main/install.ps1 | iex

The installer will: 1. Check for Docker installation 2. Download the appropriate binary for your system 3. Create necessary configuration files

Manual Installation

1. Download the latest release for your platform from the [releases page](https://github.com/Automata-Labs-team/code-sandbox-mcp/releases) 2. Place the binary in a directory in your PATH 3. Make it executable (Unix-like systems only):

   chmod +x code-sandbox-mcp

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 179 lines · 2 findings marked

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Code Sandbox MCP 🐳
  2. [![smithery badge](https://smithery.ai/badge/@Automata-Labs-team/code-sandbox-mcp)](https://smithery.ai/server/@Automata-Labs-team/code-sandbox-mcp)
  3. A secure sandbox environment for executing code within Docker containers. This MCP server provides AI applications with a safe and isolated environment for running code while maintaining security through containerization.
  4. ## 🌟 Features
  5. - **Flexible Container Management**: Create and manage isolated Docker containers for code execution
  6. - **Custom Environment Support**: Use any Docker image as your execution environment
  7. - **File Operations**: Easy file and directory transfer between host and containers
  8. - **Command Execution**: Run any shell commands within the containerized environment
  9. - **Real-time Logging**: Stream container logs and command output in real-time
  10. - **Auto-Updates**: Built-in update checking and automatic binary updates
  11. - **Multi-Platform**: Supports Linux, macOS, and Windows
  12. ## 🚀 Installation
  13. ### Prerequisites
  14. - Docker installed and running
  15. - [Install Docker for Linux](https://docs.docker.com/engine/install/)
  16. - [Install Docker Desktop for macOS](https://docs.docker.com/desktop/install/mac/)
  17. - [Install Docker Desktop for Windows](https://docs.docker.com/desktop/install/windows-install/)
  18. ### Quick Install
  19. #### Linux, MacOS
  20. ```bash
  21. curl -fsSL https://raw.githubusercontent.com/Automata-Labs-team/code-sandbox-mcp/main/install.sh | bash
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 29 on GitHub
  22. ```
  23. #### Windows
  24. ```powershell
  25. # Run in PowerShell
  26. irm https://raw.githubusercontent.com/Automata-Labs-team/code-sandbox-mcp/main/install.ps1 | iex
  27. ```
  28. The installer will:
  29. 1. Check for Docker installation
  30. 2. Download the appropriate binary for your system
  31. 3. Create necessary configuration files
  32. ### Manual Installation
  33. 1. Download the latest release for your platform from the [releases page](https://github.com/Automata-Labs-team/code-sandbox-mcp/releases)
  34. 2. Place the binary in a directory in your PATH
  35. 3. Make it executable (Unix-like systems only):
  36. ```bash
  37. chmod +x code-sandbox-mcp
  38. ```
  39. ## 🛠️ Available Tools
  40. #### `sandbox_initialize`
  41. Initialize a new compute environment for code execution.
  42. Creates a container based on the specified Docker image.
  43. **Parameters:**
  44. - `image` (string, optional): Docker image to use as the base environment
  45. - Default: 'python:3.12-slim-bookworm'
  46. **Returns:**
  47. - `container_id` that can be used with other tools to interact with this environment
  48. #### `copy_project`
  49. Copy a directory to the sandboxed filesystem.
  50. **Parameters:**
  51. - `container_id` (string, required): ID of the container returned from the initialize call
  52. - `local_src_dir` (string, required): Path to a directory in the local file system
  53. - `dest_dir` (string, optional): Path to save the src directory in the sandbox environment
  54. #### `write_file`
  55. Write a file to the sandboxed filesystem.
  56. **Parameters:**
  57. - `container_id` (string, required): ID of the container returned from the initialize call
  58. - `file_name` (string, required): Name of the file to create
  59. - `file_contents` (string, required): Contents to write to the file
  60. - `dest_dir` (string, optional): Directory to create the file in (Default: ${WORKDIR})
  61. #### `sandbox_exec`
  62. Execute commands in the sandboxed environment.
  63. **Parameters:**
  64. - `container_id` (string, required): ID of the container returned from the initialize call
  65. - `commands` (array, required): List of command(s) to run in the sandboxed environment
  66. - Example: ["apt-get update", "pip install numpy", "python script.py"]
  67. #### `copy_file`
  68. Copy a single file to the sandboxed filesystem.
  69. **Parameters:**
  70. - `container_id` (string, required): ID of the container returned from the initialize call
  71. - `local_src_file` (string, required): Path to a file in the local file system
  72. - `dest_path` (string, optional): Path to save the file in the sandbox environment
  73. #### `sandbox_stop`
  74. Stop and remove a running container sandbox.
  75. **Parameters:**
  76. - `container_id` (string, required): ID of the container to stop and remove
  77. **Description:**
  78. Gracefully stops the specified container with a 10-second timeout and removes it along with its volumes.
  79. #### Container Logs Resource
  80. A dynamic resource that provides access to container logs.
  81. **Resource Path:** `containers://{id}/logs`
  82. **MIME Type:** `text/plain`
  83. **Description:** Returns all container logs from the specified container as a single text resource.
  84. ## 🔐 Security Features
  85. - Isolated execution environment using Docker containers
  86. - Resource limitations through Docker container constraints
  87. - Separate stdout and stderr streams
  88. ## 🔧 Configuration
  89. ### Claude Desktop
  90. The installer automatically creates the configuration file. If you need to manually configure it:
  91. #### Linux
  92. ```json
  93. // ~/.config/Claude/claude_desktop_config.json
  94. {
  95. "mcpServers": {
  96. "code-sandbox-mcp": {
  97. "command": "/path/to/code-sandbox-mcp",
  98. "args": [],
  99. "env": {}
  100. }
  101. }
  102. }
  103. ```
  104. #### macOS
  105. ```json
  106. // ~/Library/Application Support/Claude/claude_desktop_config.json
  107. {
  108. "mcpServers": {
  109. "code-sandbox-mcp": {
  110. "command": "/path/to/code-sandbox-mcp",
  111. "args": [],
  112. "env": {}
  113. }
  114. }
  115. }
  116. ```
  117. #### Windows
  118. ```json
  119. // %APPDATA%\Claude\claude_desktop_config.json
  120. {
  121. "mcpServers": {
  122. "code-sandbox-mcp": {
  123. "command": "C:\\path\\to\\code-sandbox-mcp.exe",
  124. "args": [],
  125. "env": {}
  126. }
  127. }
  128. }
  129. ```
  130. ### Other AI Applications
  131. For other AI applications that support MCP servers, configure them to use the `code-sandbox-mcp` binary as their code execution backend.
  132. ## 🛠️ Development
  133. If you want to build the project locally or contribute to its development, see [DEVELOPMENT.md](DEVELOPMENT.md).
  134. ## 📝 License
  135. This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.