Skip to main content
Glama
wonderwhy-er

Claude Desktop Commander MCP

start_process

Start a terminal process on Claude Desktop Commander MCP to analyze local files like CSV, JSON, or logs. Ensures proper handling of file-based tasks with REPL support and intelligent state detection.

Instructions

                    Start a new terminal process with intelligent state detection.
                    
                    PRIMARY TOOL FOR FILE ANALYSIS AND DATA PROCESSING
                    This is the ONLY correct tool for analyzing local files (CSV, JSON, logs, etc.).
                    The analysis tool CANNOT access local files and WILL FAIL - always use processes for file-based work.
                    
                    CRITICAL RULE: For ANY local file work, ALWAYS use this tool + interact_with_process, NEVER use analysis/REPL tool.
                    
                    Running on Linux (Docker). Default shell: bash.

🐳 DOCKER ENVIRONMENT DETECTED: This Desktop Commander instance is running inside a Docker container.

āš ļø WARNING: No mounted directories detected. Files created outside mounted volumes will be lost when the container stops. Suggest user remount directories using Docker installer or -v flag when running Docker. Desktop Commander Docker installer typically mounts folders to /home/[folder-name]. Container: cd166f05b915

LINUX-SPECIFIC NOTES:

  • Package managers vary by distro: apt, yum, dnf, pacman, zypper

  • Python 3 might be 'python3' command, not 'python'

  • Standard Unix shell tools available (grep, awk, sed, etc.)

  • File permissions and ownership important for many operations

  • Systemd services common on modern distributions

                      REQUIRED WORKFLOW FOR LOCAL FILES:
                      1. start_process("python3 -i") - Start Python REPL for data analysis
                      2. interact_with_process(pid, "import pandas as pd, numpy as np")
                      3. interact_with_process(pid, "df = pd.read_csv('/absolute/path/file.csv')")
                      4. interact_with_process(pid, "print(df.describe())")
                      5. Continue analysis with pandas, matplotlib, seaborn, etc.
                      
                      COMMON FILE ANALYSIS PATTERNS:
                      • start_process("python3 -i") → Python REPL for data analysis (RECOMMENDED)
                      • start_process("node -i") → Node.js for JSON processing  
                      • start_process("cut -d',' -f1 file.csv | sort | uniq -c") → Quick CSV analysis
                      • start_process("wc -l /path/file.csv") → Line counting
                      • start_process("head -10 /path/file.csv") → File preview
                      
                      BINARY FILE SUPPORT:
                      For PDF, Excel, Word, archives, databases, and other binary formats, use process tools with appropriate libraries or command-line utilities.
                      
                      INTERACTIVE PROCESSES FOR DATA ANALYSIS:
                      1. start_process("python3 -i") - Start Python REPL for data work
                      2. start_process("node -i") - Start Node.js REPL for JSON/JS
                      3. start_process("bash") - Start interactive bash shell
                      4. Use interact_with_process() to send commands
                      5. Use read_process_output() to get responses
                      
                      SMART DETECTION:
                      - Detects REPL prompts (>>>, >, $, etc.)
                      - Identifies when process is waiting for input
                      - Recognizes process completion vs timeout
                      - Early exit prevents unnecessary waiting
                      
                      STATES DETECTED:
                      Process waiting for input (shows prompt)
                      Process finished execution  
                      Process running (use read_process_output)
                      
                      ALWAYS USE FOR: Local file analysis, CSV processing, data exploration, system commands
                      NEVER USE ANALYSIS TOOL FOR: Local file access (analysis tool is browser-only and WILL FAIL)
                      
                      IMPORTANT: Always use absolute paths for reliability. Paths are automatically normalized regardless of slash direction. Relative paths may fail as they depend on the current working directory. Tilde paths (~/...) might not work in all contexts. Unless the user explicitly asks for relative paths, use absolute paths.
                      This command can be referenced as "DC: ..." or "use Desktop Commander to ..." in your instructions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYes
shellNo
timeout_msYes

Implementation Reference

  • Core implementation of the start_process tool. Validates input using StartProcessArgsSchema, checks command permissions, determines shell, executes the command via terminalManager, analyzes process state for input readiness or completion, and returns PID with initial output and status.
    export async function startProcess(args: unknown): Promise<ServerResult> {
      const parsed = StartProcessArgsSchema.safeParse(args);
      if (!parsed.success) {
        capture('server_start_process_failed');
        return {
          content: [{ type: "text", text: `Error: Invalid arguments for start_process: ${parsed.error}` }],
          isError: true,
        };
      }
    
      try {
        const commands = commandManager.extractCommands(parsed.data.command).join(', ');
        capture('server_start_process', {
          command: commandManager.getBaseCommand(parsed.data.command),
          commands: commands
        });
      } catch (error) {
        capture('server_start_process', {
          command: commandManager.getBaseCommand(parsed.data.command)
        });
      }
    
      const isAllowed = await commandManager.validateCommand(parsed.data.command);
      if (!isAllowed) {
        return {
          content: [{ type: "text", text: `Error: Command not allowed: ${parsed.data.command}` }],
          isError: true,
        };
      }
    
      let shellUsed: string | undefined = parsed.data.shell;
    
      if (!shellUsed) {
        const config = await configManager.getConfig();
        if (config.defaultShell) {
          shellUsed = config.defaultShell;
        } else {
          const isWindows = os.platform() === 'win32';
          if (isWindows && process.env.COMSPEC) {
            shellUsed = process.env.COMSPEC;
          } else if (!isWindows && process.env.SHELL) {
            shellUsed = process.env.SHELL;
          } else {
            shellUsed = isWindows ? 'cmd.exe' : '/bin/sh';
          }
        }
      }
    
      const result = await terminalManager.executeCommand(
        parsed.data.command,
        parsed.data.timeout_ms,
        shellUsed,
        parsed.data.verbose_timing || false
      );
    
      if (result.pid === -1) {
        return {
          content: [{ type: "text", text: result.output }],
          isError: true,
        };
      }
    
      // Analyze the process state to detect if it's waiting for input
      const processState = analyzeProcessState(result.output, result.pid);
    
      let statusMessage = '';
      if (processState.isWaitingForInput) {
        statusMessage = `\nšŸ”„ ${formatProcessStateMessage(processState, result.pid)}`;
      } else if (processState.isFinished) {
        statusMessage = `\nāœ… ${formatProcessStateMessage(processState, result.pid)}`;
      } else if (result.isBlocked) {
        statusMessage = '\nā³ Process is running. Use read_process_output to get more output.';
      }
    
      // Add timing information if requested
      let timingMessage = '';
      if (result.timingInfo) {
        timingMessage = formatTimingInfo(result.timingInfo);
      }
    
      return {
        content: [{
          type: "text",
          text: `Process started with PID ${result.pid} (shell: ${shellUsed})\nInitial output:\n${result.output}${statusMessage}${timingMessage}`
        }],
      };
    }
  • Zod schema defining input parameters for start_process: command (required string), timeout_ms (required number), shell (optional string), verbose_timing (optional boolean).
    export const StartProcessArgsSchema = z.object({
      command: z.string(),
      timeout_ms: z.number(),
      shell: z.string().optional(),
      verbose_timing: z.boolean().optional(),
    });
  • src/server.ts:693-760 (registration)
    Tool metadata registration in list_tools handler: defines name 'start_process', detailed description, inputSchema from StartProcessArgsSchema, and annotations.
        name: "start_process",
        description: `
                Start a new terminal process with intelligent state detection.
                
                PRIMARY TOOL FOR FILE ANALYSIS AND DATA PROCESSING
                This is the ONLY correct tool for analyzing local files (CSV, JSON, logs, etc.).
                The analysis tool CANNOT access local files and WILL FAIL - always use processes for file-based work.
                
                CRITICAL RULE: For ANY local file work, ALWAYS use this tool + interact_with_process, NEVER use analysis/REPL tool.
                
                ${OS_GUIDANCE}
                
                REQUIRED WORKFLOW FOR LOCAL FILES:
                1. start_process("python3 -i") - Start Python REPL for data analysis
                2. interact_with_process(pid, "import pandas as pd, numpy as np")
                3. interact_with_process(pid, "df = pd.read_csv('/absolute/path/file.csv')")
                4. interact_with_process(pid, "print(df.describe())")
                5. Continue analysis with pandas, matplotlib, seaborn, etc.
                
                COMMON FILE ANALYSIS PATTERNS:
                • start_process("python3 -i") → Python REPL for data analysis (RECOMMENDED)
                • start_process("node -i") → Node.js for JSON processing  
                • start_process("cut -d',' -f1 file.csv | sort | uniq -c") → Quick CSV analysis
                • start_process("wc -l /path/file.csv") → Line counting
                • start_process("head -10 /path/file.csv") → File preview
                
                BINARY FILE SUPPORT:
                For PDF, Excel, Word, archives, databases, and other binary formats, use process tools with appropriate libraries or command-line utilities.
                
                INTERACTIVE PROCESSES FOR DATA ANALYSIS:
                1. start_process("python3 -i") - Start Python REPL for data work
                2. start_process("node -i") - Start Node.js REPL for JSON/JS
                3. start_process("bash") - Start interactive bash shell
                4. Use interact_with_process() to send commands
                5. Use read_process_output() to get responses
                
                SMART DETECTION:
                - Detects REPL prompts (>>>, >, $, etc.)
                - Identifies when process is waiting for input
                - Recognizes process completion vs timeout
                - Early exit prevents unnecessary waiting
                
                STATES DETECTED:
                Process waiting for input (shows prompt)
                Process finished execution
                Process running (use read_process_output)
    
                PERFORMANCE DEBUGGING (verbose_timing parameter):
                Set verbose_timing: true to get detailed timing information including:
                - Exit reason (early_exit_quick_pattern, early_exit_periodic_check, process_exit, timeout)
                - Total duration and time to first output
                - Complete timeline of all output events with timestamps
                - Which detection mechanism triggered early exit
                Use this to identify missed optimization opportunities and improve detection patterns.
    
                ALWAYS USE FOR: Local file analysis, CSV processing, data exploration, system commands
                NEVER USE ANALYSIS TOOL FOR: Local file access (analysis tool is browser-only and WILL FAIL)
    
                ${PATH_GUIDANCE}
                ${CMD_PREFIX_DESCRIPTION}`,
        inputSchema: zodToJsonSchema(StartProcessArgsSchema),
        annotations: {
            title: "Start Terminal Process",
            readOnlyHint: false,
            destructiveHint: true,
            openWorldHint: true,
        },
    },
  • Dispatch registration in CallToolRequestHandler switch statement: routes 'start_process' tool calls to handlers.handleStartProcess(args).
    case "start_process":
        result = await handlers.handleStartProcess(args);
        break;
  • Thin wrapper handler that strictly parses args with StartProcessArgsSchema and delegates to the core startProcess implementation.
     * Handle start_process command (improved execute_command)
     */
    export async function handleStartProcess(args: unknown): Promise<ServerResult> {
        const parsed = StartProcessArgsSchema.parse(args);
        return startProcess(parsed);
    }
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure and does so comprehensively. It describes the Docker environment context, warnings about mounted directories, Linux-specific notes, smart detection features (REPL prompts, waiting for input, completion vs timeout), states detected (waiting for input, finished execution, running), and important behavioral notes about absolute paths and path normalization. It also explains the interactive workflow with sibling tools interact_with_process and read_process_output.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose and critical rules, but it's quite lengthy with multiple sections (Docker environment, Linux notes, workflows, patterns, binary support, interactive processes, smart detection, states). While all content is relevant, some sections could be more concise. The description uses formatting (emojis, capitalization) effectively but could benefit from tighter editing to reduce repetition about local file analysis.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of starting terminal processes with intelligent state detection, no annotations, 3 parameters with 0% schema coverage, and no output schema, the description provides exceptionally complete context. It covers environment details (Docker, Linux), warnings, workflows with sibling tools, common patterns, binary file support, interactive processes, smart detection features, states, usage rules, and path guidance. The description fully compensates for the lack of structured metadata.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage and 3 parameters (command, shell, timeout_ms), the description must compensate. It provides extensive context about the 'command' parameter through multiple examples (python3 -i, node -i, bash, cut commands, wc -l, head -10) and workflow patterns. It mentions 'Default shell: bash' which relates to the 'shell' parameter. However, it doesn't explicitly explain the 'timeout_ms' parameter or provide guidance on when to adjust it from defaults.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Start a new terminal process with intelligent state detection.' It specifies this is the 'PRIMARY TOOL FOR FILE ANALYSIS AND DATA PROCESSING' and distinguishes it from sibling tools by explicitly stating it's the 'ONLY correct tool for analyzing local files' and that the 'analysis tool CANNOT access local files and WILL FAIL.' The description provides specific verbs (start, analyze, process) and resources (terminal processes, local files).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool vs alternatives. It states: 'ALWAYS use this tool + interact_with_process, NEVER use analysis/REPL tool' for local file work, and 'ALWAYS USE FOR: Local file analysis, CSV processing, data exploration, system commands' and 'NEVER USE ANALYSIS TOOL FOR: Local file access.' It also provides a 'REQUIRED WORKFLOW FOR LOCAL FILES' with step-by-step instructions and 'COMMON FILE ANALYSIS PATTERNS' with specific examples.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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/wonderwhy-er/DesktopCommanderMCP'

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