Monty Provider
The Jupyter MCP Server can execute code in Monty,
a minimal, secure Python interpreter written in Rust (pydantic-monty). Monty runs
a restricted subset of Python in-process with microsecond startup and no access
to the host filesystem, environment, or network unless explicitly granted.
This makes it ideal for running short, LLM-generated snippets where a full
container or kernel would be overkill. Execution is routed through the
code-sandboxes monty engine.
For the full, engine-level configuration reference, see the Monty sandbox guide in the code-sandboxes documentation.
Requirements
Install the Monty extra:
pip install "jupyter-mcp-server[monty]"
Install the sandbox extension package used by this provider:
pip install datalayer_mcp_sandboxes
No credentials or external services are required — Monty runs entirely in-process.
Configuration
Select the Monty engine with SANDBOX_VARIANT=monty:
SANDBOX_VARIANT=monty
Or via the command line:
jupyter mcp start \
--transport streamable-http \
--sandbox-variant monty \
--port 4040
MCP client configuration:
{
"mcpServers": {
"jupyter": {
"command": "uvx",
"args": ["jupyter-mcp-server@latest"],
"env": {
"SANDBOX_VARIANT": "monty"
}
}
}
}
Session state (variables, imports, definitions) persists across cell executions, just like a regular kernel.
Monty supports only a subset of Python. Third-party libraries (such as numpy or
pandas) and rich display outputs (images, plots) are not available. For those,
use the jupyter, datalayer, kaggle, colab, or modal engines.