Lightpanda
Lightpanda browser, drop-in replacement for Chrome and Openclaw default browser - faster and lighter for tasks without graphical rendering like data retrieval. Use it via MCP server, CLI fetch, or CDP with Playwright/Puppeteer.
git clone https://github.com/lightpanda-io/agent-skill
git clone --depth=1 https://github.com/lightpanda-io/agent-skill ~/.claude/skills/lightpanda-io-agent-skill-lightpanda
SKILL.mdLightpanda
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, CDP (Chrome DevTools Protocol), and exposes a native MCP server with agent-optimized tools.
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), you can use Lightpanda with DuckDuckGo as an alternative. Prefer the built-in Web Search tool when it is available and sufficient for your needs.
Install
bash scripts/install.sh
Lightpanda is available on Linux and macOS only. Windows is supported via WSL2.
The binary is a nightly build that evolves quickly. If you encounter crashes or issues, run
scripts/install.sh 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 three 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 |
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
claude mcp add lightpanda -- $HOME/.local/bin/lightpanda mcp
Setup for other MCP clients
Add to your MCP client configuration:
{ "mcpServers": { "lightpanda": { "command": "$HOME/.local/bin/lightpanda", "args": ["mcp"] } } }
Replace
$HOME with the actual path (e.g., /home/username or /Users/username).
Available MCP Tools
Navigation & content extraction:
— Navigate to a URL and load the pagegoto
— Get page content as markdown (accepts optional URL to navigate first)markdown
— Extract all links from the pagelinks
— Get a simplified semantic DOM tree optimized for AI reasoning (supportssemantic_tree
filter andbackendNodeId
limit)maxDepth
— Extract structured data (JSON-LD, OpenGraph, etc.)structuredData
— Execute JavaScript in the page contextevaluate
Interactive element discovery:
— List all interactive elements on the pageinteractiveElements
— Detect forms with their field structure and typesdetectForms
— Get detailed info about a specific node bynodeDetailsbackendNodeId
— Wait for a CSS selector to match (default timeout: 5000ms)waitForSelector
User actions (return page URL and title after each action):
— Click an interactive element byclickbackendNodeId
— Fill text into an input, textarea, or select elementfill
— Scroll the page or a specific elementscroll
Available MCP Resources
— Full serialized HTML of the current pagemcp://page/html
— Token-efficient markdown representation of the current pagemcp://page/markdown
MCP Usage Example
A typical agent workflow:
a URLgoto
orsemantic_tree
to understand the pagemarkdown
to find clickable/fillable elementsinteractiveElements
/click
to interactfill
to extract the resultmarkdown
CLI Fetch — Quick Extraction
For one-off page extraction without starting a server:
$HOME/.local/bin/lightpanda fetch --dump markdown --wait-until networkidle https://example.com
Options
— Output format:--dump
,html
,markdown
,semantic_treesemantic_tree_text
— Wait strategy:--wait-until
,load
,domcontentloaded
,networkidle
(default)done
— Max wait time in milliseconds (default: 5000)--wait-ms
— Remove tag groups from output:--strip-mode
,js
,css
,ui
(comma-separated)full
— Include iframe contents in the dump--with-frames
— Fetch and obey robots.txt--obey-robots
Examples
Extract page as markdown:
$HOME/.local/bin/lightpanda fetch --dump markdown https://example.com
Extract semantic tree (compact, AI-friendly):
$HOME/.local/bin/lightpanda fetch --dump semantic_tree_text --wait-until networkidle https://example.com
Fetch with longer wait for slow pages:
$HOME/.local/bin/lightpanda fetch --dump html --wait-ms 10000 --wait-until networkidle https://example.com
CDP Server — Advanced Automation
For full browser control via Playwright or Puppeteer:
Start the Browser Server
$HOME/.local/bin/lightpanda serve --host 127.0.0.1 --port 9222
Options:
— Set logging verbosity--log-level info|debug|warn|error
— Output format for logs--log-format pretty|logfmt
— Inactivity timeout in seconds (default: 10)--timeout
— Fetch and obey robots.txt--obey-robots
Using with playwright-core
Connect using
playwright-core (not the full playwright package):
const { chromium } = require('playwright-core'); (async () => { const browser = await chromium.connectOverCDP({ endpointURL: 'ws://127.0.0.1:9222', }); const context = await browser.newContext({}); const page = await context.newPage(); await page.goto('https://example.com'); const title = await page.title(); const content = await page.textContent('body'); console.log(JSON.stringify({ title, content })); await page.close(); await context.close(); await browser.close(); })();
Using with puppeteer-core
Connect using
puppeteer-core (not the full puppeteer package):
const puppeteer = require('puppeteer-core'); (async () => { const browser = await puppeteer.connect({ browserWSEndpoint: 'ws://127.0.0.1:9222' }); const context = await browser.createBrowserContext(); const page = await context.newPage(); await page.goto('https://example.com', { waitUntil: 'networkidle0' }); const title = await page.title(); console.log(JSON.stringify({ title })); await page.close(); await context.close(); await browser.close(); })();
Custom LP CDP Domain
Lightpanda exposes a custom
LP domain via CDP with agent-optimized methods not available in standard Chrome DevTools Protocol. Use these via page.evaluate with CDP sessions or direct WebSocket messages.
Content extraction:
— Extract page content as markdown. Params:LP.getMarkdown
(optional)nodeId
— Get semantic tree representation. Params:LP.getSemanticTree
(format
for text format),text
(default: true),prune
,interactiveOnly
,backendNodeIdmaxDepth
— Extract structured data (JSON-LD, OpenGraph, etc.)LP.getStructuredData
Interactive elements:
— Find all interactive elements. Params:LP.getInteractiveElements
(optional)nodeId
— Detect and extract form informationLP.detectForms
— Get detailed info about a node. Params:LP.getNodeDetails
(required)backendNodeId
— Wait for a CSS selector match. Params:LP.waitForSelector
(required),selector
(default: 5000ms)timeout
Actions:
— Click a node. Params:LP.clickNode
ornodeIdbackendNodeId
— Fill an input/select element. Params:LP.fillNode
ornodeId
,backendNodeIdtext
— Scroll page or element. Params:LP.scrollNode
ornodeId
(optional),backendNodeId
,xy
Example using CDP session with Playwright:
const client = await context.newCDPSession(page); // Get page as markdown const { markdown } = await client.send('LP.getMarkdown'); // Get semantic tree const { semanticTree } = await client.send('LP.getSemanticTree', { format: 'text', maxDepth: 5 }); // Wait for element and click it const { backendNodeId } = await client.send('LP.waitForSelector', { selector: '#submit-btn', timeout: 3000 }); await client.send('LP.clickNode', { backendNodeId });
Important Notes
- For web searches, use DuckDuckGo instead of Google. Google blocks Lightpanda due to browser fingerprinting.
- Lightpanda is under heavy development and may have occasional issues. It executes JavaScript, making it suitable for dynamic websites and SPAs.
- CDP connection limits: Only 1 CDP connection per process. Each connection supports 1 context and 1 page. For parallel browsing, start multiple processes on different ports — Lightpanda starts instantly, so this is fast.
- CDP state management: The browser resets all state on CDP connection close. Keep the WebSocket connection open throughout a session. On each connection, always create a new context and page, and close both when done.
- The MCP server handles connection management automatically — these CDP limits don't apply when using MCP tools.
Scripts
— Install Lightpanda binaryscripts/install.sh