Labsco
MCP SERVER

MCP Code Sandbox Server

by chrishayuk

Give an agent a throwaway sandbox to run Python in, then close it when the work is done.

Sandboxed Code Execution
Summary
Code that runs somewhere other than your laptop.

The sandbox is created for the task and closed after it, so an agent can install a package and run code it just wrote without any of it touching your filesystem.

What it is

A Python MCP server that hands out isolated sandbox environments for code execution, backed by E2B behind an abstract interpreter interface so another backend can be swapped in. Five tools create a sandbox, run code in it, install packages, report its status and shut it down.

What you get
  • An isolated sandbox created on demand
  • Python executed inside that sandbox
  • Packages installed into the sandbox before the code that needs them runs
  • The current status of a sandbox you created
  • The sandbox closed when the task is finished
Requirements

Python 3.10 or higher, plus fastmcp, python-dotenv and e2b-code-interpreter. An E2B key in the environment covers the default backend, and a second environment variable selects which backend is used, defaulting to e2b. Code runs on E2B's infrastructure, not on your machine.