read_clipboard
Retrieve text from your macOS clipboard to use as input for web searches, enabling quick information lookup without manual typing.
Instructions
Read and return the current clipboard text (macOS). Uses pbpaste.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.py:65-77 (handler)The main handler function for the 'read_clipboard' tool. It is registered via the @mcp.tool() decorator, which also handles schema inference from type hints and docstring. The function uses subprocess to execute 'pbpaste' on macOS to retrieve and return the clipboard text.@mcp.tool() def read_clipboard() -> str: """Read and return the current clipboard text (macOS). Uses `pbpaste`.""" try: completed = subprocess.run([ "pbpaste" ], check=False, capture_output=True, text=True) if completed.returncode != 0: return f"❌ Failed to read clipboard (pbpaste exited {completed.returncode})." return (completed.stdout or "").strip() except Exception as e: return f"❌ Error reading clipboard: {str(e)}"