write_clipboard
Copy text to your system clipboard for pasting into other applications. This tool transfers provided text content to the clipboard across Linux, macOS, Windows, and WSL platforms.
Instructions
Write text content to the system clipboard.
Copies the provided text to the system clipboard, making it available
for pasting in other applications.
Args:
text: The text content to write to the clipboard.
Returns:
A confirmation message indicating success.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes |
Implementation Reference
- clipboard_mcp/__init__.py:35-54 (handler)The core handler function for the 'write_clipboard' tool. It is registered via the @mcp.tool() decorator and implements the logic to copy the input text to the system clipboard using pyperclip, handling exceptions and returning a success message. Type hints define the schema: input 'text: str', output 'str'.@mcp.tool() def write_clipboard(text: str) -> str: """Write text content to the system clipboard. Copies the provided text to the system clipboard, making it available for pasting in other applications. Args: text: The text content to write to the clipboard. Returns: A confirmation message indicating success. """ try: pyperclip.copy(text) except pyperclip.PyperclipException as e: msg = f"Failed to write to clipboard: {e}" raise RuntimeError(msg) from e else: return "Successfully wrote to clipboard."