SuperAPI AI Directory

browser

A lightweight, high-performance headless browser written in Zig, designed for AI agents. Optimized for speed and low memory (~9x faster than Chrome), featuring native MCP support and Markdown output for LLMs.

Open website

About this tool

Lightpanda is a headless browser built specifically for AI agents and automation, written from scratch in the Zig language, not a Chromium fork, nor a WebKit patch. Official benchmarks show that when making network requests to 933 real web pages on an AWS EC2 m5.large instance, it is 16 times lighter and 9 times faster than Chromium.

Purpose Lightpanda serves modern web automation scenarios that require JavaScript execution. Officially, it is pointed out that simple HTTP requests are no longer sufficient for web automation, because Ajax, single-page applications, infinite scrolling, instant search, and JS frameworks such as React, Vue, and Angular are all driven by JavaScript. Although running a full desktop browser on a server is feasible, it is difficult to scale; Chrome consumes a large amount of memory and CPU at hundreds or thousands of instances, and is difficult to package and deploy. Lightpanda is built for performance, has JavaScript execution capabilities, and does not include a graphics rendering engine.

Main capabilities The key features Lightpanda has implemented include: HTTP loader (Libcurl), HTML parser (html5ever), JavaScript support (V8), Ajax XHR API and Fetch API, DOM and Markdown dumping, CDP/WebSockets server, custom HTTP headers, network interception, respecting robots.txt via the --obey-robots option, and CDP and WebDriver BiDi protocol support.

Markdown output You can use --dump markdown to convert a page directly to Markdown, or use --dump png > page.png and --dump pdf > page.pdf to obtain plain text rendering. --wait-until, --wait-ms, --wait-selector, and --wait-script can be used to adjust the waiting time before dumping.

Installation methods The latest nightly version can be obtained via Homebrew, via the Arch Linux user repository, and Linux and macOS x86_64 and aarch64 binaries can be downloaded from nightly builds, or the official Docker image can be used. Docker images for Linux amd64 and arm64 are provided.

Usage You can start the CDP server, then run Puppeteer scripts by configuring browserWSEndpoint. Use --protocol webdriver to enable BiDi support, and use --protocol webdriver --protocol cdp to start both CDP and BiDi at the same time.

Built-in agent mode lightpanda agent allows the browser to be driven by a native agent. Describe your needs in natural language or slash commands, and it will control the browser: navigate pages, click through flows, fill out forms, and extract structured data. Because the agent and the browser run in the same process, every tool call is a direct operation, preserving Lightpanda's speed and memory advantages. The output of an agent session is PandaScript, which is plain JavaScript plus a small number of native browser primitives. Use /save to export the current session, then replay it via lightpanda run <script>.js. Scripts are deterministic and consume no tokens, and can be used in production at runtime without a model. It supports Anthropic, OpenAI, Gemini, Google Vertex AI, Mistral, Hugging Face, Vercel AI Gateway, OpenRouter, as well as any OpenAI-compatible endpoint via OPENAI_BASE_URL, and can also use local models via Ollama or llama.cpp. You can also use --no-llm to enter the REPL without using an LLM.

Native MCP support The MCP server communicates via MCP JSON-RPC 2.0 over stdio. You can specify a port for the MCP server to run over HTTP instead of stdio, so that one process can serve multiple agents. The client sends to http://host:9223/mcp POST JSON-RPC. Each connection is routed to its own browsing session (its own page, cookies, and memory), preventing agents from overwriting each other's pages. Clients that initialize without an Mcp-Session-Id header are assigned a new session, and the id is returned in the response's Mcp-Session-Id header. Two agents sending the same Mcp-Session-Id share one browsing context. The session_new, session_list, and session_close tools can explicitly manage sessions. Sending DELETE /mcp with an Mcp-Session-Id closes that session.

Other information Lightpanda also provides shell completion (lightpanda completion <bash | fish | zsh>). By default, usage telemetry is collected and sent, and it can be disabled by setting the environment variable LIGHTPANDA_DISABLE_TELEMETRY=true. Setting LIGHTPANDA_DISABLE_CORE_DUMP suppresses crash core dumps.

Platform limitations There is no native Windows binary; it must be installed in WSL following the Linux steps. There is no native Android build, and the Linux aarch64 binary requires the glibc loader, which Android's Bionic libc does not provide. Linux release binaries link against glibc, and will fail on musl-based distributions (such as Alpine) due to the missing glibc dynamic linker, so a glibc-based base image must be used or it must be built from source.

Building from source Lightpanda is written in Zig 0.15.2 and depends on v8, Libcurl, and html5ever. It can be built with make build or make build-dev, or by using zig build run directly. It uses a v8 snapshot, which is created at startup by default and can also be embedded. It can be tested with make test, along with end-to-end tests and Web Platform Tests.