Skip to main content
Glama
debanshd

Tavily Web Search MCP Server

by debanshd

write_clipboard

Copy text to your macOS clipboard for easy pasting into other applications. This tool transfers provided text directly to your clipboard using the system's pbcopy command.

Instructions

Write the given text to the clipboard (macOS). Uses pbcopy.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes

Implementation Reference

  • server.py:78-89 (handler)
    The core handler function for the MCP 'write_clipboard' tool. It uses subprocess to pipe text into 'pbcopy' on macOS to update the clipboard. Decorated with @mcp.tool() for automatic registration and schema inference.
    @mcp.tool() def write_clipboard(text: str) -> str: """Write the given text to the clipboard (macOS). Uses `pbcopy`.""" try: completed = subprocess.run([ "bash", "-lc", "pbcopy" ], input=text, text=True, capture_output=True) if completed.returncode != 0: return f"❌ Failed to write clipboard (pbcopy exited {completed.returncode})." return "✅ Clipboard updated" except Exception as e: return f"❌ Error writing clipboard: {str(e)}"
  • server.py:78-78 (registration)
    The @mcp.tool() decorator registers the write_clipboard function as an MCP tool, inferring schema from signature and docstring.
    @mcp.tool()
  • LangGraph node that invokes the MCP write_clipboard tool as part of a workflow.
    async def node_write_clipboard(state: AppState) -> AppState: text = state.get("search_result", "") async with Client("server.py") as client: result = await client.call_tool("write_clipboard", {"text": text}) return {"clipboard_status": str(result)}
  • Registers the node_write_clipboard as a node named 'write_clipboard' in the LangGraph workflow.
    graph.add_node("write_clipboard", node_write_clipboard)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/debanshd/AIE7-MCP-Session'

If you have feedback or need assistance with the MCP directory API, please join our Discord server