ipybox
Python code execution sandbox with programmatic MCP tool calling (PTC)
claude mcp add --transport stdio gradion-ai-ipybox python -m ipybox.mcpserver \ --env IPYBOX_HOST="0.0.0.0" \ --env IPYBOX_PORT="8000"
How to use
ipybox is a Python-based MCP server that provides a sandboxed execution environment with first-class support for programmatic MCP tool calling. It generates typed Python tool APIs from MCP tool schemas and can run tools either locally in a sandboxed IPython kernel or as remote HTTP endpoints. The server emphasizes tool-call approval, requiring applications to approve each MCP tool invocation before it is executed, which helps keep tool usage safe within an autonomous or semi-autonomous agent workflow. The MCP server exposes an interface to execute code actions, manage tool schemas, and generate Python APIs that integrate MCP capabilities directly into your Python applications or agents.
How to install
Prerequisites:
- Python 3.8+ (recommended)
- Access to the command line
- Optional: virtual environment tool (venv, conda, etc.)
Install and run ipybox MCP server:
Code:
# Optional: create and activate a virtual environment
python -m venv venv
source venv/bin/activate # on Windows use: venv\Scripts\activate
# Install ipybox from PyPI
pip install ipybox
# Run the MCP server (example using the built-in mcpserver module)
python -m ipybox.mcpserver
Alternative running with explicit port/host (if supported by your deployment):
python -m ipybox.mcpserver --port 8000 --host 0.0.0.0
If you need a Docker-based setup, you can create a minimal Dockerfile that installs Python, installs ipybox, and runs the server in the container. See the container command example below:
# Docker run example (adjust as needed)
docker run -it --rm -p 8000:8000 python:3.11-slim bash -lc "pip install ipybox && python -m ipybox.mcpserver --port 8000 --host 0.0.0.0"
After installation, consult the project documentation for tool schema setup, API generation, and how to register MCP tool schemas for your server.
Additional notes
Tips and common considerations:
- Ensure your Python environment matches the required version and dependencies for ipybox and any MCP tool packages you use.
- Use the provided MCP server tooling to generate Python tool APIs from MCP schemas to simplify integration into your Python applications.
- The server enforces tool-call approvals. Build your agent or application logic to present tool invocations for user or system approval before execution.
- If you run in a container or on a remote host, expose the correct port and configure host binding (IPYBOX_PORT and IPYBOX_HOST) to allow your clients to reach the MCP server.
- When developing locally, consider using a virtual environment and pinning package versions to ensure reproducible behavior.
- Review the MCP server documentation for details on supported transports (stdio, HTTP, SSE) and how to wire your MCP tools into the generated Python APIs.
Related MCP Servers
ReActMCP
ReActMCP is a reactive MCP client that empowers AI assistants to instantly respond with real-time, Markdown-formatted web search insights powered by the Exa API.
spring-ai
From Java Dev to AI Engineer: Spring AI Fast Track
furi
CLI & API for MCP management
mcp-lite-dev
共学《MCP极简开发》项目代码
unity-editor
An MCP server and client for LLMs to interact with Unity Projects
mcp-bundler
Is the MCP configuration too complicated? You can easily share your own simplified setup!