clipboard_read
Access clipboard content on Linux systems to retrieve copied text or data for integration with AI workflows and system operations.
Instructions
Read current clipboard contents
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/linux_mcp/tools/__init__.py:229-254 (handler)The implementation of the clipboard_read tool, which attempts to read the clipboard using `xclip` or `pbpaste`.
def execute_clipboard_read() -> str: """Read clipboard contents.""" try: result = subprocess.run( ["xclip", "-selection", "clipboard", "-o"], capture_output=True, text=True, timeout=5, ) if result.returncode == 0: return result.stdout return "(clipboard empty)" except FileNotFoundError: try: result = subprocess.run( ["pbpaste"], capture_output=True, text=True, timeout=5, ) return result.stdout if result.returncode == 0 else "(clipboard unavailable)" except Exception: return "(clipboard tool not available)" except Exception: return "(clipboard read failed)" - src/linux_mcp/tools/__init__.py:64-67 (registration)Registration of the clipboard_read tool within the tools library.
name="clipboard_read", scope=PermissionLevel.SAFE, description="Read current clipboard contents", )