Skip to main content
Glama
eva-wanxin-git

Windows Automation MCP Server

run_cmd

Execute CMD commands to automate Windows system tasks through the Windows Automation MCP Server.

Instructions

执行 CMD 命令

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesCMD 命令
timeoutNo超时时间(毫秒,可选)

Implementation Reference

  • The handler function that executes the CMD command using Node.js child_process.execAsync (promisified) with cmd.exe shell. It captures stdout/stderr, handles timeouts and buffer limits, and returns a structured response with success status, output, error, and the executed command.
    async runCmd(command, timeout = 30000) { try { const { stdout, stderr } = await execAsync(command, { shell: 'cmd.exe', timeout, maxBuffer: 1024 * 1024 * 10, }); return { success: true, output: stdout.trim(), error: stderr.trim(), command }; } catch (error) { return { success: false, error: error.message, command }; } }
  • The tool schema definition returned by getToolDefinitions(), specifying the name, description, and inputSchema for parameter validation (required 'command' string, optional 'timeout' number).
    { name: 'run_cmd', description: '执行 CMD 命令', inputSchema: { type: 'object', properties: { command: { type: 'string', description: 'CMD 命令' }, timeout: { type: 'number', description: '超时时间(毫秒,可选)' }, }, required: ['command'], }, },
  • Registration and dispatching logic in the executeTool switch statement, which routes calls to the 'run_cmd' tool to the runCmd handler method.
    case 'run_cmd': return await this.runCmd(args.command, args.timeout);

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