P

Playwright MCP Server

Full browser automation through MCP using Playwright. Navigate pages, interact with elements, fill forms, take screenshots, and run accessibility checks — all from within Claude Code conversations.

MCPCommunitytestingv1.0.0Apache-2.0
0 views0 copies

MCP Server Configuration

{ "mcpServers": { "playwright": { "command": "npx", "args": ["-y", "@playwright/mcp@latest"] } } }

With Headed Browser (Visible)

{ "mcpServers": { "playwright": { "command": "npx", "args": ["-y", "@playwright/mcp@latest", "--headed"] } } }

With Specific Browser

{ "mcpServers": { "playwright": { "command": "npx", "args": ["-y", "@playwright/mcp@latest", "--browser", "firefox"] } } }

Available Tools

ToolDescription
browser_navigateNavigate to a URL
browser_go_backGo back in history
browser_go_forwardGo forward in history
browser_waitWait for a specified time

Interaction

ToolDescription
browser_clickClick an element (by text, selector, or coordinates)
browser_typeType text into an input field
browser_select_optionSelect dropdown option
browser_hoverHover over an element
browser_press_keyPress keyboard key
browser_dragDrag element to target

Content

ToolDescription
browser_snapshotGet page accessibility snapshot (structured)
browser_take_screenshotCapture screenshot as image
browser_console_messagesGet browser console output
browser_get_textExtract text content from page

Tabs

ToolDescription
browser_tab_listList all open tabs
browser_tab_newOpen a new tab
browser_tab_selectSwitch to a tab
browser_tab_closeClose a tab

Advanced

ToolDescription
browser_file_uploadUpload files to file input
browser_handle_dialogAccept or dismiss browser dialogs
browser_installInstall browser binaries

Setup

  1. Add the configuration to .claude/settings.json
  2. Browser binaries install automatically on first use
  3. Or pre-install: npx playwright install chromium
  4. No API keys required

Common Workflows

# Test a login flow
1. browser_navigate: { url: "http://localhost:3000/login" }
2. browser_type: { selector: "#email", text: "[email protected]" }
3. browser_type: { selector: "#password", text: "password" }
4. browser_click: { selector: "button[type=submit]" }
5. browser_snapshot: {}  — Verify dashboard loaded
6. browser_take_screenshot: {}  — Visual verification

Security Notes

  • Browser runs locally — no remote browser farms
  • Headless by default — use --headed only for debugging
  • Be cautious with auto-filled credentials in browser sessions
  • Screenshots may capture sensitive data — handle with care
  • Browser sessions are isolated per conversation
  • No persistent cookies or cache between sessions
Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates