Skip to main content
Glama

Windows Automation MCP Server

set_clipboard

Copies text to Windows clipboard for easy pasting across applications, enabling quick data transfer between programs and automated workflows.

Instructions

设置剪贴板内容

Input Schema

NameRequiredDescriptionDefault
textYes要设置的文本内容

Input Schema (JSON Schema)

{ "properties": { "text": { "description": "要设置的文本内容", "type": "string" } }, "required": [ "text" ], "type": "object" }

Implementation Reference

  • Executes the core logic for setting clipboard content using PowerShell's Set-Clipboard command, with text escaping for special characters.
    async setClipboard(text) { try { // 转义特殊字符 const escapedText = text.replace(/"/g, '`"').replace(/\$/g, '`$'); await execAsync(`powershell -Command "Set-Clipboard -Value '${escapedText}'"`, { shell: 'powershell.exe' }); return { success: true, message: '剪贴板已设置', length: text.length }; } catch (error) { return { success: false, error: error.message }; } }
  • Registers the 'set_clipboard' tool in getToolDefinitions(), providing name, description, and input schema.
    { name: 'set_clipboard', description: '设置剪贴板内容', inputSchema: { type: 'object', properties: { text: { type: 'string', description: '要设置的文本内容' }, }, required: ['text'], }, },
  • Dispatches 'set_clipboard' calls to the setClipboard handler in executeTool method.
    case 'set_clipboard': return await this.setClipboard(args.text);
  • src/server.js:43-52 (registration)
    Instantiates ClipboardTools as part of the tools collection, enabling registration and handling of its tools including set_clipboard.
    this.tools = { filesystem: new FileSystemTools(), process: new ProcessTools(), mouseKeyboard: new MouseKeyboardTools(), window: new WindowTools(), screen: new ScreenTools(), clipboard: new ClipboardTools(), powershell: new PowerShellTools(), browser: new BrowserTools(), };
  • src/server.js:21-21 (registration)
    Imports the ClipboardTools class which implements the set_clipboard tool.
    import { ClipboardTools } from './tools/clipboard.js';

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/eva-wanxin-git/windows-automation-mcp'

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