Model Context Protocol (MCP) server for Leap0, built on the leap0 JavaScript SDK. It exposes sandbox lifecycle, filesystem, and process tools over stdio so clients such as Cursor or Claude can manage Leap0 sandboxes.
- Node.js 20.6 or newer
- A Leap0 API key (and network access to the Leap0 API)
npm install -g @leap0/mcp
# or
pnpm add -g @leap0/mcpFor one-off runs without a global install:
npx @leap0/mcp --helpFrom a clone of this repo, after pnpm install and pnpm run build:
node dist/cli.js --helpThe server uses the same variables as the leap0 SDK (see also Leap0Client in the SDK docs).
| Variable | Required | Description |
|---|---|---|
LEAP0_API_KEY |
Yes | API key for the Leap0 control plane |
LEAP0_BASE_URL |
No | API base URL (SDK default applies if unset) |
LEAP0_SANDBOX_DOMAIN |
No | Sandbox hostname domain (SDK default applies if unset) |
LEAP0_SDK_OTEL_ENABLED |
No | SDK OpenTelemetry toggle (see leap0 SDK) |
The MCP process must be able to reach the Leap0 API and should have your credentials in its environment. If your coding agent runs in an isolated container without secrets, configure MCP on the host (or inject LEAP0_API_KEY into the environment where leap0-mcp runs). Running only inside a restricted sandbox with no outbound API access will fail at client creation or on the first tool call.
Generate a JSON snippet you can merge into your client’s MCP settings:
leap0-mcp --print-configThis prints a mcpServers block using your current node binary and the resolved path to this package’s cli.js. Placeholders use ${VAR} so you can rely on the shell or replace them with real values.
- Copy the JSON into your app’s MCP config (e.g. Cursor Settings → MCP).
- Ensure
LEAP0_API_KEYis set in the serverenv(or remove the placeholder and set it in your user environment before starting the agent). - Remove or set optional entries (
LEAP0_BASE_URL,LEAP0_SANDBOX_DOMAIN) if you use non-default endpoints. - Restart the editor or MCP host.
On Windows, the printed config includes APPDATA in env (similar to other MCP servers) so tools resolve user paths correctly.
Paste the mcpServers object from --print-config into your Cursor MCP configuration, or merge it with existing mcpServers keys. The server name key is leap0-mcp.
Add the same mcpServers entry under Claude’s MCP configuration file for your platform (see Anthropic’s MCP documentation for the exact path).
| Flag | Meaning |
|---|---|
| (none) | Start the MCP server on stdio (JSON-RPC on stdout only) |
--print-config |
Print MCP JSON config to stdout |
--version / -V |
Print package version |
--help / -h |
Print usage |
Diagnostics and errors go to stderr; MCP traffic uses stdout.
Requires leap0 0.5.x (sandbox memory / disk / timeout fields, list API, and public URL helpers align with that release).
| Tool | Purpose |
|---|---|
leap0_sandboxes_create |
Create a sandbox (memory in MiB, timeout in seconds) |
leap0_sandbox_get |
Get sandbox by id |
leap0_sandbox_get_workdir |
Configured sandbox working directory (getWorkdir) |
leap0_sandbox_delete |
Delete sandbox |
leap0_sandboxes_list |
List sandboxes (filters / pagination) |
leap0_sandbox_invoke_url |
Public HTTPS URL for a path (and optional port) |
leap0_sandbox_websocket_url |
Public WebSocket URL for a path |
leap0_sandbox_create_presigned_url |
Time-limited public URL for a sandbox port |
leap0_fs_read / leap0_fs_write / leap0_fs_list |
Files in a sandbox |
leap0_process_execute |
Run a command in a sandbox |
- Match the
leap0SDK version this MCP package declares (seedependenciesinpackage.json); runpnpm update leap0in a checkout or reinstall the published package sonode_modulesresolves to that range. - Rebuild after dependency changes:
pnpm run build(orpnpm run cibefore merging). - Restart the editor or MCP host so it spawns a fresh
leap0-mcpprocess.
Failed to create Leap0 client/ API key errors — SetLEAP0_API_KEYin the MCPenvor in the process environment before launchingleap0-mcp.- 401 / 403 from tools — Key invalid or missing; confirm the key in the Leap0 dashboard and that the same env is visible to the MCP process.
- Connection / timeout errors — Check
LEAP0_BASE_URL, firewall, and that the machine running MCP can reach the API (not blocked in a no-network sandbox). - Empty or wrong PATH in
--print-config— The printedPATHis taken from the shell that ran the command; adjust in the MCP config ifnodeor other binaries are not found when the editor spawns the server.
pnpm install
pnpm run ci # build, typecheck, and Vitest (use in CI pipelines)
pnpm test # build + VitestApache-2.0