LLM Sandbox MCP
LLM Sandbox is a lightweight, portable Python library that securely executes LLM-generated code in isolated containers or local sandboxes. It supports multiple backends including Docker, Kubernetes, Podman, Bubblewrap, and NsJail, and provides a Model Context Protocol (MCP) server for AI assistants like Claude Desktop to run code safely with customizable security policies and resource limits.
Package and access
Local package with source-attributed installation metadata. Koskamo does not execute packages during review.
What you can do with it
- Execute untrusted LLM-generated code in isolated containers
- Run Python, JavaScript, Java, C++, Go, and R code safely
- Integrate with LangChain, LangGraph, and LlamaIndex
- Allow AI assistants to execute code via MCP protocol
Source and maintenance
- Maintenance checked
Packages and installation
Source-provided package data. Koskamo has not executed or live-probed this package.
llm-sandbox 0.3.43
{
"version": "0.3.43",
"transport": "stdio",
"identifier": "llm-sandbox",
"runtimeHint": "uvx",
"registryType": "pypi",
"registryBaseUrl": "https://pypi.org",
"runtimeArguments": [
{
"name": "--from",
"type": "named",
"value": "llm-sandbox[mcp-docker]",
"isRequired": true,
"description": "Install the MCP server extra. The base llm-sandbox package intentionally ships no container or MCP dependencies, so the extra is required for the server to start."
}
],
"environmentVariables": [
{
"name": "BACKEND",
"choices": [
"docker",
"podman",
"kubernetes"
],
"default": "docker",
"description": "Container backend to use. Must match the installed extra: mcp-docker, mcp-podman, or mcp-k8s."
},
{
"name": "DOCKER_HOST",
"description": "Docker or Podman socket URL, e.g. unix:///var/run/docker.sock"
},
{
"name": "KUBECONFIG",
"description": "Path to kubeconfig file when BACKEND=kubernetes."
},
{
"name": "NAMESPACE",
"default": "default",
"description": "Kubernetes namespace used for sandbox pods when BACKEND=kubernetes."
},
{
"name": "COMMIT_CONTAINER",
"default": "true",
"description": "Commit the container after a run so installed libraries persist between sessions."
},
{
"name": "KEEP_TEMPLATE",
"default": "true",
"description": "Keep the base image after the session ends to avoid re-pulling it on the next run."
},
{
"name": "SANDBOX_NETWORK_MODE",
"description": "Network mode for the sandbox container. Set to 'none' for hardened isolation. Docker and Podman backends only."
},
{
"name": "SANDBOX_READ_ONLY",
"description": "Mount the sandbox root filesystem read-only. Recommended: true. Docker and Podman backends only."
},
{
"name": "SANDBOX_CAP_DROP",
"description": "Comma-separated Linux capabilities to drop. Recommended: ALL. Docker and Podman backends only."
},
{
"name": "SANDBOX_SECURITY_OPT",
"description": "Comma-separated container security options, e.g. no-new-privileges. Docker and Podman backends only."
},
{
"name": "SANDBOX_MEMORY",
"description": "Memory limit for the sandbox container, e.g. 4g. Docker and Podman backends only."
},
{
"name": "SANDBOX_CPUS",
"description": "Fractional CPU allocation for the sandbox container, e.g. 1.5. Docker and Podman backends only."
}
]
}Tools
Reported by the attributed source; not independently observed by Koskamo.
Connect from your client
Each snippet configures the same source-provided package; replace placeholders before use.
Cursor
{
"mcpServers": {
"llm-sandbox-mcp": {
"command": "uvx",
"args": [
"llm-sandbox==0.3.43"
],
"env": {
"BACKEND": "<YOUR_BACKEND>",
"DOCKER_HOST": "<YOUR_DOCKER_HOST>",
"KUBECONFIG": "<YOUR_KUBECONFIG>",
"NAMESPACE": "<YOUR_NAMESPACE>",
"COMMIT_CONTAINER": "<YOUR_COMMIT_CONTAINER>",
"KEEP_TEMPLATE": "<YOUR_KEEP_TEMPLATE>",
"SANDBOX_NETWORK_MODE": "<YOUR_SANDBOX_NETWORK_MODE>",
"SANDBOX_READ_ONLY": "<YOUR_SANDBOX_READ_ONLY>",
"SANDBOX_CAP_DROP": "<YOUR_SANDBOX_CAP_DROP>",
"SANDBOX_SECURITY_OPT": "<YOUR_SANDBOX_SECURITY_OPT>",
"SANDBOX_MEMORY": "<YOUR_SANDBOX_MEMORY>",
"SANDBOX_CPUS": "<YOUR_SANDBOX_CPUS>"
}
}
}
}Cline
{
"mcpServers": {
"llm-sandbox-mcp": {
"command": "uvx",
"args": [
"llm-sandbox==0.3.43"
],
"env": {
"BACKEND": "<YOUR_BACKEND>",
"DOCKER_HOST": "<YOUR_DOCKER_HOST>",
"KUBECONFIG": "<YOUR_KUBECONFIG>",
"NAMESPACE": "<YOUR_NAMESPACE>",
"COMMIT_CONTAINER": "<YOUR_COMMIT_CONTAINER>",
"KEEP_TEMPLATE": "<YOUR_KEEP_TEMPLATE>",
"SANDBOX_NETWORK_MODE": "<YOUR_SANDBOX_NETWORK_MODE>",
"SANDBOX_READ_ONLY": "<YOUR_SANDBOX_READ_ONLY>",
"SANDBOX_CAP_DROP": "<YOUR_SANDBOX_CAP_DROP>",
"SANDBOX_SECURITY_OPT": "<YOUR_SANDBOX_SECURITY_OPT>",
"SANDBOX_MEMORY": "<YOUR_SANDBOX_MEMORY>",
"SANDBOX_CPUS": "<YOUR_SANDBOX_CPUS>"
}
}
}
}VS Code
{
"servers": {
"llm-sandbox-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"llm-sandbox==0.3.43"
],
"env": {
"BACKEND": "<YOUR_BACKEND>",
"DOCKER_HOST": "<YOUR_DOCKER_HOST>",
"KUBECONFIG": "<YOUR_KUBECONFIG>",
"NAMESPACE": "<YOUR_NAMESPACE>",
"COMMIT_CONTAINER": "<YOUR_COMMIT_CONTAINER>",
"KEEP_TEMPLATE": "<YOUR_KEEP_TEMPLATE>",
"SANDBOX_NETWORK_MODE": "<YOUR_SANDBOX_NETWORK_MODE>",
"SANDBOX_READ_ONLY": "<YOUR_SANDBOX_READ_ONLY>",
"SANDBOX_CAP_DROP": "<YOUR_SANDBOX_CAP_DROP>",
"SANDBOX_SECURITY_OPT": "<YOUR_SANDBOX_SECURITY_OPT>",
"SANDBOX_MEMORY": "<YOUR_SANDBOX_MEMORY>",
"SANDBOX_CPUS": "<YOUR_SANDBOX_CPUS>"
}
}
}
}Claude Desktop
{
"mcpServers": {
"llm-sandbox-mcp": {
"command": "uvx",
"args": [
"llm-sandbox==0.3.43"
],
"env": {
"BACKEND": "<YOUR_BACKEND>",
"DOCKER_HOST": "<YOUR_DOCKER_HOST>",
"KUBECONFIG": "<YOUR_KUBECONFIG>",
"NAMESPACE": "<YOUR_NAMESPACE>",
"COMMIT_CONTAINER": "<YOUR_COMMIT_CONTAINER>",
"KEEP_TEMPLATE": "<YOUR_KEEP_TEMPLATE>",
"SANDBOX_NETWORK_MODE": "<YOUR_SANDBOX_NETWORK_MODE>",
"SANDBOX_READ_ONLY": "<YOUR_SANDBOX_READ_ONLY>",
"SANDBOX_CAP_DROP": "<YOUR_SANDBOX_CAP_DROP>",
"SANDBOX_SECURITY_OPT": "<YOUR_SANDBOX_SECURITY_OPT>",
"SANDBOX_MEMORY": "<YOUR_SANDBOX_MEMORY>",
"SANDBOX_CPUS": "<YOUR_SANDBOX_CPUS>"
}
}
}
}Let your agent find its tools
Find servers like LLM Sandbox MCP from your agent. Add Koskamo once to search the index for endpoints, access requirements, and client setup. Public discovery needs no key.