Skip to main content

Datalayer Code Sandbox

The Jupyter MCP Server can execute code on the Datalayer cloud code sandbox, providing fully isolated execution with GPU support, snapshots, and persistence. Execution is routed through the code-sandboxes datalayer engine, which is powered by agent_code_sandboxes.

tip

For the full, engine-level credential and parameter reference, see the Datalayer sandbox guide in the code-sandboxes documentation.

Requirements

Install the Datalayer extra:

pip install "jupyter-mcp-server[datalayer]"

Install the sandbox extension package used by this sandbox:

pip install datalayer_mcp_sandboxes

Credentials

  1. Create an account at datalayer.ai.
  2. Generate an API token from your account settings (IAM → Tokens / API Keys).
  3. Export it as an environment variable:
Environment variableDescription
DATALAYER_API_KEYAPI key for Datalayer code sandbox authentication
DATALAYER_RUN_URLCustom Datalayer service URL (optional, self-hosted)

Configuration

Select the Datalayer engine with SANDBOX_VARIANT=datalayer:

SANDBOX_VARIANT=datalayer
DATALAYER_API_KEY=your-datalayer-token

The engine reads DATALAYER_API_KEY itself. The server also accepts the sandbox-neutral spelling, which is what --code-sandbox-url and --code-sandbox-token set and what the other sandboxes use:

Environment variableDescription
CODE_SANDBOX_URLDatalayer service URL, e.g. https://prod1.datalayer.run
CODE_SANDBOX_TOKENDatalayer API token
SANDBOX_ENVIRONMENTEnvironment to launch, e.g. python-cpu-env
"env": {
"SANDBOX_VARIANT": "datalayer",
"CODE_SANDBOX_URL": "https://prod1.datalayer.run",
"CODE_SANDBOX_TOKEN": "your-datalayer-token",
"SANDBOX_ENVIRONMENT": "python-cpu-env"
}

MCP client configuration:

{
"mcpServers": {
"jupyter": {
"command": "uvx",
"args": ["jupyter-mcp-server@latest"],
"env": {
"SANDBOX_VARIANT": "datalayer",
"DATALAYER_API_KEY": "your-datalayer-token"
}
}
}
}