Skip to content

feat(mcp): add --mobile emulation and plumb --device through the CLI#41657

Merged
pavelfeldman merged 1 commit into
microsoft:mainfrom
pavelfeldman:feat-cli-mobile-device
Jul 7, 2026
Merged

feat(mcp): add --mobile emulation and plumb --device through the CLI#41657
pavelfeldman merged 1 commit into
microsoft:mainfrom
pavelfeldman:feat-cli-mobile-device

Conversation

@pavelfeldman

Copy link
Copy Markdown
Member

Summary

  • Add a --mobile flag that emulates a generic recent mobile device by browser family: Pixel 10 (Chromium) / iPhone 17 (WebKit). Mobile pages are usually lighter, so snapshots are smaller and cheaper.
  • Expose it on both the MCP server (playwright mcp --mobile) and the agent CLI (playwright-cli open --mobile).
  • Plumb --device through the agent CLI open command (it previously only existed on the MCP server), and advertise both options in the skill.

Add a --mobile flag that emulates a generic recent mobile device based
on the browser family (Pixel 10 for Chromium, iPhone 17 for WebKit).
Mobile pages are usually lighter, so snapshots are smaller and cheaper.
Available on the MCP server and the agent CLI (playwright-cli open).

Also plumb --device through the agent CLI open command, which previously
only existed on the MCP server, and advertise both in the skill.
if (device)
throw new Error('Cannot use --mobile together with --device, pick one.');
if (browserName === 'firefox')
throw new Error('--mobile is not supported with the Firefox browser.');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might actually be able to enable this

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Test results for "MCP"

3 failed
❌ [firefox] › mcp/annotate.spec.ts:230 › should capture annotations via show --annotate @mcp-macos-latest-firefox
❌ [firefox] › mcp/annotate.spec.ts:497 › should disengage annotate mode when --annotate client disconnects @mcp-macos-latest-firefox
❌ [webkit] › mcp/annotate.spec.ts:447 › should switch screencast to -s session on show --annotate @mcp-macos-latest-webkit

7677 passed, 1225 skipped


Merge workflow run.

@pavelfeldman pavelfeldman merged commit 5de1365 into microsoft:main Jul 7, 2026
16 of 18 checks passed
yury-s added a commit to microsoft/playwright-mcp that referenced this pull request Jul 9, 2026
## What's New

### New Tools

- **`browser_find`** — Search the accessibility snapshot of the current
page for text or a regular expression. Returns matching snapshot nodes
with a few lines of surrounding context (like search snippets), which is
cheaper than capturing the whole snapshot when you only need to locate
an element and its ref
([#41605](microsoft/playwright#41605),
[#41654](microsoft/playwright#41654))

### Tool Improvements

- **Less verbose snapshots** — Accessibility snapshots are distilled to
reduce noise and token usage
([#41604](microsoft/playwright#41604))
- **Mobile & device emulation** — New `--mobile` flag and `--device`
option to emulate mobile devices from the CLI
([#41657](microsoft/playwright#41657))
- **Navigation status** — `browser_navigate` now surfaces non-2xx
navigation status codes
([#41589](microsoft/playwright#41589))

## Bug Fixes

- Enable the chromium sandbox for the default browser
([#41652](microsoft/playwright#41652))
- Close the isolated HTTP client context on disconnect
([#41560](microsoft/playwright#41560))
- Wait for the client event stream before sending server→client requests
([#41559](microsoft/playwright#41559))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants