Back to Home
elusznik icon

mcp-server-code-execution-mode

Verified Safe

by elusznik

Overview

This server enables LLM agents to execute Python code in a highly secure, isolated container environment, facilitating complex multi-tool orchestration and data analysis with minimal LLM context token usage.

Installation

Run Command
uvx --from git+https://github.com/elusznik/mcp-server-code-execution-mode mcp-server-code-execution-mode run

Environment Variables

  • MCP_BRIDGE_RUNTIME
  • MCP_BRIDGE_IMAGE
  • MCP_BRIDGE_TIMEOUT
  • MCP_BRIDGE_MAX_TIMEOUT
  • MCP_BRIDGE_MEMORY
  • MCP_BRIDGE_PIDS
  • MCP_BRIDGE_CPUS
  • MCP_BRIDGE_CONTAINER_USER
  • MCP_BRIDGE_RUNTIME_IDLE_TIMEOUT
  • MCP_BRIDGE_STATE_DIR
  • MCP_BRIDGE_OUTPUT_MODE
  • MCP_BRIDGE_LOG_LEVEL
  • MCP_SERVERS_CONFIG
  • MCP_BRIDGE_ALLOW_SELF_SERVER

Security Notes

The server executes user-provided Python code using `eval(compile(code, ...), ...)` within a highly restricted, rootless container sandbox. This sandbox enforces strict isolation: no network, read-only rootfs, all capabilities dropped, no new privileges, unprivileged user (65534:65534), and resource limits (memory, PIDs, CPU, timeout). All MCP traffic is mediated by the host, providing an audit trail and preventing direct access to the host or external networks. While `eval` is used, it is the core function of the isolated sandbox, not a direct vulnerability in this hardened setup. The project's history explicitly details lessons from failed insecure prototypes, indicating a strong architectural commitment to security.

Similar Servers

Stats

Interest Score95
Security Score8
Cost ClassLow
Avg Tokens200
Stars258
Forks21
Last Update2025-12-05

Tags

LLM AgentsCode ExecutionContainerizationSecurity SandboxMCP BridgingData Science