mcp_playwright
暂无简介
- License 许可
- AGPL-3.0
- 所属仓库
- 0xwi11iam/Suijin
- 最近更新
- 2026-11-14
- Stars
- ★ 24
- Forks
- 4
02 资源文件 5
- 脚本__init__.py50 B
- 脚本entry.py2.3 KB
- 脚本main.py34.7 KB
- 参考文档manifest.json5.8 KB
- 参考文档plugin.json713 B
03 SKILL.md 正文
MCP Playwright — AI Browser Automation
Headless Chromium browser for JS-rendered pages, SPA interaction, form filling, screenshot capture.
WORKFLOW
- Navigate to the target page.
- Snapshot to see all interactive elements with index numbers.
- Click/Type by referencing snapshot indices (most reliable).
- Extract text or Screenshot to capture results.
- Close the browser when done.
TOOL REFERENCE
Navigate
{"tool": "mcp_browser_goto", "args": {"url": "https://target.com/login"}}
Snapshot (GET INTERACTIVE ELEMENTS — use this BEFORE clicking/typing)
{"tool": "mcp_browser_snapshot", "args": {}}
Returns a numbered list like:
[ 1] BUTTON "Log in"
[ 2] INPUT "Email" type=email
[ 3] INPUT "Password" type=password
[ 4] LINK "Forgot password?"
Use the index numbers [N] in click/type commands.
Click (by index, selector, or text)
{"tool": "mcp_browser_click", "args": {"selector": "1"}}
{"tool": "mcp_browser_click", "args": {"selector": "#login-btn"}}
{"tool": "mcp_browser_click", "args": {"selector": "Log in"}}
Type (by index or selector)
{"tool": "mcp_browser_type", "args": {"selector": "2", "text": "admin@test.com"}}
{"tool": "mcp_browser_type", "args": {"selector": "3", "text": "password123"}}
Screenshot
{"tool": "mcp_browser_screenshot", "args": {}}
Saves to /tmp/suijin_screenshot.png
Extract Text
{"tool": "mcp_browser_extract", "args": {"selector": "body"}}
{"tool": "mcp_browser_extract", "args": {"selector": "#error-message"}}
Execute JavaScript
{"tool": "mcp_browser_exec", "args": {"js_code": "document.cookie"}}
Get Full HTML
{"tool": "mcp_browser_get_html", "args": {}}
Close Browser
{"tool": "mcp_browser_close", "args": {}}
BEST PRACTICES
- ALWAYS call snapshot BEFORE clicking or typing to get current element indices.
- Click by index [N] is more reliable than text matching.
- After clicking, call snapshot again to see the new page state.
- For SPAs, use extract to get visible text rather than get_html (too large).
- Close the browser when done to free memory.
Install: pip install playwright && playwright install chromium
04 同仓库更多 Skills
WSTG Session Management Testing
Test session tokens for entropy, predictability, fixation, logout, timeout, cookie scope
WSTG Information Gathering
Systematic information gathering: search engine discovery, web server fingerprinting, review page content for info leaka
WSTG Identity & Authentication Testing
Test credential encryption in transit, authentication bypass, weak lockout, password reset, security question, multi-fac
WSTG Error Handling Testing
Test for stack traces, verbose errors, CWE search, improper error handling
WSTG Data Validation Testing
Test reflected/stored/DOM XSS, SQL injection, LDAP injection, ORM injection, command injection, format string
WSTG Cryptography Testing
Test for weak SSL/TLS, padding oracle, weak encryption, clear-text transmission