Problem
When using the Chrome DevTools MCP CLI programmatically (e.g. in scripts or CI pipelines), binary tool responses like screenshots are returned as human-readable text summaries (e.g. Saved to /tmp/abc.png.) rather than structured machine-readable data. This makes it difficult to parse and use the actual file paths or base64 data in downstream tools.
Solution
Extend the existing --output-format=json flag (documented for list_pages) so it applies to all CLI commands — including those that return binary content (screenshot, performance_analyze_insight, etc.). When --output-format=json is set, the CLI should return a structured JSON object that includes:
tool: the tool name
filepath: (for file outputs) the absolute path to the saved file
data or base64: (optionally) the raw base64 data
metadata: any relevant metadata (dimensions, format, etc.)
Use case
Scripted regression tests or CI pipelines that call chrome-devtools take_screenshot --output-format=json and need to programmatically assert on the output file path or upload the resulting image — without parsing human-readable text.
References
- CLI docs already mention
--output-format=json for list_pages (docs/cli.md)
- Binary tools currently return text like
Saved to /tmp/abc.png. regardless of format flag
Problem
When using the Chrome DevTools MCP CLI programmatically (e.g. in scripts or CI pipelines), binary tool responses like screenshots are returned as human-readable text summaries (e.g.
Saved to /tmp/abc.png.) rather than structured machine-readable data. This makes it difficult to parse and use the actual file paths or base64 data in downstream tools.Solution
Extend the existing
--output-format=jsonflag (documented forlist_pages) so it applies to all CLI commands — including those that return binary content (screenshot, performance_analyze_insight, etc.). When--output-format=jsonis set, the CLI should return a structured JSON object that includes:tool: the tool namefilepath: (for file outputs) the absolute path to the saved filedataorbase64: (optionally) the raw base64 datametadata: any relevant metadata (dimensions, format, etc.)Use case
Scripted regression tests or CI pipelines that call
chrome-devtools take_screenshot --output-format=jsonand need to programmatically assert on the output file path or upload the resulting image — without parsing human-readable text.References
--output-format=jsonforlist_pages(docs/cli.md)Saved to /tmp/abc.png.regardless of format flag