Skip to content

Interactive commands cause MCP shell to stall indefinitely, timeout ineffective #20

@localai-bot

Description

@localai-bot

Problem Description

When executing interactive commands through the shell MCP server, the entire system stalls indefinitely. The timeout mechanism does not work in these cases, leaving the MCP server unresponsive.

Expected Behavior

  • Interactive commands should either:
    1. Detect interactive input requirements and fail gracefully with a clear error message
    2. Have proper timeout enforcement even for interactive processes
    3. Support non-interactive execution modes

Actual Behavior

  • Commands stall indefinitely
  • Timeout settings are ignored
  • MCP server becomes unresponsive until the process is manually killed

Impact

This is a critical issue as it can cause the entire MCP server to hang when users accidentally or intentionally trigger interactive commands, making the system unreliable.

Suggested Solution

Implement one or more of the following:

  • Detect TTY/interactive requirements before execution
  • Force non-interactive mode (e.g., or similar)
  • Add process group management to properly kill child processes on timeout
  • Add explicit warning when interactive flags are detected

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions