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.
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
- Create an account at datalayer.ai.
- Generate an API token from your account settings (IAM → Tokens / API Keys).
- Export it as an environment variable:
| Environment variable | Description |
|---|---|
DATALAYER_API_KEY | API key for Datalayer code sandbox authentication |
DATALAYER_RUN_URL | Custom 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 variable | Description |
|---|---|
CODE_SANDBOX_URL | Datalayer service URL, e.g. https://prod1.datalayer.run |
CODE_SANDBOX_TOKEN | Datalayer API token |
SANDBOX_ENVIRONMENT | Environment 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"
}
}
}
}