MCP Multi-Language Sandbox MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/Pit-CL/mcp-multilang-sandbox.git
cd mcp-multilang-sandbox
npm install
npm run build
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add mcp-multilang-sandbox -- node "<FULL_PATH_TO_MCP_MULTILANG_SANDBOX>/dist/index.js"

Replace <FULL_PATH_TO_MCP_MULTILANG_SANDBOX>/dist/index.js with the actual folder you prepared in step 1.

README.md

Execute code securely in 6 programming languages with Docker isolation

MCP Multi-Language Sandbox

Execute code securely in 6 programming languages with Docker isolation, designed for Claude Code via Model Context Protocol (MCP).

What is this?

A local MCP server that lets Claude execute code in isolated Docker containers. Think of it as your own private code sandbox - 100% free, 100% local, no cloud dependencies.

Why use this instead of cloud sandboxes?

  • Free: No per-execution costs (vs ~$0.10/run on cloud services)
  • Fast: 0ms container acquisition with pooling (vs 2-5s cold starts)
  • Private: Code never leaves your machine
  • Customizable: Add your own languages, packages, security rules

Features

  • 6 Languages: Python, TypeScript, JavaScript, Go, Rust, Bash
  • Container Pooling: Pre-warmed containers for instant execution
  • Package Caching: Install once, reuse forever (SHA256-based)
  • ML Runtime: numpy, pandas, sklearn, torch, mlx pre-installed
  • Security: Seccomp profiles, capability dropping, audit logging
  • Sessions: Persistent state with TTL and auto-cleanup

Quick Start

Prerequisites

Installation

# Clone the repository
git clone https://github.com/Pit-CL/mcp-multilang-sandbox.git
cd mcp-multilang-sandbox

# Install dependencies
npm install

# Build
npm run build

# Run tests (optional)
npm run test:mcp

Add to Claude Code

# Add as MCP server
claude mcp add multilang-sandbox node /path/to/mcp-multilang-sandbox/dist/mcp/server.js

# Verify it's connected
claude mcp list
# Should show: multilang-sandbox ✓ Connected

Manual Configuration

Add to your Claude settings (~/.claude.json or VS Code settings):

{
  "mcpServers": {
    "multilang-sandbox": {
      "command": "node",
      "args": ["/path/to/mcp-multilang-sandbox/dist/mcp/server.js"],
      "env": {
        "LOG_LEVEL": "info"
      }
    }
  }
}

Usage

Once configured, Claude can use these tools:

Execute Code

// Python
sandbox_execute({ language: 'python', code: 'print("Hello!")' })

// TypeScript
sandbox_execute({ language: 'typescript', code: 'console.log("Hello!")' })

// With ML libraries (numpy, pandas, sklearn, torch)
sandbox_execute({
  language: 'python',
  code: 'import numpy as np; print(np.array([1,2,3]))',
  ml: true
})

Persistent Sessions

// Create a session
sandbox_session({ action: 'create', name: 'my-project', language: 'python' })

// Execute in session (state persists)
sandbox_execute({ language: 'python', code: 'x = 42', session: 'my-project' })
sandbox_execute({ language: 'python', code: 'print(x)', session: 'my-project' })  // prints 42

// Install packages
sandbox_install({ session: 'my-project', packages: ['pandas', 'requests'] })

// Cleanup
sandbox_session({ action: 'destroy', name: 'my-project' })

File Operations

// Write a file
sandbox_file_ops({ session: 'my-project', operation: 'write', path: 'data.csv', content: 'a,b\n1,2' })

// Read it back
sandbox_file_ops({ session: 'my-project', operation: 'read', path: 'data.csv' })

System Stats

// View pool, cache, and session stats
sandbox_inspect({ target: 'all' })

// Security audit
sandbox_security({ action: 'stats' })

MCP Tools Reference

Tool Description
sandbox_execute Execute code in any supported language
sandbox_session Create/list/pause/resume/destroy sessions
sandbox_install Install packages with caching
sandbox_file_ops Read/write/list/delete files in sessions
sandbox_inspect View system stats (pool, cache, sessions)
sandbox_security View audit logs and security events

Architecture

┌─────────────────────────────────────────────────────────┐
│                    Claude / MCP Client                   │
└───────────────────────────┬─────────────────────────────┘
                            │ JSON-RPC (stdio)
┌───────────────────────────▼─────────────────────────────┐
│                    MCP Sandbox Server                    │
│  ┌────────────────────────────────────────────────────┐ │
│  │  Tools: execute | session | install | file_ops     │ │
│  │         inspect | security                          │ │
│  ├────────────────────────────────────────────────────┤ │
│  │  Core: ContainerPo

Tools (6)

sandbox_executeExecute code in any supported language
sandbox_sessionCreate/list/pause/resume/destroy sessions
sandbox_installInstall packages with caching
sandbox_file_opsRead/write/list/delete files in sessions
sandbox_inspectView system stats (pool, cache, sessions)
sandbox_securityView audit logs and security events

Environment Variables

LOG_LEVELSets the logging verbosity (e.g., info, debug)

Configuration

claude_desktop_config.json
{"mcpServers": {"multilang-sandbox": {"command": "node", "args": ["/path/to/mcp-multilang-sandbox/dist/mcp/server.js"], "env": {"LOG_LEVEL": "info"}}}}

Try it

Execute a Python script to calculate the first 50 Fibonacci numbers.
Create a new session named 'data-analysis' and install the pandas library.
Write a TypeScript snippet to a file named 'test.ts' inside the 'data-analysis' session.
Run a security audit to check the current status of the sandbox containers.
Execute a Rust program that prints 'Hello from Rust' within a persistent session.

Frequently Asked Questions

What are the key features of MCP Multi-Language Sandbox?

Supports 6 programming languages: Python, TypeScript, JavaScript, Go, Rust, and Bash. Pre-warmed container pooling for instant code execution. Persistent sessions with TTL and auto-cleanup. Built-in support for ML libraries like numpy, pandas, sklearn, and torch. Enhanced security with Seccomp profiles and audit logging.

What can I use MCP Multi-Language Sandbox for?

Running data analysis scripts locally without polluting the host environment. Testing code snippets in multiple languages during AI-assisted development. Installing and experimenting with Python packages in isolated environments. Performing secure file operations within a controlled sandbox container.

How do I install MCP Multi-Language Sandbox?

Install MCP Multi-Language Sandbox by running: git clone https://github.com/Pit-CL/mcp-multilang-sandbox.git && cd mcp-multilang-sandbox && npm install && npm run build

What MCP clients work with MCP Multi-Language Sandbox?

MCP Multi-Language Sandbox works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep MCP Multi-Language Sandbox docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare