About Code Sandbox MCP
Code Sandbox MCP is an MCP server published by lemonlyue in the Developer Tools category: mCP server is used to create a secure code sandbox environment, execute code in Docker containers, and provide code execution capabilities for AI applications. It has been installed 0 times through Conduid.
The repository has 1 stars and 0 forks, with the last commit 9 months ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues (0) before depending on it in production.
Install
npx code-sandbox-mcpThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about Code Sandbox MCP
Powered by Claude · Grounded in docs
Security checks
- ·README presentNot checked yet.
- ·License declaredNot checked yet.
- ·Tests presentNot checked yet.
- ·Dependencies pinnedNot checked yet.
- ·No dynamic code executionNot checked yet.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
README
code-sandbox-mcp
Introduction
The MCP server is used to create a secure code sandbox environment, execute code in Docker containers, and provide code execution capabilities for AI applications.
For Chinese version, see 中文 README.
Features
- Supports code execution in multiple programming languages (Python, PHP, Golang)
- Docker container-based isolated environment to ensure secure code execution
- Provides resource limitations (CPU timeout, memory limit, disk limit)
- Provides real-time interaction capabilities through SSE (Server-Sent Events)
- Easy-to-use tool interface for easy integration into AI applications
Quick Start
Prerequisites
- Go 1.25.1 or higher
- Docker environment
Initialization
Pull the required programming language Docker images:
make init-images
Build
Compile the project to the bin directory based on the target platform:
- Linux (amd64 architecture):
make build-linux
- macOS (Apple Silicon chips, arm64 architecture):
make build-darwin
- Windows (amd64 architecture):
make build-windows
Run
Start the MCP server:
./bin/code-sandbox-mcp-server
The server will start on port 4000, providing the following endpoints:
- SSE endpoint:
/sse - Message endpoint:
/message
Code Execution Tool
The server registers a tool named execute_code_in_sandbox for executing code in a sandbox environment.
Tool Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| language | string | Yes | Programming language |
| code | string | Yes | The code to be executed |
| version | string | No | Programming language version |
Usage Example
Call the tool to execute Python code:
{
"tool": "execute_code_in_sandbox",
"parameters": {
"language": "python",
"code": "print('Hello, World!')"
}
}
Project Structure
cmd/code-sandbox-mcp/main.go: Server main entry pointsandbox/: Sandbox core functionality implementationsandbox/docker/: Docker sandbox implementationtempfile/: Temporary file management (provides temporary file writing functionality, such asWriteFilemethod)go.mod/go.sum: Go dependency managementMakefile: Build scripts
Configuration Management
The project implements configuration management through sandbox/config.go, supporting:
- Loading YAML format configuration files (default paths include
./config.yamland./config/config.yaml) - Monitoring configuration file changes and automatic reloading
- Configuration items include server information, runtime resource limits (CPU timeout, memory, disk), network settings, language-specific configurations (suffix, image, entrypoint, etc.)
Cleanup
Clean up compiled files:
make clean
Dependencies
Main dependencies include:
- Docker SDK for Go: For interacting with Docker
- trpc-mcp-go: Provides MCP server framework (version v0.0.7)
- viper: Configuration management
- fsnotify: File system notifications (for configuration file monitoring)
- golang.org/x/sys: System-related operation support
- golang.org/x/net: Network-related function support
See go.mod and go.sum files for the complete list of dependencies.
README mirrored from the source repository 4 months ago. The original is authoritative.