loading…
Search for a command to run...
loading…
Provides clipboard access tools (get and set) for AI assistants via the Model Context Protocol, enabling seamless clipboard operations across platforms.
Provides clipboard access tools (get and set) for AI assistants via the Model Context Protocol, enabling seamless clipboard operations across platforms.
A Model Context Protocol (MCP) server that provides clipboard access tools for AI assistants and automation workflows. Seamlessly integrate clipboard operations into your AI-powered applications.
PyPI version Python Support License: MIT
Install the server:
pip install mcp-clipboardify
Start the server:
mcp-clipboardify
# or alternatively:
python -m mcp_clipboard_server
get_clipboard - Retrieve current clipboard contentset_clipboard - Set clipboard to provided textget_clipboardRetrieves the current text content from the system clipboard.
Parameters: None
Returns: Current clipboard content as a string
set_clipboardSets the system clipboard to the provided text content.
Parameters:
text (string, required): The text content to copy to the clipboardReturns: Success confirmation
The server uses JSON-RPC 2.0 over STDIO. Here are example request/response patterns:
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": {
"name": "example-client",
"version": "1.0.0"
}
}
}
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list",
"params": {}
}
{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "get_clipboard",
"arguments": {}
}
}
{
"jsonrpc": "2.0",
"id": 4,
"method": "tools/call",
"params": {
"name": "set_clipboard",
"arguments": {
"text": "Hello, World! 🌍"
}
}
}
The server supports batch requests for processing multiple operations in a single call:
[
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_clipboard",
"arguments": {}
}
},
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "set_clipboard",
"arguments": {
"text": "Batch operation result"
}
}
}
]
This server implements full JSON-RPC 2.0 specification with the following features:
$/ping)All tool parameters are validated against JSON schemas with helpful error messages:
The server uses standard JSON-RPC 2.0 error codes plus MCP-specific extensions:
-32700 Parse error (invalid JSON)-32600 Invalid Request (malformed JSON-RPC)-32601 Method not found-32602 Invalid params (schema validation failures)-32603 Internal error-32000 Server error (MCP-specific errors)This server works with any MCP-compatible client. Example integration:
import subprocess
import json
# Start the server
process = subprocess.Popen(
["mcp-clipboardify"],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
text=True
)
# Send initialize request
init_request = {
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": {"name": "my-client", "version": "1.0.0"}
}
}
process.stdin.write(json.dumps(init_request) + '\n')
process.stdin.flush()
# Read response
response = json.loads(process.stdout.readline())
print(response)
You may need to install additional packages for clipboard support:
# Ubuntu/Debian
sudo apt-get install xclip
# or
sudo apt-get install xsel
# Fedora/RHEL
sudo dnf install xclip
No additional setup required - clipboard access works out of the box.
pip install mcp-clipboardify
git clone https://github.com/fluffypony/mcp-clipboardify.git
cd mcp-clipboardify
poetry install
Clone the repository:
git clone https://github.com/fluffypony/mcp-clipboardify.git
cd mcp-clipboardify
Install Poetry (if not already installed):
curl -sSL https://install.python-poetry.org | python3 -
Install dependencies:
poetry install
Run the server in development:
poetry run python -m mcp_clipboard_server
Run the test suite:
# Run all tests
poetry run pytest
# Run with coverage
poetry run pytest --cov=mcp_clipboard_server
# Run specific test categories
poetry run pytest tests/test_unit.py
poetry run pytest tests/test_integration.py
# Type checking
poetry run mypy src/
# Linting
poetry run flake8 src/
# Formatting
poetry run black src/ tests/
The MCP Clipboard Server provides comprehensive cross-platform support with intelligent fallback handling:
# Ubuntu/Debian
sudo apt-get install xclip xsel
# RHEL/CentOS/Fedora
sudo yum install xclip xsel
# Arch Linux
sudo pacman -S xclip xsel
sudo apt-get install wslu # For clip.exe integration
The server automatically detects your platform and provides specific guidance when clipboard operations fail:
# Missing utilities error
sudo apt-get install xclip xsel
# No display error
export DISPLAY=:0 # or run in desktop environment
# Headless system
# Read operations return empty string (graceful)
# Write operations fail with clear error message
# Install Windows integration
sudo apt-get install wslu
# Enable clipboard sharing in ~/.wslconfig
[wsl2]
guiApplications=true
# Security permissions
# Go to System Preferences > Privacy & Security > Input Monitoring
# Add Terminal or your application
# Sandboxed applications
# May have limited clipboard access
REM Antivirus blocking
REM Add exception for clipboard access
REM Enterprise policies
REM Check with IT administrator for clipboard permissions
Symptoms: Unexpected platform-specific errors
Solution: The server automatically detects your environment. Check logs with MCP_LOG_LEVEL=DEBUG for detailed platform information.
Symptoms: International text or emoji not displaying correctly Solution: Ensure your terminal/application supports UTF-8 encoding. The server handles Unicode correctly on all platforms.
Solution: The server enforces a 1MB limit. Split large content into smaller chunks.
Solution: Check that the client is sending proper JSON-RPC 2.0 formatted messages.
Enable debug logging:
# Set environment variable for detailed logs
export MCP_LOG_LEVEL=DEBUG
export MCP_LOG_JSON=true
mcp-clipboardify
After installation, verify everything works:
# Quick verification
mcp-clipboardify --help
# Comprehensive verification (requires download)
curl -sSL https://raw.githubusercontent.com/fluffypony/mcp-clipboardify/main/scripts/verify_installation.sh | bash
# Or with Python script
python -c "from scripts.verify_installation import InstallationVerifier; InstallationVerifier().run_all_tests()"
This server implements the Model Context Protocol specification:
initialize, tools/list, tools/callAll messages are line-delimited JSON objects:
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{...}}
{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}
The server returns standard JSON-RPC 2.0 error codes:
-32700: Parse error (invalid JSON)-32600: Invalid request (malformed JSON-RPC)-32601: Method not found-32602: Invalid params-32603: Internal errorWe welcome contributions! Please see our Development Guide for contributing guidelines and workflow details.
git checkout -b feature/my-featurepoetry run pytestgit commit -am 'Add my feature'git push origin feature/my-featureThis project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ for the AI and automation community
Выполни в терминале:
claude mcp add mcp-clipboardify -- npx Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.