Skip to content

Add SHELL_TIMEOUT_DISABLED environment variable to disable shell command timeout#28

Merged
mudler merged 1 commit intomudler:masterfrom
localai-bot:disable-shell-timeout
Mar 6, 2026
Merged

Add SHELL_TIMEOUT_DISABLED environment variable to disable shell command timeout#28
mudler merged 1 commit intomudler:masterfrom
localai-bot:disable-shell-timeout

Conversation

@localai-bot
Copy link
Contributor

Summary

This PR adds support for the SHELL_TIMEOUT_DISABLED environment variable to completely disable the timeout on shell command execution in the shell MCP server.

Changes

  • Added getTimeoutDisabled() function in shell/main.go that checks for SHELL_TIMEOUT_DISABLED=true
  • When timeout is disabled, the server uses context.Background() instead of context.WithTimeout()
  • Maintains backward compatibility with existing SHELL_TIMEOUT functionality
  • Updated README.md with documentation for the new environment variable
  • Updated shell/Dockerfile with default SHELL_TIMEOUT value and documentation

Usage

To disable timeout completely:

docker run -e SHELL_CMD=bash -e SHELL_TIMEOUT_DISABLED=true ghcr.io/mudler/mcps/shell:latest

Testing

  • Verified code compiles without errors
  • Environment variable handling tested for case-insensitive "true" values
  • Backward compatibility maintained with existing timeout configuration

- Add getTimeoutDisabled() function to check for SHELL_TIMEOUT_DISABLED env var
- When SHELL_TIMEOUT_DISABLED=true, bypass timeout completely using context.Background()
- Maintain backward compatibility with existing SHELL_TIMEOUT functionality
- Update documentation in README.md to include new environment variable
- Update shell/Dockerfile with SHELL_TIMEOUT default and SHELL_TIMEOUT_DISABLED documentation

This allows users to disable the 30-second timeout entirely when needed for long-running scripts.
@mudler mudler merged commit bf6e0be into mudler:master Mar 6, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants