Sandbox
@gradion-ai/ipybox

Local runtime for Python, shell, and MCP calls

ipybox runs code blocks in a stateful IPython kernel, so you can keep variables and context across steps. Inside one block, it can mix Python, shell commands, and generated Python calls to MCP tools.

73 starsโ€ข19 forksโ€ขPythonโ€ขUpdated 3mo ago
Who it's for

Builders who want an agent to execute code and tools locally with shared state.

What it delivers

You can let your agent run code, call tools, and keep context without switching between separate runtimes.

What it does

Stateful IPython execution

Keeps variables and state across runs in the same kernel.

Unified code blocks

Lets one block mix Python code, shell commands with `!cmd`, and programmatic MCP tool calls.

Generated MCP tool APIs

Builds typed Python functions and Pydantic models from MCP server schemas with mcpygen.

Approval for actions

Supports per-call approval for tool calls and shell commands during execution.

Optional sandboxing

Can isolate kernels with sandbox-runtime to restrict filesystem and network access.

Claude Code plugin

Bundles the ipybox MCP server and a code action skill for Claude Code.

README

ipybox

ipybox

mcp-name: io.github.gradion-ai/ipybox

Website PyPI - Version GitHub Release GitHub Actions Workflow Status GitHub License

ipybox is a unified execution environment for Python code, shell commands, and programmatic MCP tool calls.

Overview

ipybox executes code blocks in a stateful IPython kernel. A code block can contain any combination of Python code, shell commands, and programmatic MCP tool calls. Kernels can be sandboxed with sandbox-runtime, enforcing filesystem and network restrictions at OS level.

It generates Python APIs for MCP server tools via mcpygen, and supports application-level approval of individual tool calls and shell commands during code execution. ipybox runs locally on your computer, enabling protected access to your local data and tools.

[!NOTE] Next generation ipybox

This is the next generation of ipybox, a complete rewrite. Older versions are maintained on the 0.6.x branch and can be obtained with pip install ipybox<0.7.

Documentation:

Capabilities

CapabilityDescription
Stateful executionState persists across executions in IPython kernels
Unified executionCombine Python code, shell commands, and programmatic MCP tool calls in a code block
Shell command executionRun shell commands via !cmd syntax, capture output into Python variables
Programmatic MCP tool callsMCP tools called via generated Python API ("code mode"), not JSON directly
Python tool API generationTyped functions and Pydantic models generated from MCP tool schemas via mcpygen
Application-level approvalIndividual approval of tool calls and shell commands during code execution
Lightweight sandboxingOptional kernel isolation via Anthropic's sandbox-runtime
Local executionNo cloud dependencies, everything runs locally on your machine

Usage

ComponentDescription
Python SDKPython API for building applications on ipybox
MCP serveripybox as MCP server for code actions and programmatic tool calling
Claude Code pluginPlugin that bundles the ipybox MCP server and a code action skill

[!TIP] Freeact agent

Freeact is a general-purpose agent built on ipybox.

Files in the repo

Repository payloadโ€ข27 top-level entries
  • .claude
  • .claude-plugin
  • .github
  • docs
  • examples
  • ipybox
  • plugin
  • tests
  • .dockerignore
  • .gitignore
  • .pre-commit-config.yaml
  • .python-version
  • .worktreeinclude
  • AGENTS.md
  • CLAUDE.md
  • DEVELOPMENT.md
  • docker-build.sh
  • docker-entrypoint.sh
  • Dockerfile
  • LICENSE
  • mkdocs.yml
  • pyproject.toml
  • README.md
  • server.json
  • setup_uv.sh
  • tasks.py
  • uv.lock

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More tools

JuliusBrussee/
caveman

๐Ÿชจ why use many token when few token do trick โ€” Claude Code skill that cuts 65% of tokens by talking like caveman

105k
1 add
MemPalace/
mempalace

The best-benchmarked open-source AI memory system. And it's free.

59k
stablyai/
orca

Orca is the ADE for working with a fleet of parallel agents. Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

66k

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

132k

Never stop coding. Free MIT AI gateway: one endpoint, 352 providers (150+ free), 1200+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 550+ contributors

64k
headroomlabs-ai/
headroom

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

71k