execute_commandLABSCO SUMMARY
Shell access for an agent, scoped before it is handed over.
The interesting part is not that it runs commands — it is that the directory list and the shell list are arguments to the server, so what the assistant can reach is decided by you at launch rather than by the model at call time.
What it is
A shell for an AI client with the blast radius set at startup. You list the directories commands may run in and the shells they may run under; anything outside those lists is rejected before it executes.
What you get
execute_command— runs a command line in a named shell with a working directory, and returns the output- Bash, sh, cmd and powershell, each registered by name and path so the assistant asks for one you approved
- Working-directory validation, so a path that tries to climb out of the allowed set is refused rather than followed
Requirements
Python 3.11+ and uv. The Claude Desktop configuration runs it with uv from a local clone; it is also published on PyPI as shell-mcp-server. Allowed directories are positional arguments and each shell is registered with --shell name path, so both lists are fixed at launch. COMMAND_TIMEOUT caps execution time in seconds, default 30. Commands run with the same permissions as the server process, so start it as the user you want those commands to be.
Setup effort
Build from source — git clone https://github.com/blazickjp/shell-mcp-server.git
USE CASES
Letting an assistant work in one project only
Start the server with that project directory as the only allowed path — commands land there and nowhere else on the disk.
Reading git state without leaving the chat
Run status and diff in the repository directory and hand the raw output straight back for the assistant to read.
Checking what is on the machine
Ask for disk, memory or process listings and get the command output rather than a guess.
Stopping a runaway command
Set COMMAND_TIMEOUT so anything that hangs is terminated instead of holding the session open.
1 tool
Listed in project docs. Your client may show a different list.
BEFORE YOU INSTALL
What to know first
Tools you get
1 tool named in the project's documentation.
Requires
- Python 3.11+
- uv on PATH
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
Server setup
git clone https://github.com/blazickjp/shell-mcp-server.git
cd shell-mcp-serverMCP Clients
Claude Desktop
{
"mcpServers": {
"shell-mcp-server": {
"command": "uv",
"args": [
"--directory",
"<YOUR_PATH_TO_SHELL_MCP_SERVER>",
"run",
"shell-mcp-server",
"<YOUR_PATH_TO_ALLOWED_DIR1>",
"<YOUR_PATH_TO_ALLOWED_DIR2>",
"--shell",
"bash",
"/bin/bash",
"--shell",
"zsh",
"/bin/zsh"
]
}
}
}<YOUR_PATH_TO_SHELL_MCP_SERVER> is the absolute path to your clone, list the directories commands may run in, and keep a --shell name path entry for each shell you allow.