browsegrab
browsegrab
로컬 LLM을 위한 토큰 효율적인 브라우저 에이전트 — Playwright + 접근성 트리 + MarkGrab, MCP 네이티브.
browsegrab은 로컬 LLM(8B-35B 파라미터)을 위해 설계된 경량 브라우저 자동화 라이브러리입니다. Playwright의 접근성 트리와 MarkGrab의 HTML-to-마크다운 변환을 결합하여 browser-use와 같은 대안 대비 단계당 5-8배 적은 토큰을 사용합니다.
주요 기능
토큰 효율성: 단계당 약 500-1,500 토큰 (browser-use의 4,000-10,000 토큰 대비)
로컬 LLM 우선: vLLM, Ollama 및 OpenAI 호환 엔드포인트에 최적화
MCP 네이티브: 8가지 브라우저 자동화 도구가 포함된 내장 MCP 서버
MarkGrab 통합: HTML → 콘텐츠 추출을 위한 깔끔한 마크다운 변환
접근성 트리 + 참조 시스템: 비전 모델 없이도 안정적인 요소 참조(
e1,e2, ...) 제공성공 패턴 캐싱: 반복되는 워크플로우에서 LLM 호출 제로화
5단계 JSON 파서: 로컬 LLM 출력을 위한 강력한 액션 파싱
최소한의 의존성: 핵심 기능에
playwright+httpx만 사용
Related MCP server: Playwright MCP
설치
pip install browsegrab
playwright install chromium선택적 기능 포함:
pip install browsegrab[mcp] # MCP server support
pip install browsegrab[content] # MarkGrab content extraction
pip install browsegrab[cli] # CLI with rich output
pip install browsegrab[all] # Everything빠른 시작
Python API
from browsegrab import BrowseSession
async with BrowseSession() as session:
# Navigate and get accessibility tree snapshot
await session.navigate("https://example.com")
snap = await session.snapshot()
print(snap.tree_text)
# - heading "Example Domain" [level=1]
# - link "Learn more": [ref=e1]
# Click using ref ID
result = await session.click("e1")
print(result.url) # https://www.iana.org/help/example-domains
# Type into search box
await session.navigate("https://en.wikipedia.org")
snap = await session.snapshot()
await session.type("e4", "Python programming", submit=True)
# Extract compressed content (AX tree + markdown)
content = await session.extract_content()CLI
# Accessibility tree snapshot
browsegrab snapshot https://example.com
# JSON output
browsegrab snapshot https://example.com -f json
# Extract content (AX tree + markdown)
browsegrab extract https://en.wikipedia.org/wiki/Python
# Agentic browse (requires LLM endpoint)
browsegrab browse https://example.com "Find the about page"MCP 서버
browsegrab-mcp # Start MCP server (stdio)Claude Desktop / Cursor / VS Code 설정:
{
"mcpServers": {
"browsegrab": {
"command": "browsegrab-mcp"
}
}
}8가지 MCP 도구: browser_navigate, browser_click, browser_type, browser_snapshot, browser_scroll, browser_extract_content, browser_go_back, browser_wait
작동 원리
에이전트 브라우징 루프
flowchart LR
A["🌐 URL + Goal"] --> B["Navigate"]
B --> C["AX Tree Snapshot\n~200–500 tokens"]
C --> D{"LLM\nDecision"}
D -->|"click / type / scroll"| E["Execute Action"]
E --> C
D -->|"goal reached"| F["Extract Content\n(MarkGrab)"]
F --> G["✅ Result"]토큰 효율성
browsegrab은 구조(접근성 트리)와 콘텐츠(MarkGrab 마크다운)를 분리하여 LLM이 필요한 정보만 전송합니다:
flowchart TD
A["Raw HTML"] --> B["Accessibility Tree"]
A --> C["MarkGrab Markdown"]
B --> D["Structure: ~200–500 tokens\nInteractive elements with ref IDs"]
C --> E["Content: ~300–800 tokens\nClean markdown · on-demand"]
D --> F["Combined: ~500–1,300 tokens/step\n⚡ 5–8× fewer than browser-use"]
E --> F토큰 효율성 (측정치)
페이지 | 상호작용 요소 | 토큰 | browser-use 대응치 |
example.com | 1 | ~60 | ~500+ |
Wikipedia 문서 | 452 | ~1,254 | ~10,000+ |
아키텍처
browsegrab/
├── config.py # Dataclass configs (env var loading)
├── result.py # Result types (ActionResult, BrowseResult, ...)
├── session.py # BrowseSession orchestrator
├── browser/
│ ├── manager.py # Playwright lifecycle (async context manager)
│ ├── snapshot.py # Accessibility tree + ref system
│ ├── selectors.py # 4-strategy selector resolver
│ └── actions.py # navigate, click, type, scroll, go_back, wait
├── dom/
│ ├── ref_map.py # ref ID ↔ element bidirectional mapping
│ └── compress.py # AX tree + MarkGrab → compressed context
├── llm/
│ ├── base.py # LLMProvider ABC
│ ├── provider.py # vLLM, Ollama, OpenAI-compatible
│ ├── prompt.py # System prompts (~400 tokens)
│ └── parse.py # 5-stage JSON fallback parser
├── agent/
│ ├── history.py # Sliding window history compression
│ ├── cache.py # Domain-based success pattern cache
│ └── loop_guard.py # Duplicate action detection
├── __main__.py # CLI (click)
└── mcp_server.py # FastMCP server (8 tools)설정
모든 설정은 환경 변수(BROWSEGRAB_* 접두사)를 통해 수행됩니다:
# Browser
BROWSEGRAB_BROWSER_HEADLESS=true
BROWSEGRAB_BROWSER_TIMEOUT_MS=30000
# LLM (for agentic browse)
BROWSEGRAB_LLM_PROVIDER=vllm # vllm | ollama | openai
BROWSEGRAB_LLM_BASE_URL=http://localhost:8000/v1
BROWSEGRAB_LLM_MODEL=Qwen/Qwen3.5-32B-AWQ
# Agent
BROWSEGRAB_AGENT_MAX_STEPS=10
BROWSEGRAB_AGENT_ENABLE_CACHE=trueQuartzUnit 생태계의 일부
라이브러리 | 역할 |
수동 추출 (URL → 마크다운) | |
수동 캡처 (URL → 스크린샷) | |
문서 OCR → 구조화된 JSON | |
browsegrab | 능동 자동화 (목표 → 브라우저 액션 → 결과) |
개발
git clone https://github.com/QuartzUnit/browsegrab.git
cd browsegrab
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
playwright install chromium
# Unit tests (no browser needed)
pytest tests/ -m "not e2e"
# Full suite including E2E
pytest tests/ -v라이선스
QuartzUnit 생태계의 일부 — 데이터 수집, 추출, 검색 및 AI 에이전트 안전을 위한 구성 가능한 Python 라이브러리입니다.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityCmaintenanceA server that enables AI assistants to control a browser through tools, allowing them to perform web automation tasks like navigation, typing, clicking, and taking screenshots.
- AlicenseAqualityDmaintenanceA server that provides browser automation capabilities using Playwright, enabling LLMs to interact with web pages through structured accessibility snapshots without requiring screenshots or vision models.224,819,8221Apache 2.0
- Alicense-qualityFmaintenanceThis server provides browser automation capabilities using Playwright, allowing LLMs to interact with web pages through structured accessibility snapshots. It enables tasks like web navigation, form filling, and data extraction without the need for screenshots or vision-tuned models.7,6234Apache 2.0
- Alicense-qualityDmaintenanceA Model Context Protocol server that provides browser automation capabilities by allowing LLMs to interact with web pages through structured accessibility snapshots. It enables fast, lightweight interaction with web content without the need for vision-tuned models or visual processing.Apache 2.0
Related MCP Connectors
AI-powered browser automation — navigate, click, fill forms, and extract data from any website.
E2LLM gives your AI eyes and hands in a real browser: structured perception (SiFR) plus action.
Reliable web access for AI agents: smart HTTP, rotating proxies, and full-browser rendering.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/QuartzUnit/browsegrab'
If you have feedback or need assistance with the MCP directory API, please join our Discord server