๐ชจ why use many token when few token do trick โ Claude Code skill that cuts 65% of tokens by talking like caveman
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.
Builders who want an agent to execute code and tools locally with shared state.
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
mcp-name: io.github.gradion-ai/ipybox
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:
- ๐ Documentation
- ๐๏ธ Architecture
- ๐ค llms.txt
- ๐ค llms-full.txt
Capabilities
| Capability | Description |
|---|---|
| Stateful execution | State persists across executions in IPython kernels |
| Unified execution | Combine Python code, shell commands, and programmatic MCP tool calls in a code block |
| Shell command execution | Run shell commands via !cmd syntax, capture output into Python variables |
| Programmatic MCP tool calls | MCP tools called via generated Python API ("code mode"), not JSON directly |
| Python tool API generation | Typed functions and Pydantic models generated from MCP tool schemas via mcpygen |
| Application-level approval | Individual approval of tool calls and shell commands during code execution |
| Lightweight sandboxing | Optional kernel isolation via Anthropic's sandbox-runtime |
| Local execution | No cloud dependencies, everything runs locally on your machine |
Usage
| Component | Description |
|---|---|
| Python SDK | Python API for building applications on ipybox |
| MCP server | ipybox as MCP server for code actions and programmatic tool calling |
| Claude Code plugin | Plugin 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
- .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 itSign in to join the discussion.
No comments yet. Be the first to say what this is good for.
More tools
The best-benchmarked open-source AI memory system. And it's free.
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.

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