Allows access to the source code repository and project documentation through GitHub.
Provides direct clipboard integration for Linux systems, allowing Claude to access clipboard content through platform-specific implementation.
Offers native clipboard support for macOS, enabling Claude to read clipboard content including text and images on Apple systems.
Provides package distribution through NPM, allowing easy installation with the @standardbeagle/mcp-clip package.
MCP Clipboard Server
A high-performance, lock-free Model Context Protocol (MCP) server that provides clipboard access for AI assistants. Specifically designed to solve the VSCode + WSL2 image clipboard limitation when using Claude.
🎯 Problem Solved
VSCode + WSL2 + Claude Image Clipboard Issue: When running Claude in VSCode on Windows with WSL2, pasting images from the clipboard doesn't work due to the sandboxed environment. This MCP server provides a bridge to access Windows clipboard content (including images) from within the WSL2 environment.
✨ Features
🔒 Lock-free concurrent design - High performance with zero race conditions
🖼️ Image clipboard support - PNG, JPEG, GIF, WebP, BMP detection and handling
🛡️ WSL2 compatibility - Seamless Windows clipboard access from WSL2
📁 Large content handling - Automatic temp file creation for content >25KB
🔄 Real-time monitoring - Clipboard change notifications
🧹 Smart cleanup - TTL-based temp file management
🚀 Race condition free - Comprehensive atomic operations and CAS loops
🔍 Rich debugging - Detailed error context and optional debug logging
🚀 Quick Start
NPM Installation (Recommended)
Go Installation
Manual Installation
📋 Claude Desktop Configuration
Add to your Claude Desktop claude_desktop_config.json
:
Config file locations:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Windows:
%APPDATA%\Claude\claude_desktop_config.json
Linux:
~/.config/Claude/claude_desktop_config.json
🔧 VSCode + WSL2 Setup
1. Install in WSL2
2. Configure Claude Code Extension
Add to your VSCode settings or workspace .vscode/settings.json
:
3. WSL2 PowerShell Access
Ensure PowerShell is accessible from WSL2:
🛠️ Available Tools
read_clipboard
Reads current clipboard content with automatic format detection.
Example usage in Claude:
"Read my clipboard and analyze the content"
Supported formats:
Plain text
Images (PNG, JPEG, GIF, WebP, BMP)
Binary data (base64 encoded)
Large content handling:
Content >25KB automatically saved to temp files
Images always saved as files with proper extensions
File paths provided for external access
📊 Resource Notifications
The server sends real-time notifications when clipboard content changes:
This allows Claude to proactively know when new content is available without polling.
⚙️ Configuration
Environment Variables
MCP_DEBUG=1
- Enable detailed debug loggingMCP_CLEANUP_TTL=2h
- Set temp file cleanup TTL (default: 1h)
Debug Mode
Shows detailed information about:
Clipboard monitoring status
Temp file creation and cleanup
WSL2 PowerShell integration
Race condition fallbacks (extremely rare)
🧪 Testing
Test Installation
Development Testing
🏗️ Architecture
Lock-Free Design
Atomic operations for all shared state
Compare-and-swap loops with retry limits
Zero mutexes in hot paths
Race-condition free under all loads
Concurrency Safety
Atomic clipboard state updates
Thread-safe session file tracking
Graceful shutdown with cleanup
TOCTOU-safe temp file creation
Platform Integration
WSL2: PowerShell bridge for Windows clipboard
Linux: Direct clipboard integration via atotto/clipboard
macOS: Native clipboard support
Windows: Native clipboard support
🔧 Troubleshooting
WSL2 Issues
PowerShell not found:
Permission denied:
Clipboard empty in WSL2:
General Issues
MCP connection failed:
Verify
mcp-clip
is in your PATHCheck Claude Desktop config JSON syntax
Restart Claude Desktop after config changes
Large images not working:
Check available disk space in temp directory
Verify temp directory permissions
Enable debug mode:
MCP_DEBUG=1
Performance issues:
Monitor with debug mode enabled
Check for antivirus interference
Verify WSL2 resource allocation
📝 Development
Building from Source
Running Tests
Contributing
Fork the repository
Create a feature branch
Run tests:
go test -race -v ./...
Submit a pull request
📄 License
MIT License - see LICENSE file for details.
🙏 Acknowledgments
Model Context Protocol by Anthropic
atotto/clipboard for cross-platform clipboard access
mcp-go for Go MCP implementation
🔗 Links
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
A high-performance server that provides clipboard access for AI assistants, specifically designed to solve the VSCode + WSL2 image clipboard limitation when using Claude.
Related MCP Servers
- AsecurityAlicenseAqualityProvides AI assistants access to the macOS clipboard content, supporting text, images, and binary data via OSAScript.Last updated -6MIT License
- -securityAlicense-qualityA modular server implementation for Claude AI assistants with integrated tools, enabling Claude to perform actions and access external resources like file systems, web searches, browser automation, financial data, and document generation.Last updated -96MIT License
- -securityAlicense-qualityA server that enables AI assistants like Claude to safely run Python code and access websites, processing data for better AI understanding while providing helpful error messages.Last updated -3GPL 3.0
- -securityAlicense-qualityA server that allows AI tools like Claude and Cursor to automate and control Photoshop through natural language commands, enabling tasks like editing PSDs, toggling layers, and generating marketing creatives.Last updated -9MIT License