Shell Command Executor MCP Server

Executes whitelisted shell commands remotely with standard input support.

Local serverstdioPython 182

What is the Shell Command Executor MCP server?

Most file and storage access work still happens through a UI a human drives. Shell Command Executor MCP server moves it into the conversation instead. Executes whitelisted shell commands remotely with standard input support.

The short version

A secure shell command execution server implementing the Model Context Protocol (MCP). This server allows remote execution of whitelisted shell commands with support for stdin input.

  • Argv-based Command Execution — Allowed commands run via subprocess argv without shell-string interpretation
  • Standard Input Support — Pass input to commands via stdin
  • Comprehensive Output — Returns stdout, stderr, exit status, and execution time
  • Safe Pipeline Support — Pipelines preserve and validate argv segments instead of invoking a shell
  • Execution Limits — Server-side default timeout, maximum timeout, and output byte caps are enforced
  • Contained Redirection — <, >, and >> targets must stay inside the requested working directory

The tools it exposes

The server publishes 1 tool. What each one is for:

  • Configuration — The Configuration tool exposed by this server

What it needs from you

Configuration is passed through the environment: ALLOW_COMMANDS, SECRET_TOKEN, ACCESS_KEY, PRIVATE_KEY, MCP_SHELL_SAFE_PATH. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

  • Python 3.11 or higher * mcp>=1.1.0

Getting it running

The server ships on npm as @smithery/cli, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

How it compares

This sits in the file and storage access group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Shell Command Executor's toolset — Configuration — is a fair guide to whether it matches your workflow. It is maintained by tumf; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
ConfigurationThe Configuration tool exposed by this server.

How to install the Shell Command Executor MCP server

```json
{
  "mcpServers": {
    "shell": {
      "command": "uvx",
      "args": [
        "mcp-shell-server"
      ],
      "env": {
        "ALLOW_COMMANDS": "ls,cat,pwd,grep,wc,touch,find"
      }
    },
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

  • Python 3.11 or higher * mcp>=1.1.0
VariableDescriptionRequired
ALLOW_COMMANDSConfiguration value read at startup.Optional
SECRET_TOKENCredential the server authenticates with.Yes
ACCESS_KEYCredential the server authenticates with.Yes
PRIVATE_KEYCredential the server authenticates with.Yes
MCP_SHELL_SAFE_PATHFilesystem location the server is allowed to use.Optional

Example prompts to try

  • Use Shell Command Executor to Configuration.

Frequently asked questions

The tool implements security measures like command whitelisting, shell operator validation, and direct command execution without shell interpretation to prevent shell injection attacks and ensure only authorized commands are executed.