# AI use cases for Browser (lightpanda-io/browser)

Repo: [lightpanda-io/browser](https://github.com/lightpanda-io/browser) | Use cases: 3 | Page: https://dedupedai.com/use-cases/lightpanda-io-browser/

Lightpanda is a headless browser written from scratch in Zig for AI agents and automation, not a Chromium fork. It can dump pages as HTML, markdown, PNG, PDF or structured data, serves CDP and WebDriver BiDi so Puppeteer and Playwright scripts can connect, and has a native agent mode and MCP server. The README benchmark shows about 16x less memory and 9x faster than headless Chrome on 100 pages.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Convert web pages to markdown for an LLM: https://dedupedai.com/use-cases/lightpanda-io-browser/convert-pages-to-markdown-for-llms-with-lightpanda/
- Run existing Puppeteer scripts on a lighter Browser: https://dedupedai.com/use-cases/lightpanda-io-browser/run-puppeteer-scripts-on-lightpanda-over-cdp/
- Give an AI agent a Browser through MCP or agent mode: https://dedupedai.com/use-cases/lightpanda-io-browser/give-an-ai-agent-a-browser-with-lightpanda-mcp/

## How to convert web pages to markdown for an LLM with Browser

Repo: [lightpanda-io/browser](https://github.com/lightpanda-io/browser) | Difficulty: Beginner | Time: 20 minutes | Basis: From the README

Use lightpanda fetch to render a page, run its JavaScript, and dump clean markdown or structured data while obeying robots.txt.

**Who it is for:** A developer feeding web pages into a RAG pipeline or agent.

**The problem:** Raw HTML is noisy and launching full Chrome for each page is heavy.

**The outcome:** Markdown or JSON of a page, produced from the command line.

### Steps

1. Install with `brew install lightpanda-io/browser/lightpanda`, or download the nightly binary and check it with `./lightpanda version`
2. Dump a page with `./lightpanda fetch --obey-robots --dump html --log-format pretty  --log-level info https://demo-browser.lightpanda.io/campfire-commerce/`
3. Swap in `--dump markdown` for markdown, or `--dump structured_data` for JSON-LD, OpenGraph and meta tags
4. Use `--wait-selector` or `--wait-ms` when content loads late

### Prompt to paste into your agent

```text
Using lightpanda-io/browser, run lightpanda fetch with --obey-robots and --dump markdown on each URL in <my list> and save one markdown file per page.
```

### Caveat

Downloads are nightly builds, so pin a version for production.

Risk, privacy: Lightpanda sends usage telemetry by default; set LIGHTPANDA_DISABLE_TELEMETRY=true to turn it off.

Risk, legal: Respect site terms and robots.txt; keep --obey-robots on.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/lightpanda-io-browser/convert-pages-to-markdown-for-llms-with-lightpanda/

## How to run existing Puppeteer scripts on a lighter Browser with Browser

Repo: [lightpanda-io/browser](https://github.com/lightpanda-io/browser) | Difficulty: Intermediate | Time: 1 hour | Basis: From the README

Start the Lightpanda CDP server and point puppeteer.connect at it, keeping the rest of your script the same.

**Who it is for:** A team paying for memory hungry headless Chrome fleets.

**The problem:** Headless Chrome uses gigabytes of memory per batch of pages.

**The outcome:** Your Puppeteer script running against Lightpanda on port 9222.

### Steps

1. Install Lightpanda, or run it in Docker with `docker run -d --name lightpanda -p 127.0.0.1:9222:9222 lightpanda/browser:latest`
2. Start the server with `./lightpanda serve --obey-robots --log-format pretty  --log-level info --host 127.0.0.1 --port 9222`
3. In your script, call puppeteer.connect with browserWSEndpoint ws://127.0.0.1:9222 instead of launching Chrome
4. Use `--protocol webdriver` if your client needs WebDriver BiDi

### Prompt to paste into your agent

```text
With lightpanda-io/browser, start the CDP server on 127.0.0.1:9222 and change <my Puppeteer script> to connect with browserWSEndpoint, then compare its run time against Chrome.
```

### Caveat

Lightpanda implements a growing subset of web APIs, so test pages that rely on unusual Browser features.

Risk, security: Bind the CDP port to 127.0.0.1 as the README does; an exposed CDP port lets anyone drive the Browser.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/lightpanda-io-browser/run-puppeteer-scripts-on-lightpanda-over-cdp/

## How to give an AI agent a Browser through MCP or agent mode with Browser

Repo: [lightpanda-io/browser](https://github.com/lightpanda-io/browser) | Difficulty: Intermediate | Time: 45 minutes | Basis: From the README

Add Lightpanda as an MCP server for your coding agent, or use lightpanda agent to describe a task in plain English and save it as a replayable script.

**Who it is for:** Developers building agents that need to read and click through websites.

**The problem:** Agent browsing with full Chrome is slow and costs tokens on every replay.

**The outcome:** An agent tool that browses pages, plus a token free PandaScript you can rerun.

### Steps

1. Add an mcpServers entry named lightpanda with command set to the lightpanda path and args ["mcp"]
2. Or try agent mode with `./lightpanda agent --task "top story on news.ycombinator.com?"`, which auto detects an API key from the environment
3. Run `/save` in a session to export a PandaScript, then replay it with `./lightpanda run session.js`
4. For several agents, start `lightpanda mcp --port 9223` so each connection gets its own browsing session

### Prompt to paste into your agent

```text
Using lightpanda-io/browser, add the lightpanda MCP server to my agent config, then use it to open <a page> and extract its title and links.
```

### Caveat

Use `--no-llm` for a plain REPL without any model.

Risk, credentials: Agent mode reads model API keys from your environment; scope them and watch usage.

Risk, cost: LLM calls in agent mode cost tokens; replaying saved scripts does not.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/lightpanda-io-browser/give-an-ai-agent-a-browser-with-lightpanda-mcp/
