Skip to main content
Glama

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
NameRequiredDescriptionDefault
sessionIdYesSSH session ID
commandYesCommand to execute
cwdNoWorking directory
envNoEnvironment variables

Implementation Reference

  • 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']
      }
    },

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/oaslananka/mcp-ssh-tool'

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