clipboard_write
Copy text to the system clipboard for pasting into applications. This tool enables automated text transfer during desktop interactions.
Instructions
Write text to the clipboard.
Args: text: The text to copy to the clipboard
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes |
Implementation Reference
- hyprland_mcp/server.py:215-223 (handler)The MCP tool registration and entry point for 'clipboard_write' in the server.
async def clipboard_write(text: str) -> str: """Write text to the clipboard. Args: text: The text to copy to the clipboard """ from . import clipboard await clipboard.write(text) return f"Copied {len(text)} characters to clipboard" - hyprland_mcp/clipboard.py:22-33 (handler)The actual implementation of writing to the clipboard using 'wl-copy'.
async def write(text: str) -> None: """Write text to clipboard.""" require_tool("wl-copy") proc = await asyncio.create_subprocess_exec( "wl-copy", stdin=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE, ) _, stderr = await proc.communicate(input=text.encode()) if proc.returncode != 0: raise ClipboardError(f"wl-copy failed: {stderr.decode().strip()}")