Skip to content

feat(mcp): support saving screenshots to workspace file - #261

Open
pcgeek86 wants to merge 1 commit into
Skyvern-AI:mainfrom
deepgram:feat/mcp-screenshot-save-path
Open

pcgeek86 wants to merge 1 commit into
Skyvern-AI:mainfrom
deepgram:feat/mcp-screenshot-save-path

Conversation

@pcgeek86

Copy link
Copy Markdown

Summary

Adds an optional filename argument to the MCP browser_take_screenshot tool, allowing callers to save screenshot captures directly to a file within the configured actor workspace instead of returning inline base64 image data.

Changes

  • Agent (agent/src/lib.rs):
    • Extend BrowserOp::TakeScreenshot with an optional filename: Option<String>.
    • Add write_output_bytes to handle binary file output confined to the configured actor workspace.
    • Return a confirmation text message (Screenshot written to <path>.) when filename is specified.
    • Add unit test binary_output_writer_confines_relative_and_absolute_paths.
  • MCP Server (mcp/src/tools.rs):
    • Update ScreenshotArgs and schema for browser_take_screenshot to accept an optional filename string property.
    • Add schema and argument parser unit tests.
  • Fixtures & Tests:
    • Update mcp/tests/fixtures/tools-list.json to reflect the schema update.
    • Add E2E stdio test verifying workspace confinement and file saving.
  • CLI (cli/src/session.rs):
    • Update BrowserOp::TakeScreenshot call site.

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.

1 participant