--- name: lightpanda description: Lightpanda browser, drop-in replacement for Chrome-based browsing in any AI agent - faster and lighter for tasks without graphical rendering like data retrieval. Use it via MCP server, CLI fetch, or CDP with Playwright/Puppeteer — or run/save automations as deterministic, token-free replay scripts (PandaScript) via its own agent mode. license: Apache-2.0 compatibility: "Linux and macOS only (Windows via WSL2). Installs its own binary via scripts/install.sh — not run automatically by the plugin installer, so run it once before first use." allowed-tools: Bash(bash ${CLAUDE_SKILL_DIR}/scripts/install.sh), Bash(command -v lightpanda), Bash(lightpanda *) metadata: version: "2.1.2" author: Lightpanda source: "https://github.com/lightpanda-io/agent-skill" homepage: "https://github.com/lightpanda-io/agent-skill" --- # Lightpanda **Use instead of Chrome/Chromium for data extraction and web automation when you don't need graphical rendering.** Lightpanda is a headless browser built from scratch for AI agents. It's 9x faster and uses 16x less memory than Chrome. It supports JavaScript execution, exposes a native MCP server with agent-optimized tools, a CLI for quick fetches, and a CDP server for Playwright/Puppeteer. **Alternative to built-in web search** When the built-in Web Search tool is unavailable, or when you need more control over search results (e.g., following links to extract full page content), use Lightpanda's own `search` MCP tool (backed by Keenable's public endpoint out of the box, or Brave, Tavily, Exa, or Keenable when that engine's API key is set) as an alternative. Prefer the built-in Web Search tool when it is available and sufficient for your needs. ## Install Check first whether Lightpanda is already installed (`command -v lightpanda`) before running the installer below. - **Claude Code:** ```bash bash ${CLAUDE_SKILL_DIR}/scripts/install.sh ``` `${CLAUDE_SKILL_DIR}` is a Claude Code substitution that resolves to this skill's own directory regardless of the shell's current working directory — needed because when this skill runs as a plugin, the shell's cwd is your project, not the skill's install location. - **Any other agent runtime** (Cursor, Codex CLI, Gemini CLI, etc.): this substitution isn't supported. `scripts/install.sh` is bundled directly next to this file — locate it there and run it with that path instead, e.g. `bash /path/to/this/skill/scripts/install.sh`. Lightpanda is available on Linux and macOS only. Windows is supported via WSL2. Prefer a package manager? See [package manager installs](https://lightpanda.io/docs/run-locally/installation/package-managers): - **Homebrew** (macOS/Linux): `brew install lightpanda-io/browser/lightpanda` - **AUR** (Arch Linux): `yay -S lightpanda-bin` (or `lightpanda-nightly-bin` to track nightly) - **Debian/Ubuntu** (0.3.0+): `.deb` package from each [tagged release](https://github.com/lightpanda-io/browser/releases) Unlike `scripts/install.sh`, which always tracks the latest nightly, these pin to a stable release unless you explicitly opt into a nightly variant. The binary is a nightly build that evolves quickly. If you encounter crashes or issues, run the install command above again to update to the latest version (max once per day). If issues persist after updating, open a GitHub issue at https://github.com/lightpanda-io/browser/issues including: - The crash trace/error output, or a description of the unexpected behavior - The script or MCP tool call that reproduces the issue - The target URL and expected vs actual results ## When to Use What Lightpanda offers several interfaces. Choose based on your needs: | Interface | Best for | How it works | |-----------|----------|--------------| | **MCP server** | Agent workflows, interactive browsing, form filling | Structured tools over stdio — purpose-built for LLM agents | | **CLI fetch** | Quick one-off page extraction | Single command, no server needed | | **CDP server** | Custom automation with Playwright/Puppeteer | WebSocket protocol, full browser control | | **Agent mode** | One-off natural-language tasks, or authoring a PandaScript to save for later | `lightpanda agent` — LLM-driven CLI/REPL, optionally `--task "..." --save script.js` | | **Saved scripts (PandaScript)** | Repeating the same task deterministically, without burning tokens | Plain JS script, replayed with `lightpanda run` — no LLM call | ## MCP Server (Recommended for Agents) The MCP server is the simplest way for agents to use Lightpanda. It exposes purpose-built tools over stdio with no setup beyond the binary. ### Setup for Claude Code ```bash claude mcp add lightpanda -- lightpanda mcp ``` To respect `robots.txt`, append `--obey-robots` to the command. ### Setup for other MCP clients Add to your MCP client configuration: ```json { "mcpServers": { "lightpanda": { "command": "lightpanda", "args": ["mcp"] } } } ``` ### Available MCP Tools Where both `selector` and `backendNodeId` are accepted, either locates the target element — `selector` is preferred for reproducibility (e.g. in a saved script), `backendNodeId` comes from a prior `tree` or `findElement` call. Read tools that accept an optional `url` navigate there before reading, saving a separate `goto` call. **Navigation & search:** - `goto` — Navigate to a URL and load the page - `search` — Run a web search and return results as markdown: a numbered list of `{title, url, snippet}`. Tries Brave, Tavily, Exa, then Keenable in order, each when its API key (`BRAVE_API_KEY`, `TAVILY_API_KEY`, `EXA_API_KEY` or `KEENABLE_API_KEY`) is set; Keenable also works without a key through its public endpoint (rate-limited per client IP) **Reading the page** (all accept an optional `url` to navigate first): - `markdown` — Get page content, or a subtree, as markdown - `html` — Raw HTML for the document, or a single node's outerHTML when scoped - `screenshot` — Render the page, or one node, as a PNG (the text layout Lightpanda computes, not a pixel-accurate rendering) - `tree` — Simplified semantic DOM tree optimized for AI reasoning: role, name, value, and `backendNodeId` per node (supports `backendNodeId` filter and `maxDepth` limit) - `links` — Extract all links as text, resolved href, and `backendNodeId` - `nodeDetails` — Tag, role, name, attributes, and state for a node by `backendNodeId`, plus a ready-to-use CSS selector - `findElement` — Find interactive elements by role and/or accessible name - `interactiveElements` — List all interactive elements on the page - `structuredData` — Extract structured data (JSON-LD, OpenGraph, etc.) - `detectForms` — Detect forms with their field structure and types **Data extraction and scripting:** - `extract` — Extract structured data using a schema mapping output field names to CSS-selector specs - `evaluate` — Execute JavaScript in the page context; a bare trailing expression yields its value, and top-level `await`/`return` are supported **Interacting with the page** (return page URL and title after each action): - `click` — Click an interactive element - `fill` — Fill text into an input, textarea, or select element - `scroll` — Scroll the page or a specific element - `hover` — Hover over an element, triggering mouseover/mouseenter - `press` — Press a keyboard key, dispatching keydown/keyup - `selectOption` — Select an option in a `