Skip to main content
Glama
unkernel-mcp

unkernel-mcp

by xbtoshi

unkernel-box

Instant, air-gapped Linux-in-WebAssembly sandbox wrapper around unkernel (pithings/unkernel). Ships as a CLI (unkernel-box), a zero-dependency MCP server (unkernel-mcp), and a tiny ESM library — booting a real Linux 7.x aarch64 kernel in ~50 ms with a RAM-only root filesystem.

Security Defaults

  • Double isolation: Guest Linux ELF binaries execute inside kwemu (software ARM64 CPU) inside a Linux kernel compiled to WebAssembly.

  • Air-gapped by default: Zero network access unless --net or --allow is passed.

  • LAN / localhost SSRF guard: Even with --net, connections to 127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16, 100.64.0.0/10, and .local are blocked and logged unless --allow-lan is explicitly set.

  • Ephemeral RAM root + audited /sandbox: Every file injected via --file is copied into guest RAM (MemoryFs), all mutations are recorded, and everything disappears on exit.

Related MCP server: kali-mcps

Requirements

  • Node.js >= 24 (WebAssembly JSPI support)

Install

# Install globally from npm
npm install -g unkernel-box

# Or run directly without installing
npx unkernel-box run "uname -a"

CLI Usage (unkernel-box)

# Instant air-gapped busybox Linux shell (<100ms, zero download)
unkernel-box shell

# Pre-cache Alpine or Debian once into ~/.cache/unkernel, then boot
unkernel-box fetch alpine
unkernel-box shell --alpine

# Copy an untrusted script/binary into guest RAM (/sandbox/<name>), run air-gapped, wipe on exit
unkernel-box run --file ~/Downloads/suspect.sh "sh /sandbox/suspect.sh"

# Mount a host directory strictly read-only at /work
unkernel-box run --alpine --ro . "ls -la /work"

# Allow outbound TCP ONLY to specific domains (blocks & logs everything else)
unkernel-box run --alpine --allow registry.npmjs.org "wget -qO- https://registry.npmjs.org"

# Structured JSON output (includes boot_ms, exec_ms, fs_changes, net_events)
unkernel-box run --json "uname -a && touch /sandbox/test.txt"

MCP Server (unkernel-mcp)

Add to OpenCode (~/.config/opencode/opencode.json), Claude Desktop, or any stdio MCP client (zero-install via npx, or use ["unkernel-mcp"] if installed globally):

{
  "mcp": {
    "unkernel": {
      "type": "local",
      "command": ["npx", "-y", "-p", "unkernel-box", "unkernel-mcp"],
      "timeout": 180000,
      "enabled": true
    }
  }
}

Exposed tools:

  • unkernel_exec — Ephemeral one-shot command run with optional inline files, host_files, ro_mount, net, and allow_domains.

  • unkernel_session_start / unkernel_session_exec / unkernel_session_stop — Persistent in-memory VM sessions (RAM-only, wiped on stop).

JS/TS Library Usage

import { bootSandbox } from "unkernel-box";

const sb = await bootSandbox({
  distro: "base", // or "alpine" | "debian"
  files: { "hello.sh": "echo hi from $(uname -r)\n" },
});
const res = await sb.execCommand("sh /sandbox/hello.sh");
console.log(res.stdout, sb.fsEvents);
await sb.stop();

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Runs AI-generated code in secure Firecracker microVMs with opt-in network policy enforcement, PII scanning, prompt injection defense, and audit logging. Exposes MCP tools for running commands, managing files, and the full sandbox lifecycle.
      7
      18 npm
      1
      Apache 2.0
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables users to run Kali-based security tools for network scanning, binary and symbol analysis, string extraction, and live or captured traffic analysis through an MCP client. It also supports isolated Docker sandbox command execution with resource limits and file transfer.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables MCP clients to run Kali Linux security tooling locally through Docker, covering network scanning, symbol and binary analysis, string extraction, and packet capture analysis. It also provides an isolated sandbox for executing commands with configurable memory, CPU, network, and timeout limits plus file transfer between host and container.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables security researchers and developers to run tools such as Nmap, objdump, strings, and tshark through MCP, supporting network scanning, binary analysis, string extraction, traffic capture, and sandboxed command execution.
      -