shell-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
shell-mcp
MCP server for shell command execution. Allows LLMs to run shell commands with security controls, background task management, and output handling.
The PyPI distribution name is tab-shell-mcp, and the CLI command is tab-shell-mcp
This project executes shell commands, so treat every command as potentially risky and judge before running.
Features
Dual transport: stdio (local) and streamable-http (remote)
Foreground/background execution: LLM controls execution mode per command
Background task management: query status, stop, list -- state is kept in memory with configurable TTL cleanup for completed tasks
Security: blacklist/whitelist with recursive parsing (pipes,
&&,||,;,$(), backticks,bash -c)Non-interactive:
stdin=DEVNULL+ env vars prevent interactive prompts (git, apt, etc.)Output control: configurable max length, truncation direction, and truncation flag
Timeout: per-command timeout, auto-kill on expiry
Keepalive: periodic progress notifications for long-running commands over HTTP
YAML config: file-based configuration with CLI override support
Related MCP server: Terminal MCP Server
Installation
Requires Python >= 3.11 and uv.
uv syncUsage
stdio (local, e.g. Claude Desktop)
uvx tab-shell-mcpstreamable-http (remote)
uvx tab-shell-mcp --transport streamable-http --port 8000With config file
cp config.yaml.example config.yaml
# Edit config.yaml as needed
uvx tab-shell-mcp --config config.yamlCLI flags (override config file)
uvx tab-shell-mcp \
--transport stdio \
--shell /bin/bash \
--timeout 60 \
--max-output-length 100000 \
--output-truncation-mode tail \
--completed-task-ttl 3600 \
--blacklist "rm,mkfs,dd,format" \
--whitelist ""Configuration priority: CLI args > YAML config file > defaults.
Claude Desktop integration
Add to claude_desktop_config.json:
{
"mcpServers": {
"shell": {
"command": "uvx",
"args": ["tab-shell-mcp"],
"env": {}
}
}
}MCP Tools
execute_shell_command
Execute a shell command in foreground or background.
Parameter | Type | Default | Description |
|
| required | Shell command to execute |
|
|
| Run in background, return task_id immediately |
|
| config default (30s) | Timeout in seconds |
|
|
| Shell to use (e.g. |
|
|
| Working directory |
|
| config default ( |
|
Foreground result:
{
"status": "success",
"exit_code": 0,
"stdout": "...",
"stderr": "",
"execution_time": 1.23,
"truncated": false,
"command": "ls -la"
}Status values: success, error, timeout, rejected (blocked by blacklist/whitelist).
Background result:
{
"task_id": "a1b2c3d4e5f6",
"status": "running",
"message": "Command started in background"
}Background task status values reported by get_task_status: running, completed, error, timeout, killed.
If a task has a result, then result.status uses foreground-style values such as success, error, or timeout.
Completed background task records are retained for completed_task_ttl seconds (default: 3600). Set it to 0 to keep them until the server exits.
get_task_status
Query a background task by ID.
Parameter | Type | Description |
|
| Task ID from |
stop_background_task
Stop a running background task.
Parameter | Type | Description |
|
| Task ID to stop |
list_background_tasks
List all background tasks (running and completed). No parameters.
Configuration
See config.yaml.example for all options:
Option | Default | Description |
|
| Shell executable. Auto-detect: |
|
| Default command timeout in seconds |
|
| Max total chars for stdout + stderr |
|
| Default truncation direction for oversized output ( |
|
| Progress ping interval (seconds) for HTTP keepalive |
|
| Seconds to retain completed background task records in memory ( |
|
| Commands to block |
|
| If non-empty, ONLY these commands are allowed |
|
|
|
|
| HTTP transport bind host |
|
| HTTP transport bind port |
| see example | Env vars injected to prevent interactive prompts |
Security
The command parser extracts all command names from a shell string, including:
Piped commands:
cat file | grep pattern->[cat, grep]Chained commands:
cmd1 && cmd2 || cmd3; cmd4->[cmd1, cmd2, cmd3, cmd4]Subshells:
echo $(whoami)->[echo, whoami]Shell wrappers:
bash -c "rm -rf /"->[bash, rm]
Each extracted command is checked against the whitelist (if set) or blacklist.
Interactive prompts are prevented by:
Redirecting
stdinfrom/dev/nullSetting
GIT_TERMINAL_PROMPT=0Setting
CI=trueSetting
DEBIAN_FRONTEND=noninteractive
Development
# Run tests
uv run pytest -v
# Run specific test module
uv run pytest tests/test_command_parser.py -v
# Run the local server during development
uv run tab-shell-mcpLicense
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Use your own Windows, Mac or Linux computer from ChatGPT, Claude, Cursor or Gemini CLI: run commands, read, write and search files, run long processes. Your computer only makes an outgoing connection (no open ports or VPN). Read-only mode, allowed folders, blocked commands and an action log keep you in control. Free plan available.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
I run shell commands on your private cloud environment (bash, sh, zsh)
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables safe execution of system shell commands with real-time streaming output and rich metadata capture. Provides configurable command execution with timeout controls, environment management, and extensible plugin architecture for monitoring command lifecycles.4-
- FlicenseNot gradedqualityDmaintenanceEnables safe execution of terminal commands across different shells (bash, cmd, PowerShell) with configurable timeouts, working directories, and resource limits for command-line operations through AI assistants.-
- AlicenseAqualityDmaintenanceEnables AI assistants to execute terminal commands on a host machine with configurable, granular permission controls and safety protections. It features multiple security modes, including allowlists and manual approval, to ensure safe command execution within specified directories.6Apache 2.0

terminal-toolkit-mcpofficial
AlicenseNot gradedqualityDmaintenanceEnables LLM clients to execute shell commands safely through the MCP protocol, with features like session management, safe mode, and process control.1Apache 2.0