Skip to content
Back to search

sandbox-mcp

A Model Context Protocol (MCP) server that enables LLMs to run ANY code safely in isolated Docker containers.

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/pottekkat--sandbox-mcp/badge.svg)](/listings/pottekkat--sandbox-mcp)

HTML

<a href="/listings/pottekkat--sandbox-mcp"><img src="/api/listings/pottekkat--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.

Download Binary

You can download the appropriate binary for your operating system (for example, `Darwin`) and processor architecture (`arm64`) from the [Releases page](https://github.com/pottekkat/sandbox-mcp/releases) (`sandbox-mcp_Darwin_arm64.tar.gz`).

Install via Go

Prerequisites:

- Go 1.24 or higher

go install github.com/pottekkat/sandbox-mcp/cmd/sandbox-mcp@latest

Get the path to the `sandbox-mcp` binary:

which sandbox-mcp

Build from Source

See the [Development section](#development).

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 · 163 lines

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

  1. ![Sandbox MCP Logo](readme-banner.png)
  2. ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/pottekkat/sandbox-mcp/release.yaml)
  3. ![GitHub Release](https://img.shields.io/github/v/release/pottekkat/sandbox-mcp)
  4. ![GitHub commits since latest release](https://img.shields.io/github/commits-since/pottekkat/sandbox-mcp/latest)
  5. ![GitHub License](https://img.shields.io/github/license/pottekkat/sandbox-mcp)
  6. **Sandbox MCP** is a Model Context Protocol (MCP) server that enables LLMs (MCP hosts/clients) to **run code in secure, isolated Docker containers**.
  7. While LLMs are really good at generating code, most **can't run the code they generate**. You end up running this untested code directly on your machine, which could have drastic unintended consequences.
  8. Giving LLMs the tools to test the code safely prevents such issues and helps you **generate more accurate code in fewer iterations**.
  9. Sandbox MCP gives the LLMs an **easy-to-use execution environment that anyone can create and configure** through a simple, AI-native MCP server that runs locally.
  10. _Inspired by [Codapi](https://codapi.org). Some sandboxes are the same as [Codapi sandboxes](https://github.com/nalgeon/sandboxes)._
  11. ## Use Cases
  12. Sandbox MCP can be used for many different tasks, including but not limited to:
  13. - **Secure code execution**: Run any code generated by an LLM in a secure, isolated environment, protecting your system from untrusted or potentially harmful code.
  14. - **Code testing**: Automatically test and validate code in various languages and or configurations in various environments before integrating it into larger projects or production systems.
  15. - **User code validation**: Safely execute and check user-submitted code or scripts, ensuring they behave as expected and do not perform malicious actions.
  16. - **Network troubleshooting**: Diagnose connectivity issues, test endpoints, and analyze network performance using isolated network tools, all without exposing your system.
  17. - **Educational and interview coding**: Instantly compile and run code snippets for learning, teaching, or technical interviews, providing immediate feedback in a safe, temporary environment.
  18. - **Automated code review and feedback**: Enable LLMs to execute, test, and review code automatically, offering actionable feedback or suggestions before code is merged or deployed.
  19. ## Demo
  20. This demo shows how Sandbox MCP works with Claude Desktop.
  21. ![Sandbox MCP demo GIF](demo.gif)
  22. Try the [video](demo.mp4) if the GIF isn't clear.
  23. ## Installation
  24. ### Download Binary
  25. You can download the appropriate binary for your operating system (for example, `Darwin`) and processor architecture (`arm64`) from the [Releases page](https://github.com/pottekkat/sandbox-mcp/releases) (`sandbox-mcp_Darwin_arm64.tar.gz`).
  26. ### Install via Go
  27. Prerequisites:
  28. - Go 1.24 or higher
  29. ```bash
  30. go install github.com/pottekkat/sandbox-mcp/cmd/sandbox-mcp@latest
  31. ```
  32. Get the path to the `sandbox-mcp` binary:
  33. ```bash
  34. which sandbox-mcp
  35. ```
  36. ### Build from Source
  37. See the [Development section](#development).
  38. ## Usage
  39. ### Initilization
  40. Before you use `sandbox-mcp` with LLMs, you need to initialize its configuration:
  41. ```bash
  42. # Create the configuration directory in
  43. # $XDG_CONFIG_HOME/sandbox-mcp and pull
  44. # the default sandboxes from GitHub
  45. sandbox-mcp --pull
  46. # Build the Docker images for the sandboxes
  47. sandbox-mcp --build
  48. ```
  49. > [!NOTE]
  50. > Make sure you have Docker installed and running.
  51. ### With MCP Hosts/Clients
  52. Add this to your `claude_desktop_config.json` for Claude Desktop or `mcp.json` for Cursor IDE:
  53. ```json
  54. {
  55. "mcpServers": {
  56. "sandbox-mcp": {
  57. "command": "path/to/sandbox-mcp",
  58. "args": [
  59. "--stdio"
  60. ]
  61. }
  62. }
  63. }
  64. ```
  65. > [!NOTE]
  66. > Make sure to replace `path/to/sandbox-mcp` with the actual path to the `sandbox-mcp` binary.
  67. ## Available Sandboxes
  68. | Sandbox | Description |
  69. |---------|-------------|
  70. | [shell](/sandboxes/shell) | A secure, isolated Linux environment for running lightweight commands that does not require network access. |
  71. | [python](/sandboxes/python) | Safely execute Python code in a secure, isolated environment. |
  72. | [rust](/sandboxes/rust) | Compile and run Rust code in an isolated environment. |
  73. | [network-tools](/sandboxes/network-tools) | Use various network utilities in an isolated Linux sandbox. Perfect for network diagnostics and troubleshooting. See https://github.com/jonlabelle/docker-network-tools for a list of available tools. |
  74. | [go](/sandboxes/go) | Run Go code securely in an isolated environment with network access. |
  75. | [javascript](/sandboxes/javascript) | Run JavaScript code in an isolated environment using Node.js. |
  76. | [apisix](/sandboxes/apisix) | Run a lightweight instance of Apache APISIX, which can be configured through a YAML file and can be interacted through the curl command provided in the main.sh file. For example, curl -sI `http://127.0.0.1:9080/ip`. |
  77. | [java](/sandboxes/java) | Compile and run Java code in an isolated sandbox. Supports Java preview features. |
  78. > [!IMPORTANT]
  79. > ### Your Own Sandbox
  80. >
  81. > You can create and add your own sandboxes in `$XDG_CONFIG_HOME/sandbox-mcp/sandboxes`. A sandbox is essentially a Dockerfile and a JSON configuration. Check out the [examples and the guide](/sandboxes) to learn more.
  82. ## Development
  83. Fork and clone the repository:
  84. ```bash
  85. git clone https://github.com/username/sandbox-mcp.git
  86. ```
  87. Change into the directory:
  88. ```bash
  89. cd sandbox-mcp
  90. ```
  91. Install dependencies:
  92. ```bash
  93. make deps
  94. ```
  95. Build the project:
  96. ```bash
  97. make build
  98. ```
  99. Update your MCP servers configuration to point to the local build:
  100. ```json
  101. {
  102. "mcpServers": {
  103. "sandbox-mcp": {
  104. "command": "/path/to/sandbox-mcp/dist/sandbox-mcp",
  105. "args": [
  106. "--stdio"
  107. ]
  108. }
  109. }
  110. }
  111. ```
  112. ## License
  113. [MIT License](LICENSE)

Ratings and comments

Sign in to rate this skill.

Sign in

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