You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Add Save to File for take_snapshot and evaluate_script tools #153
Is your feature request related to a problem? Please describe.
I am unable to save off screenshots using the chrome-devtools-mcp server. Sometimes I also get too many token errors on tool results.
Describe the solution you'd like
Add a save to file optional parameter to tools that return images (take_screenshot) or large amounts of data (take_snapshot, evaluate_script) .
The mcp-chrome server (and several others) supports saving images as files using the asPng optional parameter.
{
name: TOOL_NAMES.BROWSER.SCREENSHOT,description:'Take a screenshot of the current page or a specific element(if you want to see the page, recommend to use chrome_get_web_content first)',inputSchema: {type: 'object',properties: {name: { type: 'string', description: 'Name for the screenshot, if saving as PNG' },
selector: { type: 'string', description: 'CSS selector for element to screenshot' },width: { type: 'number', description: 'Width in pixels (default: 800)' },height: { type: 'number', description: 'Height in pixels (default: 600)' },storeBase64: {type: 'boolean',description:'return screenshot in base64 format (default: false) if you want to see the page, recommend set this to be true',},fullPage: {type: 'boolean',description: 'Store screenshot of the entire page (default: true)',},savePng: {type: 'boolean',description:'Save screenshot as PNG file (default: true),if you want to see the page, recommend set this to be false, and set storeBase64 to be true',},},required: [],},},
Describe alternatives you've considered
Claude code can't (or won't) let me save the [Image] data returned from the tool call to take_screenshot...
Additional context
The mcp-chrome server (and others) also support returning images as base 64 content using the storeBase64 optional parameter.
changed the title [-]Add save to file to screenshot and other tools[/-][+]Feature Request: Add Save to File for Screenshot and Other Tool Calls[/+]on Sep 25, 2025
changed the title [-]Feature Request: Add Save to File for Screenshot and Other Tool Calls[/-][+]Feature Request: Add Save to File for take_snapshot and evaluate_script tools[/+]on Sep 30, 2025
Should we also consider adding the JS file path as an input parameter for evaluate_script? I've found that instead of having the large model temporarily write a lot of repetitive code, it's better to fix the JS file locally and let it be directly read and transferred. This can reduce token consumption.
Could you please file a separate feature request for this? and perhaps explain in more details what kind of scripts does your use case require?
@sebastianbenz I believe there may be some confusion - I've worked on the original issue #153 (adding filePath parameter to save evaluate_script and take_snapshot output to file), not the separate suggestion from @xubaifuCode about JS file input.
Reducing token consumption when dealing with large script outputs or snapshots
Handling data that exceeds MCP size limits
I've already submitted PR #248 with the implementation following the same pattern as take_screenshot's filePath parameter. Happy to discuss the approach or add more context if needed.
Adding a data point for the "too many tokens" part of this request.
A single take_snapshot of a long page (the Python article on English Wikipedia, Chrome DevTools MCP 1.11.0, 2026-10-22) was 427,400 characters, about 208,926 Claude tokens. Claude Code already refuses results that large and writes them to a file itself, so the task still finished there. Other clients would send the whole snapshot to the model, at about $1.65 per call on Opus 5.5.
A filePath option (as in #248) would make that behavior available in every client.
Activity
[-]Add save to file to screenshot and other tools[/-][+]Feature Request: Add Save to File for Screenshot and Other Tool Calls[/+]OrKoN commentedon Sep 26, 2025
I think it makes sense to have this. What we currently do:
Note that the feature request is also about saving script output to file so it only partially overlaps with #152.
natorion commentedon Sep 26, 2025
There is still the open question if its not the MCP client's job to handle such interactions properly.
feat(screenshot): adds ability to output screenshot to a specific path.
feat(screenshot): adds ability to output screenshot to a specific path.
feat(screenshot): adds ability to output screenshot to a specific path.
feat(screenshot): adds ability to output screenshot to a specific path.
feat(screenshot): adds ability to output screenshot to a specific path.
OrKoN commentedon Sep 30, 2025
The part about saving screenshots to file was merged but saving script output to file is still to do.
[-]Feature Request: Add Save to File for Screenshot and Other Tool Calls[/-][+]Feature Request: Add Save to File for take_snapshot and evaluate_script tools[/+]feat(screenshot): adds ability to output screenshot to a specific pat… (
1 remaining item
OrKoN commentedon Oct 1, 2025
Could you please file a separate feature request for this? and perhaps explain in more details what kind of scripts does your use case require?
Coquinate commentedon Oct 1, 2025
I'll take a look at implementing this. Seems straightforward since screenshot already has the filePath pattern.
feat: add filePath parameter to take_snapshot and evaluate_script
sebastianbenz commentedon Oct 2, 2025
@Coquinate as suggested by @OrKoN, please create a separate issue first and list a few use cases for this first before working on this.
Coquinate commentedon Oct 2, 2025
@sebastianbenz I believe there may be some confusion - I've worked on the original issue #153 (adding filePath parameter to save evaluate_script and take_snapshot output to file), not the separate suggestion from @xubaifuCode about JS file input.
Issue #153 already documents the use cases:
I've already submitted PR #248 with the implementation following the same pattern as take_screenshot's filePath parameter. Happy to discuss the approach or add more context if needed.
feat: add filePath parameter to take_snapshot and evaluate_script
feat: support saving snapshots to file (#463)
feat: support saving snapshots to file (#463)
feat: support filePath in evaluate_script (ChromeDevTools#2054)
johnisking commentedon Oct 23, 2026
Adding a data point for the "too many tokens" part of this request.
A single
take_snapshotof a long page (the Python article on English Wikipedia, Chrome DevTools MCP 1.11.0, 2026-10-22) was 427,400 characters, about 208,926 Claude tokens. Claude Code already refuses results that large and writes them to a file itself, so the task still finished there. Other clients would send the whole snapshot to the model, at about $1.65 per call on Opus 5.5.A
filePathoption (as in #248) would make that behavior available in every client.Data and method (94 runs, CC BY 4.0): https://doi.org/10.5281/zenodo.23555401
Disclosure: I run TokenSave, which published this measurement.
OrKoN commentedon Oct 23, 2026
file path params already exist on both commands #463 and #2054