Because state survives between calls, a model can load a dataframe once and keep poking at it, instead of rebuilding context in every snippet — and the readable history resource means you can see exactly what it ran. Treat it as a local shell with the same trust level: point it at a machine and directory you would be comfortable letting the model write to.
A small MCP server that exposes an interactive Python read-eval-print loop. State is kept per session, so a value defined in one call is still in scope for the next one.
- `python_repl` — runs Python code in a named session, taking `code` and `session_id`
- Separate state per session, so two lines of work do not collide
- Expressions and statements both work, and stdout and stderr come back with the result
- Session history exposed as a `repl://` resource, showing each input and its output
The `python-local` package, run with uv or uvx. Code executes in the server's own Python process on your machine, with whatever that interpreter can reach — there is no sandbox in front of it.
One command — uvx python-local
