{"id":29154739,"url":"https://github.com/Automata-Labs-Team/code-sandbox-mcp","last_synced_at":"2025-07-01T02:35:01.378Z","repository":{"id":274281725,"uuid":"922445184","full_name":"Automata-Labs-team/code-sandbox-mcp","owner":"Automata-Labs-team","description":"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.","archived":false,"fork":false,"pushed_at":"2025-03-23T12:15:50.000Z","size":118,"stargazers_count":106,"open_issues_count":7,"forks_count":15,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T09:53:10.380Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Automata-Labs-team.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-26T08:18:21.000Z","updated_at":"2025-04-09T00:21:30.000Z","dependencies_parsed_at":"2025-03-23T11:35:13.328Z","dependency_job_id":null,"html_url":"https://github.com/Automata-Labs-team/code-sandbox-mcp","commit_stats":null,"previous_names":["automata-labs-team/code-sandbox-mcp"],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/Automata-Labs-team/code-sandbox-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Automata-Labs-team%2Fcode-sandbox-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Automata-Labs-team%2Fcode-sandbox-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Automata-Labs-team%2Fcode-sandbox-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Automata-Labs-team%2Fcode-sandbox-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Automata-Labs-team","download_url":"https://codeload.github.com/Automata-Labs-team/code-sandbox-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Automata-Labs-team%2Fcode-sandbox-mcp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262884230,"owners_count":23379356,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-01T02:34:15.996Z","updated_at":"2025-07-01T02:35:01.359Z","avatar_url":"https://github.com/Automata-Labs-team.png","language":"Go","funding_links":[],"categories":["Code Execution \u0026 Automation MCP Servers"],"sub_categories":[],"readme":"# Code Sandbox MCP 🐳\n[![smithery badge](https://smithery.ai/badge/@Automata-Labs-team/code-sandbox-mcp)](https://smithery.ai/server/@Automata-Labs-team/code-sandbox-mcp)\n\nA 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.\n\n## 🌟 Features\n\n- **Flexible Container Management**: Create and manage isolated Docker containers for code execution\n- **Custom Environment Support**: Use any Docker image as your execution environment\n- **File Operations**: Easy file and directory transfer between host and containers\n- **Command Execution**: Run any shell commands within the containerized environment\n- **Real-time Logging**: Stream container logs and command output in real-time\n- **Auto-Updates**: Built-in update checking and automatic binary updates\n- **Multi-Platform**: Supports Linux, macOS, and Windows\n\n## 🚀 Installation\n\n### Prerequisites\n\n- Docker installed and running\n  - [Install Docker for Linux](https://docs.docker.com/engine/install/)\n  - [Install Docker Desktop for macOS](https://docs.docker.com/desktop/install/mac/)\n  - [Install Docker Desktop for Windows](https://docs.docker.com/desktop/install/windows-install/)\n\n### Quick Install\n\n#### Linux, MacOS\n```bash\ncurl -fsSL https://raw.githubusercontent.com/Automata-Labs-team/code-sandbox-mcp/main/install.sh | bash\n```\n\n#### Windows\n```powershell\n# Run in PowerShell\nirm https://raw.githubusercontent.com/Automata-Labs-team/code-sandbox-mcp/main/install.ps1 | iex\n```\n\nThe installer will:\n1. Check for Docker installation\n2. Download the appropriate binary for your system\n3. Create necessary configuration files\n\n### Manual Installation\n\n1. Download the latest release for your platform from the [releases page](https://github.com/Automata-Labs-team/code-sandbox-mcp/releases)\n2. Place the binary in a directory in your PATH\n3. Make it executable (Unix-like systems only):\n   ```bash\n   chmod +x code-sandbox-mcp\n   ```\n\n## 🛠️ Available Tools\n\n#### `sandbox_initialize`\nInitialize a new compute environment for code execution.\nCreates a container based on the specified Docker image.\n\n**Parameters:**\n- `image` (string, optional): Docker image to use as the base environment\n  - Default: 'python:3.12-slim-bookworm'\n\n**Returns:**\n- `container_id` that can be used with other tools to interact with this environment\n\n#### `copy_project`\nCopy a directory to the sandboxed filesystem.\n\n**Parameters:**\n- `container_id` (string, required): ID of the container returned from the initialize call\n- `local_src_dir` (string, required): Path to a directory in the local file system\n- `dest_dir` (string, optional): Path to save the src directory in the sandbox environment\n\n#### `write_file`\nWrite a file to the sandboxed filesystem.\n\n**Parameters:**\n- `container_id` (string, required): ID of the container returned from the initialize call\n- `file_name` (string, required): Name of the file to create\n- `file_contents` (string, required): Contents to write to the file\n- `dest_dir` (string, optional): Directory to create the file in (Default: ${WORKDIR})\n\n#### `sandbox_exec`\nExecute commands in the sandboxed environment.\n\n**Parameters:**\n- `container_id` (string, required): ID of the container returned from the initialize call\n- `commands` (array, required): List of command(s) to run in the sandboxed environment\n  - Example: [\"apt-get update\", \"pip install numpy\", \"python script.py\"]\n\n#### `copy_file`\nCopy a single file to the sandboxed filesystem.\n\n**Parameters:**\n- `container_id` (string, required): ID of the container returned from the initialize call\n- `local_src_file` (string, required): Path to a file in the local file system\n- `dest_path` (string, optional): Path to save the file in the sandbox environment\n\n#### `sandbox_stop`\nStop and remove a running container sandbox.\n\n**Parameters:**\n- `container_id` (string, required): ID of the container to stop and remove\n\n**Description:**\nGracefully stops the specified container with a 10-second timeout and removes it along with its volumes.\n\n#### Container Logs Resource\nA dynamic resource that provides access to container logs.\n\n**Resource Path:** `containers://{id}/logs`  \n**MIME Type:** `text/plain`  \n**Description:** Returns all container logs from the specified container as a single text resource.\n\n## 🔐 Security Features\n\n- Isolated execution environment using Docker containers\n- Resource limitations through Docker container constraints\n- Separate stdout and stderr streams\n\n\n## 🔧 Configuration\n\n### Claude Desktop\n\nThe installer automatically creates the configuration file. If you need to manually configure it:\n\n#### Linux\n```json\n// ~/.config/Claude/claude_desktop_config.json\n{\n    \"mcpServers\": {\n        \"code-sandbox-mcp\": {\n            \"command\": \"/path/to/code-sandbox-mcp\",\n            \"args\": [],\n            \"env\": {}\n        }\n    }\n}\n```\n\n#### macOS\n```json\n// ~/Library/Application Support/Claude/claude_desktop_config.json\n{\n    \"mcpServers\": {\n        \"code-sandbox-mcp\": {\n            \"command\": \"/path/to/code-sandbox-mcp\",\n            \"args\": [],\n            \"env\": {}\n        }\n    }\n}\n```\n\n#### Windows\n```json\n// %APPDATA%\\Claude\\claude_desktop_config.json\n{\n    \"mcpServers\": {\n        \"code-sandbox-mcp\": {\n            \"command\": \"C:\\\\path\\\\to\\\\code-sandbox-mcp.exe\",\n            \"args\": [],\n            \"env\": {}\n        }\n    }\n}\n```\n\n### Other AI Applications\n\nFor other AI applications that support MCP servers, configure them to use the `code-sandbox-mcp` binary as their code execution backend.\n\n## 🛠️ Development\n\nIf you want to build the project locally or contribute to its development, see [DEVELOPMENT.md](DEVELOPMENT.md).\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAutomata-Labs-Team%2Fcode-sandbox-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAutomata-Labs-Team%2Fcode-sandbox-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAutomata-Labs-Team%2Fcode-sandbox-mcp/lists"}