Llm MCP Server

LLM Sandbox is a lightweight and portable sandbox environment designed to run large language model (LLM) generated code in a safe and isolated mode.

Local serverstdioPython

What is the Llm MCP Server?

LLM Sandbox is a lightweight and portable sandbox environment designed to run large language model (LLM) generated code in a safe and isolated mode.

What it actually does

✨ New: This project now supports the Model Context Protocol (MCP) server, which allows your MCP clients (e.g. Claude Desktop) to run code generated by LLMs in a secure sandbox environment.

  • Secure Code Execution — Execute code in isolated containers with your preferred backend
  • Multi-Language Support — Run Python, JavaScript, Java, C++, Go, R, and Ruby code
  • Automatic Visualization Capture — Automatically capture and return plots and visualizations
  • Library Management — Install packages and dependencies on-the-fly
  • Flexible Backend Support — Choose from Docker, Podman, or Kubernetes backends

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

How to install the Llm MCP Server

{
  "mcpServers": {
    "llm-sandbox": {
      "command": "python3",
      "args": [
        "-m",
        "llm_sandbox.mcp_server.server"
      ],
      "env": {
        "BACKEND": "podman",
        "DOCKER_HOST": "unix:///run/podman/podman.sock",
        "SANDBOX_NETWORK_MODE": "none",
        "SANDBOX_READ_ONLY": "true",
        "SANDBOX_CAP_DROP": "ALL",
        "SANDBOX_SECURITY_OPT": "no-new-privileges:true",
        "SANDBOX_MEMORY": "4g",
        "SANDBOX_CPU_COUNT": "1"
      }
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Configuration

VariableDescriptionRequired
BACKENDDeclared in the maintainer’s client configuration.Check documentation
DOCKER_HOSTDeclared in the maintainer’s client configuration.Check documentation
SANDBOX_NETWORK_MODEDeclared in the maintainer’s client configuration.Check documentation
SANDBOX_READ_ONLYDeclared in the maintainer’s client configuration.Check documentation
SANDBOX_CAP_DROPDeclared in the maintainer’s client configuration.Check documentation
SANDBOX_SECURITY_OPTDeclared in the maintainer’s client configuration.Check documentation
SANDBOX_MEMORYDeclared in the maintainer’s client configuration.Check documentation
SANDBOX_CPU_COUNTDeclared in the maintainer’s client configuration.Check documentation

Example prompts to try

  • “Use Llm to JavaScript.”
  • “Use Llm to Java.”
  • “Use Llm to Examples.”

Frequently asked questions

LLM Sandbox is a lightweight and portable sandbox environment designed to run large language model (LLM) generated code in a safe and isolated mode. Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.