Skip to main content
Glama
README.md
<p align="center">
  <a href="https://hi0.app">
    <picture>
      <source media="(prefers-color-scheme: dark)" srcset="assets/hi0-logo-dark.svg" />
      <source media="(prefers-color-scheme: light)" srcset="assets/hi0-logo-light.svg" />
      <img alt="Hi0" src="assets/hi0-logo-light.svg" height="48" />
    </picture>
  </a>
</p>

<p align="center">
  A local Linux desktop sandbox for MCP agents, streamed per-window over Wayland at 120 FPS.
</p>

<p align="center">
  <a href="https://hi0.app">Website</a> ·
  <a href="https://github.com/Rowtion/hi0/releases">Releases</a> ·
  <a href="LICENSE">Apache-2.0</a>
</p>

<p align="center">
  <strong>English</strong> · <a href="README.zh-CN.md">简体中文</a>
</p>

<p align="center">
  <img src="assets/hero-desktop.jpg" alt="Hi0 running an interactive 3D CAD workspace driven by an external MCP agent" width="100%" />
</p>

Hi0 gives external AI agents (Claude Code, Codex, Grok Build, Antigravity, OpenClaw, and other MCP clients) their own isolated Linux desktop inside a local micro-VM. Instead of hijacking your host cursor or running blind in headless scripts, agents work inside real Linux GUI apps while you watch live and click once to take over or lock input.

## Architecture

```text
External MCP Clients (Claude Code, Codex, Grok Build, Antigravity, ...)
        │  Streamable HTTP (127.0.0.1:17700/mcp) or stdio
        ▼
  Hi0 Hub (packages/wland-hub)
    ├── InputArbiter         epoch-gated human/agent control + instant lock
    ├── DisplayMux           per-window Wayland stream fan-out to Web UI
    └── 4-tier MCP router    T0 Shell/Files -> T1 CDP -> T2 AT-SPI2 -> T3 Vision/Pointer
        │
        ▼  Apple Container (macOS) / WSL2 & Docker (Windows)
  Linux Micro-VM (container/)
    ├── wland                pure-Wayland compositor (STREAM v2, up to 120 FPS)
    ├── guiuser (uid 1000)   Chromium, VS Code, Obsidian, LibreOffice, Foot, WebApps
    ├── shelluser (uid 1001) isolated shell_exec worker with separate UID
    └── egress firewall      blocks private RFC1918 / link-local / ULA ranges
```

A few design choices worth calling out:

- **No VNC / noVNC.** Windows stream directly from a headless Wayland compositor (`wland`) as independent surfaces, so moving or switching apps does not fight a single flat framebuffer.
- **Semantic before pixels.** `ui_observe` reads Chromium/Electron DOM trees over a private CDP pipe (~10 ms) and native GTK/Qt widgets over AT-SPI2 before falling back to lossless screenshots.
- **Human always wins.** Locking the desktop from the top bar blocks every agent channel immediately. Handing control back increments the session `epoch`, invalidating stale element refs from before the interruption.
- **Scoped files and credentials.** `/workspace` syncs with a dedicated host folder (plus any folders you explicitly link under `/projects/<name>`). Saved credentials live in the OS keychain and are filled through the hub without exposing plaintext to the agent.

## MCP tools

Hi0 exposes 12 tools over Streamable HTTP (`http://127.0.0.1:17700/mcp`) and stdio (`@hi0/mcp-server`):

| Group | Tools |
| :--- | :--- |
| Apps & windows | `app_list`, `app_launch`, `app_window` |
| Observe & act | `ui_observe`, `ui_act`, `ui_pointer`, `ui_type`, `ui_screenshot`, `ui_wait` |
| Shell & files | `shell_exec`, `workspace_files` |
| Handoff | `human_takeover` |

## Install (macOS)

Requires an Apple Silicon Mac (macOS 15+) and [Apple `container`](https://github.com/apple/container):

```bash
brew install --cask container
```

1. Download [`Hi0-0.1.0-alpha.1-arm64.dmg`](https://github.com/Rowtion/hi0/releases/download/v0.1.0-alpha.1/Hi0-0.1.0-alpha.1-arm64.dmg) from [Releases](https://github.com/Rowtion/hi0/releases) and drag `Hi0.app` to `/Applications`.
2. Since early alpha builds are not yet Apple-notarized, clear the quarantine attribute before first launch (or allow it in **System Settings → Privacy & Security**):
   ```bash
   xattr -cr /Applications/Hi0.app
   ```
3. Launch Hi0. First run pulls the ARM64 Linux runtime image, initializes your workspace folder, and boots the desktop.

## Connect an agent

Open **Settings → AI Users & Connections** in Hi0 to detect installed clients and write their MCP config automatically, or point any Streamable HTTP MCP client at:

```json
{
  "mcpServers": {
    "hi0": {
      "url": "http://127.0.0.1:17700/mcp"
    }
  }
}
```

## Current status and limitations

Hi0 is an early alpha (`v0.1.0-alpha.1`). Expect breaking changes and do not keep sensitive production data in it yet.

- **No hardware GPU on macOS yet.** Apple `container` does not currently expose VirtIO-GPU, so Chromium WebGL and heavy 3D canvases run on software rasterization on macOS.
- **Pure Wayland, no XWayland.** X11-only Linux GUI apps will not launch; stick to Wayland-native apps (Chromium, VS Code, Obsidian, LibreOffice, Foot, Nautilus, marimo, JupyterLab) or WebApps.
- **macOS notarization pending.** First launch requires `xattr -cr /Applications/Hi0.app` or Gatekeeper approval.
- **Windows support in progress.** The WSL2 (with `/dev/dxg` DirectX 12 GPU) and WebView2 shell implementation is in `main` and currently undergoing hardware verification before release installers are published.

## Build from source

Requires Node.js `>= 22`, `pnpm@10`, and Xcode Command Line Tools (macOS) or Rust + NSIS (Windows).

```bash
pnpm install
pnpm build
pnpm hub:start                        # http://127.0.0.1:17700
```

Build the self-contained macOS app bundle or DMG:

```bash
HI0_BUNDLE_RUNTIME=1 pnpm mac:build   # dist/Hi0.app
pnpm mac:dmg                          # dist/Hi0-0.1.0-alpha.1-arm64.dmg
```

Verify typecheck, unit tests, and design tokens:

```bash
pnpm typecheck && pnpm test && pnpm design:check
```

## License

[Apache-2.0](LICENSE). Third-party attributions are listed in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).