Skip to content

feat: return screenshot and sample_frames output as inline images (#79) - #130

Merged
TMHSDigital merged 1 commit into
mainfrom
feat/inline-images-79
Oct 24, 2026
Merged

TMHSDigital merged 1 commit into
mainfrom
feat/inline-images-79

Conversation

@TMHSDigital

Copy link
Copy Markdown
Owner

Closes #79.

What

screenshot and sample_frames now append MCP image blocks after the JSON text block, so clients (Claude Code, Claude Desktop, Cursor) show the frames to the model directly. No filesystem or image tool is needed to watch a recording.

  • New src/utils/images.ts: buildPreviewArgs (pure, downscale-only scale='min(W,iw)':-2 to JPEG), clampInlineCount, and encodeInlineImages.
  • ToolResult in errors.ts now allows image content; okResponse(value, images?) appends the blocks after the text.
  • screenshot: returnImage (default true), maxImageWidth (default 1280).
  • sample_frames: returnImages (default true), maxInlineImages (default 8, max 20), maxImageWidth. When frames are left out, an inlineNote says so; every frame is still on disk and listed by path.
  • Results report inlineImages.

Tests

  • Unit: images.test.ts covers the builder, the clamp, and okResponse ordering.
  • Integration (real ffmpeg): encodes a 640x480 frame at width 200, checks it decodes to 200x150 JPEG and that the count cap works.
  • Live capture harness (RUN_LOCAL_CAPTURE_TESTS=1, run locally on Windows): all 9 pass. The test helper now reads only text blocks, and new checks assert inline images from screenshot and sample_frames plus the returnImages: false opt-out.

Docs: README watch loop, tools tables (README and Pages site), mcp-tools.json, ROADMAP, CHANGELOG. Version 0.11.0.

🤖 Generated with Claude Code

screenshot and sample_frames now append MCP image blocks after the JSON
result, so clients show frames to the model directly. Inline images are
downscaled JPEGs (maxImageWidth, default 1280); sample_frames embeds at
most maxInlineImages (default 8, max 20) and reports how many it left out.
Full-resolution PNGs are still written and listed by path, and
returnImage(s): false restores paths-only results.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 24, 2026
@TMHSDigital
TMHSDigital merged commit 24cf4f9 into main Oct 24, 2026
8 checks passed
@TMHSDigital
TMHSDigital deleted the feat/inline-images-79 branch October 24, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Return frames as MCP image content from screenshot and sample_frames so agents can view them directly

1 participant