Back to Home
vuguzum icon

python-mcp-sandbox

Verified Safe

by vuguzum

Overview

Provides a secure, sandboxed environment for LLMs to validate syntax and safely execute generated Python code.

Installation

Run Command
python -m python_code_sandbox.python_code_sandbox

Security Notes

The server employs a robust multi-layered 'defense in depth' strategy. This includes AST parsing for syntax checks, static analysis to block dangerous functions/modules (e.g., 'eval', 'exec', 'os'), environment sanitization (removing modules from sys.modules, overriding __import__ and open()), and OS-level process isolation (resource.setrlimit on Unix, Job Objects on Windows) with configurable time/memory limits. Output is captured via buffers. While no sandbox is 100% impenetrable, this implementation is highly secure for its intended purpose.

Similar Servers

Stats

Interest Score0
Security Score9
Cost ClassMedium
Avg Tokens400
Stars0
Forks0
Last Update2025-11-20

Tags

Python SandboxLLM IntegrationCode ValidationSecurityMCP Server