Seamless integration between Claude Code and Playwright MCP for efficient browser automation and testing
Claude Playwright provides 32 browser automation tools with generally clear naming conventions (verb_noun pattern: launch_browser, click_element, fill_text). All tools have descriptions and input schemas are present. However, schema completeness varies significantly: most parameters are documented, but output schemas are absent from the source code, the server returns structured MCP responses but tool output documentation is not visible. Descriptions are brief (averaging 60-90 characters) and task-focused but lack the expanded context that would help LLMs disambiguate between similar tools (e.g., navigate_to vs go_back vs go_forward, or click_element vs hover_element). Error handling guidance is minimal, tools do not indicate which errors are retryable, user-fixable, or fatal. No tool indicates idempotency, read-only status, or destructive intent via annotations. Session management tools (save_session, load_session) and state-modifying tools (fill_text, execute_script) lack explicit permission/scope declarations. The tool suite is well-scoped to Playwright's capabilities, but several tools could be combined (e.g., fill_form with submit) or split for clarity (e.g., find_elements should distinguish from click_element). Parameter naming is consistent and mostly self-documenting, but some parameters like 'optionValue' in select_option lack clarity on whether it expects the option's text label or its value attribute.
Check a checkbox element
Check if an element is visible on the page
Clear text from an input field
Click an element on the page using a selector or fallback strategies
Close the browser and cleanup resources
Execute JavaScript code in the page context
Fill multiple form fields at once
Fill an input field with text
Find all elements matching a selector
Output schemas not documented in source code. While tools return structured responses (ConsoleMessageEntry, NetworkRequestEntry, etc.), the tool registration does not show explicit output schema declarations that an LLM can parse to understand what fields to expect.
No tool annotations (readOnlyHint, destructiveHint, idempotentHint) visible in registration. This prevents LLMs from understanding which tools are safe to retry, which modify state, and which can be called repeatedly without side effects.
Error handling lacks recovery guidance. Error responses do not indicate whether failures are retryable, user-fixable, or fatal. For example, if 'selector not found' fails, the LLM does not know whether to retry, take a screenshot to debug, or adjust the selector.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | D | 58 | <=2025-11-25 | v2 |
| 2026-03-09 | F | 0 | - | v1 |
Get an attribute value from an element
Get all console messages logged during the session
Get the current page URL
Get all network requests and responses captured
Get the full HTML content of the current page
Get performance and page metrics
Get the current page title
Get text content from an element
Navigate back in browser history
Navigate forward in browser history
Hover over an element on the page
Launch a Chromium browser instance with optional session loading
Load a previously saved browser session
Navigate to a URL in the current page
Press a keyboard key
Refresh the current page
Save the current browser session (cookies, localStorage) with a given name
Take a screenshot of the current page
Scroll to an element on the page
Select an option from a dropdown/select element
Uncheck a checkbox element
Upload a file through a file input element
Wait for an element to appear on the page
Parameter ambiguities in several tools. 'optionValue' in select_option does not clarify whether it expects the option's visible text or its value attribute. 'script' in execute_script lacks guidance on scope (page context vs Node.js). 'filePath' in upload_file does not specify whether it must be absolute or can be relative.
Session management tools (save_session, load_session) lack scope/permission declarations. No indication of what permissions an agent needs to call these tools, or which data they expose/modify.
Navigation tools (navigate_to, go_back, go_forward) are closely related but lack clear guidance on when to use each. LLMs may waste reasoning cycles choosing between similar tools.