mcp_safe_local_python_executor

mcp_safe_local_python_executor

3.4

If you are the rightful owner of mcp_safe_local_python_executor and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

Safe Local Python Executor is an MCP server that wraps Hugging Face's LocalPythonExecutor to provide a secure environment for executing Python code generated by LLMs.

Safe Local Python Executor is a Model Context Protocol (MCP) server designed to securely execute Python code generated by Language Learning Models (LLMs) without the need for Docker or virtual machines. It leverages Hugging Face's LocalPythonExecutor from the smolagents framework to provide a custom Python runtime with basic isolation and security features. This server is particularly useful for applications like Claude Desktop, where it can serve as a code interpreter tool. The server restricts file I/O operations and limits the list of allowed imports to enhance security. It is executed using 'uv' in a Python virtual environment, ensuring a safer execution compared to direct use of Python's eval().

Features

  • Exposes 'run_python' tool
  • Safer execution of Python code compared to direct use of Python eval()
  • Ran via uv in Python venv
  • No file I/O operations allowed
  • Restricted list of imports