-
Notifications
You must be signed in to change notification settings - Fork 613
Description
Is your feature request related to a problem? Please describe.
The dimensions of the browser window/viewport by default is quite small, so complex web projects are more difficult to navigate due to limited space, and screenshots of the small window hide some parts of the UI due to scrollbars.
There is the resize_page
tool which can be triggered via a prompt.
The resize_page
tool is interesting if the AI is implementing some responsive UI and and ensuring it works, but there's a lot of use cases where during normal development you test a few main browser window sizes consistently.
Describe the solution you'd like
Would be nice to be able to configure the viewport programmatically as a MCP server configuration option.
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": [
"chrome-devtools-mcp@latest",
"--headless=true",
"--viewport=1440x900", // <-- Set the initial viewport dimensions
]
}
}
}
Especially for teams using Cursor, where a .cursor/mcp.json
file can be stored in the project for all team members to have consistent MCP server configuration. Because it would be programmatic, there's no risk that the Cursor rule about the custom viewport is ignored by the LLM when the tool session starts.
Future consideration could be given to help projects where they have 2-3 viewport sizes they often want to test. Could they comma-separate viewport args
, and then multiple Chrome instances are used? Or it assumes always the first viewport in the list unless you prompt it to "test responsively" for example?
Describe alternatives you've considered
It's not super clear from the README, but would the current recommended approach be to use an always-applied Cursor rule (prompt), and suggest that the AI should use the resize_page
tool whenever it uses the Chrome DevTools MCP? Risk that the LLM just ignores or forgets to do what you asked.
And is the vision that there would be more Puppeteer-level configuration options added as tools
to this MCP server? There's 26 tools
already, which at least with current models is quite high and often takes up a good chunk of input tokens. But context windows continue to increase, with prices generally decreasing.
Additional context
Playwright's MCP server supports some Playwright-level options via MCP server configuration args
: https://github.com/microsoft/playwright-mcp?tab=readme-ov-file#configuration. In their case they call this --viewport-size <size>
; i.e. --viewport-size=1280x720
.