WSLSnapit-MCP

by peterparker57

Not rated
GitHub

About

Capture screenshots and read the clipboard on Windows from within a WSL environment.

Details

Author
peterparker57
Categories
Productivity

Setup

Install WSLSnapit-MCP in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/peterparker57/WSLSnapit-MCP

Follow the installation instructions in the repository README, then restart your MCP client.

WSLSnapit-MCP is a powerful Model Context Protocol (MCP) server that provides advanced screenshot capture and clipboard reading capabilities for Windows applications from within WSL environments. It enables AI assistants to capture screens, windows, and monitors with intelligent image processing and optimization, as well as read text and images from the Windows clipboard.

- Monitor Selection: Capture all monitors, primary monitor, or specific monitor by number
- Window Targeting: Capture specific windows by title (partial match) or process name
- Smart Compression: Automatic image optimization to stay under 1MB with progressive quality adjustment
- Direct Return: Images can be returned directly to AI assistants or saved to disk
- DPI-Aware: Handles multi-monitor setups with different scaling factors correctly

- Auto-Detection: Automatically detects whether clipboard contains text or image
- Text Support: Read text content from Windows clipboard
- Image Support: Capture images from clipboard with automatic compression
- Format Control: Force specific format (text/image) or use auto mode

- Efficient Processing: Memory-conscious handling of high-resolution captures
- Progressive Compression: Dynamic quality adjustment (1920px → 1280px → 800px if needed)
- Optimized Communication: Base64 encoding for reliable binary data transfer

- Windows 10/11 with WSL2 installed
- Node.js 18.0.0 or higher
- npm, yarn, or bun package manager
- PowerShell (comes with Windows)

# Clone the repository git clone https://github.com/yourusername/WSLSnapit-MCP.git cd WSLSnapit-MCP # Install dependencies npm install # or yarn install # or bun install

Add the following to your Claude Desktop configuration file:

Windows:%APPDATA%\Claude\claude_desktop_config.jsonmacOS:~/Library/Application Support/Claude/claude_desktop_config.jsonLinux:~/.config/Claude/claude_desktop_config.json

{ "mcpServers": { "wslsnapit": { "command": "wsl", "args": [ "--cd", "/mnt/h/dev/mcp/wslsnapit-mcp", "node", "index.js" ] } } }

Note: Adjust the path/mnt/h/dev/mcp/wslsnapit-mcpto match your installation location.

Thetake_screenshottool supports various capture modes:

// Capture all monitors (default) take_screenshot() // Capture primary monitor only take_screenshot({ monitor: "primary" }) // Capture specific monitor (1, 2, 3, etc.) take_screenshot({ monitor: 2 })
// Capture window by title (partial match) take_screenshot({ windowTitle: "Visual Studio" }) // Capture window by process name take_screenshot({ processName: "notepad" }) // Handle multiple matching windows take_screenshot({ windowTitle: "Chrome", windowIndex: 2 })
// Return image directly (default) take_screenshot({ returnDirect: true }) // Save to file take_screenshot({ returnDirect: false, filename: "myshot.png", folder: "/home/user/screenshots" }) // Control JPEG quality (for direct return) take_screenshot({ returnDirect: true, quality: 90 })

Theread_clipboardtool supports both text and image content:

// Auto-detect clipboard content (default) read_clipboard() // Force text reading read_clipboard({ format: "text" }) // Force image reading read_clipboard({ format: "image" })

WSLSnapit-MCP is designed with security in mind:

- Minimal Permissions: Windows executable runs with minimal permissions, only accessing screen capture and clipboard APIs
- Local Processing: All clipboard data is processed locally without any network transmission
- Process Isolation: PowerShell runs as a separate Windows process, preventing access to sensitive WSL environment
- Input Validation: All user inputs are properly escaped to prevent injection attacks
- Resource Limits: Memory limits and progressive compression prevent resource exhaustion

- MCP Server: Implements the Model Context Protocol for AI assistant integration
- PowerShell Bridge: Executes Windows-specific operations from WSL
- Image Processor: Uses Sharp library for efficient image compression
- Path Handler: Seamlessly converts between WSL and Windows paths

- Node.js with ES modules
- @modelcontextprotocol/sdk for MCP implementation
- Sharp for image processing
- PowerShell for Windows API integration

- Ensure the target window is visible and not minimized
- Try using a shorter or different part of the window title
- Use process name instead of window title

- The tool automatically compresses images to stay under 1MB
- If issues persist, try lowering the quality parameter

- Ensure content is properly copied to clipboard
- Try specifying the format explicitly instead of using auto-detect

- Verify the folder path exists
- Remember WSL paths start with/mnt/c/for C: drive

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (git checkout -b feature/AmazingFeature)
- Commit your changes (git commit -m 'Add some AmazingFeature')
- Push to the branch (git push origin feature/AmazingFeature)
- Open a Pull Request

This project is licensed under the MIT License - see theLICENSEfile for details.

- Built for use withClaude Desktopand theModel Context Protocol
- Image processing powered by
Sharp
- Thanks to the MCP community for inspiration and support

- 🐛 Report bugs byopening an issue
- 💡 Request features through
GitHub discussions
- 📧 Contact:
your-email@example.com

Made with ❤️ for the WSL and MCP community

The 1Password MCP server creates a bridge that allows MCP clients such as Codex and Kiro to manage your 1Password Environments with secure authorization prompts.

This is the 1st, easiest, and cheapest PPT, slides, presentation AI generation MCP Server in the world.

Persistent memory for any AI assistant. Zero token cost until recall. Stores memories in local SQLite, ranks by 6-factor scoring, returns results 79% smaller than JSON. Works with Claude, ChatGPT, Grok, Cursor, Windsurf, and any MCP client.

A MCP server that enables AI assistants to interact with Anki, the spaced repetition flashcard application.

Enables LLM clients to interact with macOS applications through AppleScript. Built using the @beyondbetter/bb-mcp-server library, this server provides safe, controlled execution of predefined scripts with optional support for arbitrary script execution.

An MCP server for WordPress plugin audits

Turn your AI assistant into a digital marketing hub that creates, organizes, and analyzes links and QR Codes on demand.

Connect AI clients to Cal.com scheduling through the Model Context Protocol using the hosted server at mcp.cal.com or a local instance.

Sync Calendars, Scheduling Links, AI Executive Scheduling Assistant, Unified Calendar

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.