Skip to main content
Glama

Windows Automation MCP Server

run_cmd

Execute CMD commands to automate Windows system tasks, manage processes, and perform file operations directly from the automation server.

Instructions

执行 CMD 命令

Input Schema

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

Input Schema (JSON Schema)

{ "properties": { "command": { "description": "CMD 命令", "type": "string" }, "timeout": { "description": "超时时间(毫秒,可选)", "type": "number" } }, "required": [ "command" ], "type": "object" }

Implementation Reference

  • The main handler function for the 'run_cmd' tool. Executes the provided command using child_process.execAsync with cmd.exe shell, returning success/output/error or failure details.
    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 }; } }
  • Input schema for the 'run_cmd' tool, defining required 'command' string and optional 'timeout' number.
    { name: 'run_cmd', description: '执行 CMD 命令', inputSchema: { type: 'object', properties: { command: { type: 'string', description: 'CMD 命令' }, timeout: { type: 'number', description: '超时时间(毫秒,可选)' }, }, required: ['command'], }, },
  • Registration/dispatch in executeTool method: maps 'run_cmd' tool name to the runCmd handler.
    case 'run_cmd': return await this.runCmd(args.command, args.timeout);
  • 'run_cmd' listed as a supported tool in the canHandle method.
    const tools = ['run_powershell', 'run_cmd', 'get_system_info', 'get_disk_info', 'get_network_info'];

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