ipybox

ipybox

A secure Python code execution sandbox running in IPython containers, exposed as an MCP server.

44
Stars
12
Forks
16
Releases

Overview

ipybox is a lightweight and secure Python code execution sandbox based on IPython and Docker. It can run locally on your computer or remotely in an environment of your choice. It is designed for AI agents that need to execute Python code securely, for tasks such as data analysis or executing code actions. The sandbox runs inside isolated Docker containers with a stateful IPython kernel, and offers a configurable firewall to restrict network access. It streams code execution output as it is generated and can install Python packages at build time or runtime. It can return plots generated with visualization libraries. The project exposes an MCP server interface for AI agent integration, and provides generated client code to invoke MCP servers. Deployment is flexible, supporting local or remote setups, and an asyncio API is available for managing the execution environment and coordinating concurrent containers. Together, ipybox enables secure, reproducible Python code execution within an MCP workflow.

Details

Owner
gradion-ai
Language
Python
License
Apache License 2.0
Updated
2025-12-07

Features

Secure Docker sandboxed code execution

Isolated Docker containers provide secure, controlled environments for running untrusted Python code.

Configurable network firewall

Restricts outbound/inbound network access to protect hosts and data from unauthorized access.

Stateful IPython kernel

Maintains session state across commands for interactive and continued workflows.

Real-time output streaming

Streams code execution output as it is generated for immediate feedback.

Build-time or runtime package installation

Installs Python dependencies during build or on-demand at runtime.

Visualization support

Returns plots and visualizations generated by libraries like matplotlib or seaborn.

MCP server interface for AI agents

Exposes an MCP server API to enable AI agents to issue code-execution requests.

Generated MCP client code

Provides generated client code to invoke MCP servers easily from agents.

Audience

AI agentsNeed to execute Python code securely in a sandboxed environment.
MCP integratorsIntegrate MCP client tooling to deploy and manage code-execution containers.
DevelopersDevelopers building secure runtime sandboxes for data analysis workflows in production deployments.

Tags

pythondockersandboxipythonmcp-serverai-agentsnetwork-firewallremote-executioncode-executionvisualization