Skip to content

Conversation

@NakaokaRei
Copy link
Owner

Summary

  • Implements screenshot functionality as requested in Feature: Add screenshot capabilities #14
  • Adds three new tools: captureScreen, captureRegion, and saveScreenshot
  • Optimized for use with Claude and other LLM tools to prevent timeouts

Changes

New Tools

  1. captureScreen: Captures entire screen as base64 JPEG
  2. captureRegion: Captures specific screen area as base64 JPEG
  3. saveScreenshot: Saves screenshot to file (supports PNG/JPEG)

Key Features

  • JPEG compression with quality parameter (default: 0.1)
  • Image scaling with scale parameter (default: 0.25)
  • Optimized image processing for fast performance
  • Comprehensive test coverage

Default Settings

  • 10% JPEG quality + 25% scale = ~95% size reduction
  • Prevents MCP timeouts when processing large screens
  • Typical output: 10-30KB for standard displays

Test Plan

  • Unit tests for all screenshot tools
  • Error handling for missing parameters
  • Quality and scale parameter validation
  • File format detection for saveScreenshot
  • Manual testing with Claude Desktop app
  • Performance testing with large displays

Usage Examples

// Capture full screen with defaults
{"tool": "captureScreen"}

// Capture with higher quality
{"tool": "captureScreen", "arguments": {"quality": 0.5, "scale": 0.5}}

// Capture specific region
{"tool": "captureRegion", "arguments": {"x": 100, "y": 100, "width": 800, "height": 600}}

// Save to file
{"tool": "saveScreenshot", "arguments": {"filename": "screenshot.jpg"}}

Closes #14

🤖 Generated with Claude Code

- Add captureScreen tool for full screen capture
- Add captureRegion tool for specific area capture
- Add saveScreenshot tool to save to file
- Implement JPEG compression with quality parameter (default: 0.1)
- Add scale parameter to reduce resolution (default: 0.25)
- Optimize image processing for faster performance
- Add comprehensive tests for all screenshot tools
- Update README with new tool documentation

Default settings (10% quality, 25% scale) are optimized to prevent timeouts
and work efficiently with Claude and other LLM tools.

Closes #14

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@NakaokaRei NakaokaRei merged commit 1f375f0 into master Jul 12, 2025
3 checks passed
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.

Feature: Add screenshot capabilities

2 participants