proc_exec
Execute commands on remote servers via SSH to automate system administration tasks, manage files, install packages, and control services.
Instructions
Executes a command on the remote system
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes | SSH session ID | |
| command | Yes | Command to execute | |
| cwd | No | Working directory | |
| env | No | Environment variables |
Implementation Reference
- src/mcp.ts:402-415 (handler)Handler implementation for 'proc_exec' which calls 'execCommand'.
case 'proc_exec': { const params = ExecSchema.parse(args); const result = await execCommand( params.sessionId, params.command, params.cwd, params.env as Record<string, string>, params.timeoutMs ); // Add safety warning (never blocks, only warns) const resultWithWarning = addSafetyWarningToResult(params.command, result); logger.info('Command executed', { sessionId: params.sessionId, command: redactSensitiveData(params.command) }); return { content: [{ type: 'text', text: JSON.stringify(resultWithWarning, null, 2) }] }; } - src/mcp.ts:148-161 (registration)Tool registration for 'proc_exec'.
{ name: 'proc_exec', description: 'Executes a command on the remote system', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'SSH session ID' }, command: { type: 'string', description: 'Command to execute' }, cwd: { type: 'string', description: 'Working directory' }, env: { type: 'object', description: 'Environment variables' } }, required: ['sessionId', 'command'] } },