feat(snap-happy): Add Windows/WSL2 support and MCP tool annotations#54
Open
bryankthompson wants to merge 1 commit intobadlogic:mainfrom
Open
Conversation
## Windows/WSL2 Support - Add WSL2 detection via WSL_DISTRO_NAME environment variable - Implement automatic path conversion from WSL (/mnt/c/) to Windows (C:\) - Add window-specific capture on Windows using PrintWindow Win32 API - Implement ListWindows on Windows via PowerShell - Add PowerShell temp script handling with proper cleanup - Add debug logging for troubleshooting ## Screenshot Optimization Options - Add maxWidth/maxHeight parameters for resizing (default: 1920x1080) - Add format option (png/jpeg) - Add quality option for JPEG compression (1-100) - Add returnPath option to return file path instead of base64 ## MCP Tool Annotations - Add annotations to GetLastScreenshot (readOnlyHint: true) - Add annotations to TakeScreenshot (destructiveHint: false, idempotentHint: false) - Add annotations to ListWindows (readOnlyHint: true) - All tools have openWorldHint: false (local system only) ## Documentation Updates - Update tool descriptions to mention Windows support - Update parameter descriptions for new options Reference implementation: https://github.com/triepod-ai/snap-happy-mcp 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive Windows and WSL2 support to snap-happy, along with MCP tool annotations and screenshot optimization options.
Changes
Windows/WSL2 Support
WSL_DISTRO_NAMEenvironment variable/mnt/c/) to Windows paths (C:\)PrintWindowWin32 API via PowerShellScreenshot Optimization Options (TakeScreenshot)
maxWidth/maxHeight- Resize screenshots (default: 1920x1080)format- Output format (pngorjpeg)quality- JPEG compression quality (1-100)returnPath- Return file path instead of base64 dataMCP Tool Annotations
truefalsefalsefalsefalsefalsetruefalseFiles Changed
apps/snap-happy/src/screenshot.ts- Windows/WSL2 implementationapps/snap-happy/src/tools.ts- Tool annotations and new parametersapps/snap-happy/src/index.ts- Handler updates for new optionsTesting
Tested on Windows 11 via WSL2 (Ubuntu). Both full-screen and window-specific captures work correctly.
Related
🤖 Generated with Claude Code