lightpanda
Lightpanda browser, drop-in replacement for Chrome-based browsing in any AI agent - faster and lighter for tasks without graphical rendering like data retrieval. Install it and use it via MCP server, CLI fetch, CDP with Playwright/Puppeteer, or WebDriver with Selenium; MCP and CDP also run on Lightpanda Cloud. Its agent mode saves automations as deterministic, token-free replay scripts (PandaScript).
How do I install this agent skill?
npx skills add https://github.com/lightpanda-io/agent-skill --skill lightpandaIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill provides a high-performance headless browser (Lightpanda) for AI agents to perform web automation and data extraction. It facilitates the installation of the browser binary from official vendor sources with built-in checksum verification and offers tools for interacting with web pages, executing automation scripts, and managing browsing sessions.
- Socketpass
No alerts
- Snykwarn
Risk: MEDIUM · 2 issues
- ZeroLeakspass
Score: 93/100 · 2 sections analyzed
What does this agent skill do?
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. All options: installation docs.
Lightpanda is available on Linux and macOS only. Windows is supported via WSL2.
Install script
The script installs the latest release; set LIGHTPANDA_VERSION=nightly (or a release tag) to pick another build. If you encounter crashes or issues, run the install command below again to update to the latest version.
- Claude Code:
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.shis 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.
Package managers
- Homebrew (macOS/Linux):
brew install lightpanda-io/browser/lightpanda(orlightpanda-io/browser/lightpanda-nightlyto track nightly) - AUR (Arch Linux):
yay -S lightpanda-bin(orlightpanda-nightly-binto track nightly) - Debian/Ubuntu (0.3.0+):
.debpackage from each tagged release
These pin to a stable release unless you explicitly opt into a nightly variant.
Docker
Linux amd64/arm64: docker run -d --name lightpanda -p 127.0.0.1:9222:9222 lightpanda/browser:latest starts the CDP server on port 9222 (Docker install).
Python and Node.js packages
- Python (3.10+):
pip install lightpandabundles the browser. Session methods are the MCP tools in snake_case (Python guide):from lightpanda import Browser with Browser() as b: page = b.new_session() page.goto(url="https://example.com") - Node.js (22+):
npm install @lightpanda/browser && npx @lightpanda/browser install(the second step downloads the binary and is required).lightpanda.serve({ host, port })starts a CDP server andlightpanda.fetch(url, options)fetches a page (package README).
No install at all
Use Lightpanda Cloud.
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 |
| WebDriver server | Selenium, or Puppeteer over BiDi | lightpanda serve --protocol webdriver, classic WebDriver over HTTP plus BiDi over WebSocket |
| Lightpanda Cloud | Agents that can't install a binary or keep a process running, or need proxies | Hosted CDP, MCP and HTTP API endpoints, authenticated with a token |
| 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
claude mcp add lightpanda -- lightpanda mcp
To respect robots.txt, append --obey-robots to the command.
To keep unused tool definitions out of the context, expose only the tools you need with --tools goto,tree,click (lightpanda mcp --list-tools prints every name in that format). It is not a sandbox: a listed tool keeps its full reach.
Setup for other MCP clients
Add to your MCP client configuration:
{
"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. Selectors are plain CSS only: Playwright-style prefixes (text=, role=, xpath=) fail with InvalidSelector; use findElement(role, name) for text or role lookups.
Navigation & search:
goto— Navigate to a URL and load the pagedownload— Fetch a URL with the session's cookies into a file, for a PDF, spreadsheet or archive. Nothing is saved unless the status is 200-203; needs a loaded pagesearch— 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_KEYorKEENABLE_API_KEY) is set; Keenable also works without a key through its public endpoint (rate-limited per client IP);--block-urlsapplies: results whose URL matches are dropped, and a query that matches returnsNo results.
Reading the page (all accept an optional url to navigate first, saving a separate goto call):
A url already loaded (current or originally requested) is read without reloading; if a redirect or in-page navigation moved the page, the result opens with "The page is at <current>, not <url>: ..." (use goto to reload).
markdown— Get page content, or a subtree, as markdownhtml— Raw HTML for the document, or a single node's outerHTML when scopedscreenshot— 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, andbackendNodeIdper node (supportsbackendNodeIdfilter andmaxDepthlimit). It doesn't enter frames: an iframe's value is its current URL; pass it asurlto read the framelinks— Extract all links as text, resolved href, andbackendNodeIdnodeDetails— Tag, role, name, attributes, and state for a node bybackendNodeId, plus a ready-to-use CSS selectorfindElement— Find interactive elements by role and/or accessible nameinteractiveElements— List all interactive elements on the pagestructuredData— Extract structured data (JSON-LD, microdata, 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 specsevaluate— Execute JavaScript in the page context; a bare trailing expression yields its value, and top-levelawait/returnare supportedclassify— Answer questions about the page, or pick a category, e.g. presets likeisCaptcha,isLoginWall,isPaywall
Interacting with the page (each returns the page URL, HTTP status and title):
click— Click an interactive element; the result says so when the target is disabled (no click happened) or hidden (no user could click it)fill— Fill text into an input, textarea, or select elementscroll— Scroll the page or a specific elementhover— Hover over an element, triggering mouseover/mouseenterpress— Press a keyboard key, dispatching keydown/keyupselectOption— Select an option in a<select>by valuesetChecked— Check or uncheck a checkbox or radio buttonacceptCookies— Dismiss the cookie consent banner (prefer:acceptorreject), check it went, and return JSON with the controls clickedlogin— Sign in with$LP_*placeholders as credentials; fills, submits, checks whether it worked, and returns JSON with the selectors used
An action that opens a new window, e.g. a target=_blank click, adds "Opened a new window; tools now act on it." to its result. A window opened later, after a fetch or a timer, does not become current: switch to it with the popups tool (State and debugging below).
classify, acceptCookies and login ask a decision model. acceptCookies and login skip it when given the selectors an earlier call returned, so a recorded script replays with no model call. The model needs TYPESAFE_API_KEY, or GOOGLE_API_KEY/GEMINI_API_KEY with LIGHTPANDA_DECISION_PROVIDER=gemini. Without a key, a call that asks it fails with "<tool>: no decision model key is set; set TYPESAFE_API_KEY, or GOOGLE_API_KEY/GEMINI_API_KEY with LIGHTPANDA_DECISION_PROVIDER=gemini". Agent mode falls back to its chat model.
Waiting:
waitForSelector— Wait for a CSS selector to matchwaitForScript— Wait until a JS expression returns truthy, re-checked each tickwaitForState— Wait for a load state (load,domcontentloaded,networkalmostidle,networkidle,settled,done) with no navigation
State and debugging:
getUrl— Get the URL currently loaded in the browsergetCookies— Get cookies for the current page's host, anotherurl, orallgetEnv— Read anLP_*environment variable, or list the setLP_*namesconsoleLogs— Get buffered console.log/warn/error messages, then clear the bufferpopups: list the windows the page opened (window.openortarget=_blank), main page first;followan id to make that window current, or the main page's id to switch back
Page tools (WebMCP):
pageTools— List the tools the page registers for agents through WebMCP (navigator.modelContext.registerTool). A page tool runs the site's own code and can be more reliable than driving its UI; many pages register them afterloadcallPageTool— Call one of them by name; treat a tool withoutreadOnlyHintlike a form submit
When the page adds or removes tools, the next tool result starts with a note:
- Tools registered: "The page registers WebMCP tools; callPageTool runs one:", followed by the full current list as JSON
- No tools left: "The page no longer registers WebMCP tools."
Session (relevant with the HTTP transport, below):
save— Save the session as a reusable PandaScript (see the Saved Scripts section)run— Run a PandaScript in this session (its source, or thepathsavewrote), aslightpanda rundoes; cookies and storage stay in the sessionsession_new— Create a new isolated browser session (its own page, cookies, memory) and return its idsession_list— List active sessions with their id and current URLsession_close— Close a session (thedefaultsession cannot be closed)
Available MCP Resources
mcp://page/html— Full serialized HTML of the current pagemcp://page/markdown— Token-efficient markdown representation of the current page (same content as themarkdowntool)mcp://skill/pandascript: the PandaScript skill documentation (no page needed)
Multiple sessions (HTTP transport)
Pass --port to serve MCP over HTTP instead of stdio, giving each client an independent browsing session, each on its own thread so sessions run in parallel: lightpanda mcp --port 8000. An initialize call with no Mcp-Session-Id header mints a fresh session and returns its id in the response header; reuse that id on later calls (or share it with another client). Calls with no session header fall back to the always-present default session. Manage sessions explicitly with session_new / session_list / session_close. A session lives until session_close. --http-session-timeout <seconds> also closes idle ones. A call with a timed-out id gets 404: start a new session. An idle default session only loses its pages and keeps its cookies. Over stdio (the Claude Code setup above), there's only ever the one default session, and the session_* tools return "multiple sessions require the HTTP transport (start with --port)". Give a task that reads untrusted content its own session (see Best Practices).
Add --cdp-port <INT> to also run a CDP (WebSocket) server on the same process — useful if something in your workflow needs raw CDP (e.g. Playwright/Puppeteer) alongside MCP. It can't be combined with --port, since both share one network listener.
MCP Usage Example
A typical agent workflow:
gotoa URLtreeormarkdownto understand the pageinteractiveElementsorfindElementto find clickable/fillable elementsclick/fillto interactextractormarkdownto get the result
CLI Fetch — Quick Extraction
For one-off page extraction without starting a server:
lightpanda fetch --dump markdown --wait-until networkidle https://example.com
Options
--dump— Output format:html,markdown(asks the server for markdown first and dumps it as-is when it gets some, logged as "markdown served"; not with--dump-selector,--wait-selector,--wait-scriptor--inject-script),png,pdf,semantic_tree,semantic_tree_text,structured_data(JSON-LD, microdata, OpenGraph, Twitter card, meta and link tags as JSON) (the MCP equivalent ofsemantic_tree*is namedtree)--wait-until— Wait strategy:load(default; none when--wait-selectoror--wait-scriptis set),domcontentloaded,networkalmostidle,networkidle,settled(experimental: load, then the requests and short timers page-load work started),done--wait-ms— Max wait time in milliseconds (default: 5000)--wait-selector— Wait for a CSS selector to appear, checked after--wait-until--wait-script— Wait for a JS expression to return truthy, checked after--wait-until--strip-mode— Remove tag groups from output:js,css,ui,invisible,shell,clutter(comma-separated)--with-frames— Include iframe contents in the dump--dump-selector: Dump only the first element matching a CSS selector; fails if nothing matches--dump-max-bytes: Soft cap on the dumpedhtmlormarkdown; a[truncated]marker is appended--json— Print fetch status as JSON instead of/alongside the dump; required when fetching multiple URLs--markdown-alternate: with--dump markdown, when the page links a markdown version of itself (<link rel="alternate" type="text/markdown">), dump that file instead of converting the page. Falls back to converting when there is no such link or it doesn't load as markdown--inject-script/--inject-script-file— JavaScript to run as the document's<head>is parsed, before any page script runs. Repeatable; runs in CLI order--terminate-ms— Hard deadline in milliseconds; forcibly terminates JS execution after this time (unlike--wait-ms, which only stops waiting)
Flags shared by every command are in Common Options below; the fetch command guide is the complete reference.
Examples
Extract page as markdown:
lightpanda fetch --dump markdown https://example.com
Extract semantic tree (compact, AI-friendly):
lightpanda fetch --dump semantic_tree_text --wait-until networkidle https://example.com
Fetch with longer wait for slow pages:
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
lightpanda serve --host 127.0.0.1 --port 9222
Options:
--cdp-max-connections— Max simultaneous CDP connections (default: 16)--cdp-max-message-size— Max incoming WebSocket message size (default: 1MB)--disable-metrics— Disable the/metricsPrometheus endpoint--advertise-host— Host to advertise in e.g. the/json/versionresponse, useful when--hostis0.0.0.0. It is also the one hostname, besides IP literals andlocalhost, that any request, WebSocket upgrades included, accepts in itsHostheader (e.g. a Docker service name); any other name gets a 403 and the log linerejected request host--remote-allow-origins <origin>: accept thisOriginheader (or*for any) on CDP and BiDi WebSocket upgrades. Repeatable. By default an upgrade that sends anOriginheader gets a 403 and the log linerejected websocket origin; upgrades without one are always accepted--unix-socket <path>: listen on this absolute Unix-domain socket path (mode 0600) instead of TCP. Can't be combined with--host,--portor--advertise-host
Flags shared by every command are in Common Options below; the serve command guide is the complete reference.
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). This snippet only shows what differs from the Playwright example above, so it isn't runnable on its own. Reuse that example's setup and teardown, and swap in these lines instead.
const puppeteer = require('puppeteer-core');
const browser = await puppeteer.connect({
browserWSEndpoint: 'ws://127.0.0.1:9222',
});
const context = await browser.createBrowserContext(); // not newContext()
const page = await context.newPage();
await page.goto('https://example.com', { waitUntil: 'networkidle0' }); // explicit waitUntil — puppeteer doesn't auto-wait like Playwright
Everything else (page.title(), page.close(), context.close(), browser.close()) is identical to the Playwright example.
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:
LP.dump— Render the page, or a subtree, tohtml,markdown,png, orpdf. Params:format(required),strip,selector,backendNodeId,maxBytes(text formats only),withFrames(htmlonly: writes each iframe's document inside its<iframe>)LP.getMarkdown— Deprecated, equivalent toLP.dumpwithformat: "markdown". Params:nodeId(optional)LP.getSemanticTree— Get semantic tree representation. Params:format(textfor text format),prune(default: true),interactiveOnly,backendNodeId,maxDepthLP.getStructuredData— Extract structured data (JSON-LD, microdata, OpenGraph, etc.)
Interactive elements:
LP.getInteractiveElements— Find all interactive elements. Params:nodeId(optional)LP.detectForms— Detect and extract form informationLP.getNodeDetails— Get detailed info about a node. Params:backendNodeId(required)LP.waitForSelector— Wait for a CSS selector match. Params:selector(required),timeout(default: 5000 ms, or 15000 ms before the page reachesload)LP.waitUntil: wait for a load state with no navigation, the same states as--wait-until(settledincluded). Params:until(required),timeout(same default asLP.waitForSelector); fails withTimeout
Actions:
LP.clickNode— Click a node. Params:nodeIdorbackendNodeIdLP.fillNode— Fill an input/select element. Params:nodeIdorbackendNodeId,textLP.scrollNode— Scroll page or element. Params:nodeIdorbackendNodeId(optional),x,y
Debugging & configuration:
LP.getPageStatus: what the last navigation got and what the page lacks:url,httpStatus,botChallenge,navigateError,jsErrors,unsupported(e.g. WebGL),skipped(e.g. iframes),missingGlobals,failed,blocked(403/429 responses),resourceChallengeLP.getContentSignal— Read the current host's advisoryContent-Signalrobots.txt preferences (contentsignals.org).availableis false unless--obey-robotspopulated the store.LP.handleJavaScriptDialog— Pre-arm the response (accept, optionalpromptText) for the nextwindow.alert/confirm/prompt. Lightpanda auto-dismisses dialogs headlessly, so this must be sent before the JS that opens the dialog, not reactively like standard CDP'sPage.handleJavaScriptDialog.LP.configureCDP— Toggle CDP compatibility behaviors. Params:disableSetCacheDisabled,obeyRobots,httpVersion(auto/1.1) (each optional)LP.configureLoading— Toggle iframe, worker, external-stylesheet, image, and beacon loading per session. Params:subFrame,worker,externalStylesheets,images,beacon(each optional)LP.version— Return the running Lightpanda version
Downloads:
LP.downloadDataevent — AfterBrowser.setDownloadBehaviorwithbehavior: "stream"andeventsEnabled: true(a Lightpanda extension), a download comes asLP.downloadDataevents (guid, base64data) instead of a file on disk.Browser.downloadWillBeginadds the download'scontentType
Example using CDP session with Playwright:
const client = await context.newCDPSession(page);
// Get page as markdown
const { content } = await client.send('LP.dump', { format: 'markdown' });
// 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 });
WebDriver Classic and BiDi (Selenium, Puppeteer)
lightpanda serve --protocol webdriver serves classic WebDriver (HTTP, POST /session) and WebDriver BiDi (WebSocket at /session; with Selenium, request it through the webSocketUrl: true capability). Point Selenium at http://127.0.0.1:9222, or Puppeteer at ws://127.0.0.1:9222/session with protocol: 'webDriverBiDi'. Local only, and coverage of both specs is partial: see the Selenium guide.
Lightpanda Cloud
Hosted Lightpanda, no local binary: use it when the agent can't install software or keep a process running, or needs managed proxies. Get a token at console.lightpanda.io, pick the euwest or uswest region, then connect:
- CDP:
wss://euwest.cloud.lightpanda.io/ws?token=TOKEN, the same Playwright/Puppeteer code as above - MCP:
https://euwest.cloud.lightpanda.io/mcp?token=TOKENover Streamable HTTP (a subset of the local tools; stdio-only hosts go throughnpx -y mcp-remote <url>) - HTTP API:
POST https://euwest.cloud.lightpanda.io/api/fetchwithAuthorization: Bearer TOKENand a JSON body like{"url": "...", "output_format": "markdown"}returns one page's HTML or Markdown
See getting started.
Agent Mode and Saved Scripts (PandaScript)
A PandaScript is a plain JavaScript automation script that Lightpanda runs directly — no LLM call, deterministic, token-free. It's the right tool once you've figured out a task once and want to repeat it exactly, e.g. on a schedule.
Three ways to produce one:
- Mid-session, via MCP: call the
savetool with apathand a synthesizedscript— see the tool's own description for the script-writing rules. - One-shot, via CLI:
lightpanda agent --task "..." --save script.jssynthesizes a script from a natural-language task instead of printing the answer. - Interactively:
lightpanda agentstarts a REPL; drive the browser with natural language or slash commands (every MCP tool is also callable as/toolName key=value, e.g./goto url=https://example.com), then/save script.js.
Agent mode needs an LLM API key in the environment (ANTHROPIC_API_KEY, OPENAI_API_KEY, ...; lightpanda help agent lists them) or a local Ollama or llama.cpp server. Without one, --task prints "No API key detected." and exits with code 1, and the bare REPL falls back to slash commands only (--no-llm forces that).
Replay with no LLM involved:
lightpanda run script.js
From an MCP session, the run tool does the same in that session.
For the scripting semantics (primitives, the extraction schema, common errors), see the pandascript skill. It's generated from the runtime's own tool schemas, so it can't drift the way hand-written prose can. The PandaScript guide covers the same ground for a human reading this repo without a skill loaded.
Common Options
Accepted by every command (fetch, serve, mcp, agent, run), not only where each section's examples show them. lightpanda help <command> lists the rest (proxy, TLS, timeouts, storage).
Logging: --log-level (debug/info/warn/error/fatal), --log-format (pretty/logfmt).
Identity:
--user-agent <string>: override the User-Agent header entirely; any value containing "Mozilla" is forbidden, andSec-Ch-Ua: "Lightpanda";v="1"is still sent.--user-agent-suffix <string>instead appends to the defaultLightpanda/X.Y(not combinable with--user-agent).--web-bot-auth-key-file <path>/--web-bot-auth-keyid <thumbprint>/--web-bot-auth-domain <domain>: sign every request with an Ed25519 key so sites can verify your identity against a key directory you publish.
Politeness:
--obey-robots: fetch and obey robots.txt (one fetch per host, cached for the session). Defaults to false.--http-nav-delay <ms>: minimum time between two top-level navigations to the same host.0(default) disables it.--http-nav-burst <n>is how many navigations may start before the delay applies (default1).
Efficiency:
--http-cache-dir <path>: directory used as a filesystem cache for network resources (RFC 9111 revalidation). Omitting it disables caching.--adblock-lists <file>: EasyList-syntax filter files; blocked requests fail before they leave, matched on URL, resource type, party and$domain=. Repeatable.--block-urls "<pattern>": block URLs matching a case-insensitive*-wildcard pattern. Repeatable.--load-resources <type>: sub-resources to actually request (beacon,iframe,image,stylesheet,worker;nonerequests none). Repeatable. Nothing is requested by default, except thatmcpandagentload external stylesheets so visibility checks see the CSS; passing the flag replaces that default.
State:
--cookie <file>: load cookies at startup, from a JSON array in the CDP/Puppeteer format or a Netscapecookies.txt(serve,fetchandmcp).--cookie-jar <file>: write the cookies to a JSON file on exit (fetchandmcp), or when a CDP browser context closes (serve; with several clients, the last to close wins).agentignores both flags.
Security: --block-private-networks: block HTTP requests to private/internal IP addresses after DNS resolution. Defaults to false.
When and why to use each, see Best Practices below.
Important Notes
-
For web searches, use the
searchtool instead of Google. Google blocks Lightpanda due to browser fingerprinting. -
Check the status in
goto's response. A navigation can succeed without loading the requested content:Navigated. HTTP <status>.(e.g.Navigated. HTTP 200 OK.): the page loaded.- "HTTP <status>: this is likely an error or rate-limit page, not the requested content.": the server answered with a 4xx or 5xx page (MCP and agent mode).
- "Blocked by a <kind> bot challenge (HTTP <status>): this is not the requested content.": a bot challenge page (MCP and agent mode).
- "Navigation started (HTTP <status>) but the page did not finish loading before the timeout.": the server answered but the page didn't finish loading; it may still be usable.
- Notes can precede the response, one sentence per thing the page lacks; reads of that page miss the content they name (MCP and agent mode):
- "The page asked for WebGL, which Lightpanda does not provide: anything it renders that way is missing."
- "<n> iframe(s) were not loaded: subframe loading is off."
- "<n> of the page's own request(s) were refused with HTTP 403/429, likely bot detection or rate limiting: content they load is missing."
- "A <kind> bot challenge blocked some of the page's own requests: content they load is missing." (replaces the 403/429 note)
gotofails only when no page arrived: a DNS or connection error (e.g.CouldntResolveHost), orNavigationTimeout: no response arrived before the timeout, so the page is empty. -
CDP connection limits: Up to 16 simultaneous CDP connections per process by default (tune with
--cdp-max-connections). Each connection supports 1 context and up to 16 pages, which share the context's cookies and storage. A secondTarget.createBrowserContextfails with "Cannot have more than one browser context at a time"; a 17th page fails with "Cannot have more than 16 targets at a time". For more parallelism than that, 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.
-
To report an issue, 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
Best Practices
Lightpanda runs exactly the requests you ask for. It's a browser, not a crawler, and has no built-in politeness policy; setting the right behavior is on you. The flags named here are documented in Common Options above; this section is about when each one matters.
Identify your traffic. Operators route, rate-limit, and allowlist traffic they recognize. Recommend an identity for the user to confirm: a name (org, project, or personal handle) plus a URL an operator can check to see what the bot does and reach them (a repo, docs page, or profile). Pass it as --user-agent; don't ship the placeholder below.
lightpanda serve --user-agent "<name>/1.0 (+https://<your-url>)"
A user-agent string is only a claim that anything can send. Web Bot Auth (the --web-bot-auth-* flags) makes it verifiable, and Cloudflare, Akamai, Google, and AWS all check the signature.
Fetching many pages on one host? Turn on --obey-robots and set --http-nav-delay 1000; lower it only when you know the host can take it. A 429 or 503 with Retry-After means even that pace was too fast: honor the header in your own code, since --http-nav-delay won't.
Send fewer requests. The largest win is in the design:
- Prefer a bulk source:
git cloneover walking a web git forge, a documented API over its UI,sitemap.xmlover link discovery. - Cap how deep you follow links and how many URLs you keep per domain. Stay out of infinite URL spaces (calendars, arbitrary diffs, faceted search); a run that wanders in never terminates and looks like an attack while it does.
- Set
--http-cache-dirfor anything that runs more than once; unchanged resources then cost only a revalidation. - Cut trackers and ads with
--adblock-lists/--block-urls. Sub-resources aren't fetched by default (--load-resourcesopts in;mcpandagentload external stylesheets, which--load-resources noneturns off). - Use the
searchtool instead of navigating a search-results page.
Give every task its own browser. A fresh instance carries no leftover cookies or state, and scoping caps the blast radius of a prompt injection from untrusted page content. Add --block-private-networks whenever you follow links a page handed you rather than links you chose. CDP: a new browser or context per task. MCP: stdio mode is one browser for the whole session, so use HTTP mode (--port) when you need a browser per task.
Keep credentials out of the agent's context. Export them as LP_* environment variables before starting Lightpanda, named LP_<SITE>_<FIELD> (e.g. LP_GH_TOKEN), then pass $LP_GH_TOKEN in any tool's string arguments, PandaScript included. Lightpanda substitutes the value itself, so the secret never reaches the model or a saved script.
Once a flow is settled, stop re-deriving it. Capture it as a PandaScript (the Saved Scripts section above) and replay it with lightpanda run: no tokens spent, and failures surface as script errors instead of plausible wrong answers.
Scripts
scripts/install.sh— Install Lightpanda binary
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/lightpanda-io/agent-skill/lightpanda">View lightpanda on skillZs</a>