Playwright Slim
БесплатноНе проверенA proxy MCP server that summarizes Playwright accessibility snapshots using Claude Haiku, reducing context usage for efficient browser automation.
Описание
A proxy MCP server that summarizes Playwright accessibility snapshots using Claude Haiku, reducing context usage for efficient browser automation.
README
A proxy MCP server for Playwright that summarizes accessibility snapshots using Claude Haiku to reduce context usage.
Quickstart
Add to your Claude Code MCP config (~/.claude.json):
{
"mcpServers": {
"playwright-slim": {
"command": "npx",
"args": ["playwright-slim-mcp"],
"env": {
"ANTHROPIC_API_KEY": "sk-ant-..."
}
}
}
}
That's it! The proxy will automatically download and run.
Problem
The official @playwright/mcp returns full accessibility tree snapshots after every action (click, type, navigate, etc.). These snapshots can be 2-10KB+ each, quickly consuming context window.
Solution
This proxy:
- Forwards all requests to the real Playwright MCP
- Intercepts responses containing page snapshots
- Uses Anthropic API (Claude Haiku) to summarize snapshots to ~10 lines
- Preserves
[ref=XXX]values for interactive elements so you can still click/type
Installation
Via npx (recommended)
No installation needed - just add to your MCP config as shown in Quickstart.
Global install
npm install -g playwright-slim-mcp
Then use in your MCP config:
{
"mcpServers": {
"playwright-slim": {
"command": "playwright-slim-mcp",
"env": {
"ANTHROPIC_API_KEY": "sk-ant-..."
}
}
}
}
From source
git clone https://github.com/jsdf/playwright-slim-mcp.git
cd playwright-slim-mcp
npm install
npm run build
Requirements
ANTHROPIC_API_KEYenvironment variable- Node.js 18+
Environment Variables
| Variable | Required | Description |
|---|---|---|
ANTHROPIC_API_KEY |
Yes | Your Anthropic API key |
PLAYWRIGHT_SLIM_MODEL |
No | Model for summarization (default: claude-3-5-haiku-latest) |
DEBUG or PLAYWRIGHT_SLIM_DEBUG |
No | Set to 1 to enable file logging to logs/ |
Configuration
The proxy summarizes snapshots for these tools:
browser_clickbrowser_typebrowser_press_keybrowser_select_optionbrowser_hoverbrowser_dragbrowser_navigatebrowser_navigate_backbrowser_handle_dialogbrowser_file_uploadbrowser_fill_formbrowser_snapshot
Small snapshots (<500 chars) are passed through unchanged.
Unsummarized Snapshots
Use browser_snapshot_full to get the raw accessibility tree without summarization. This tool is automatically added as an alias.
Testing
# Create .env file with your API key
echo "ANTHROPIC_API_KEY=sk-ant-..." > .env
# Run tests (includes real API calls and browser tests)
npm test
Example
Before (2KB+):
- generic [ref=e327]:
- generic [ref=e328]:
- heading "Go back James's Workspace" [level=4] [ref=e329]:
- button "Go back" [ref=e330] [cursor=pointer]:
- img [ref=e331]
- text: James's Workspace
# ... 100+ more lines
After (~200 bytes):
Admin settings for "James's Workspace"
Tabs: Overview [e343], Feature flags [e348, selected], Members [e353], Tables [e358]
Actions: Go back [e330], Impersonate [e334]
License
MIT
Установить Playwright Slim в Claude Desktop, Claude Code, Cursor
unyly install playwright-slim-mcpСтавит в Claude Desktop, Claude Code, Cursor и VS Code — сам разбирается с npx, uvx и сборкой из исходников.
Впервые? Поставь CLI: curl -fsSL https://unyly.org/install | sh
Или настроить вручную
Выполни в терминале:
claude mcp add playwright-slim-mcp -- npx -y playwright-slim-mcpFAQ
Playwright Slim MCP бесплатный?
Да, Playwright Slim MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Playwright Slim?
Нет, Playwright Slim работает без API-ключей и переменных окружения.
Playwright Slim — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Playwright Slim в Claude Desktop, Claude Code или Cursor?
Открой Playwright Slim на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
Playwright
Browser automation, scraping, screenshots
автор: MicrosoftPuppeteer
Browser automation and web scraping.
автор: modelcontextprotocolopentabs-dev/opentabs
Plugin-based MCP server + Chrome extension that gives AI agents access to web applications through the user's authenticated browser session. 100+ plugins with a
автор: opentabs-devrobhunter/agentdeals
1,500+ developer infrastructure deals, free tiers, and startup programs across 54 categories. Search deals, compare vendors, plan stacks, and track pricing chan
автор: robhunterCompare Playwright Slim with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории browse
