Labsco
MCP SERVER

Python REPL

by hdresearch

A Python session that keeps its variables between calls, so the assistant can build on what it just computed.

Sandboxed Code Execution
Summary
Persistence is the feature: load the data once, then keep asking questions of it.

A stateless executor makes the model re-read the file on every call. Here a DataFrame loaded in step one is still in memory in step five, and list_variables lets the assistant check what it has rather than guess. install_package means a missing dependency is a one-line fix instead of a dead end.

What it is

A REPL exposed over MCP: code runs in one persistent session, and what you defined earlier is still there on the next call.

What you get
  • execute_python runs code in the session, with a reset flag to clear it and start over
  • list_variables shows everything currently defined
  • install_package pulls a package from PyPI into the session
  • State that survives between calls, so a variable set in one step is usable in the next
Requirements

Uv, and a clone — the client launches it with uv run against the project directory. No setup beyond that, no key, no account. Code runs as your user with no sandbox, so treat it as running Python on your own machine.

Setup effort

One command — uvx mcp-python