MCP Shell Server

by tumf

181 417 downloads Not rated yet Apache-2.0 license
GitHub

About

Secure MCP server for whitelisted shell command execution with stdin, argv pipelines, timeouts, and structured audit logging.

Details

License
Apache-2.0 license

Explore

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
Minimal Child Environment: Child processes receive a small allowlisted environment instead of inheriting all server secrets
Structured Audit Logging: Success, rejection, timeout, output-cap, and process-error outcomes are logged with redaction

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MCP Shell Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Configuration
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "shell": {
      "command": "uv",
      "args": [
        "--directory",
        ".",
        "run",
        "mcp-shell-server"
      ],
      "env": {
        "ALLOW_COMMANDS": "ls,cat,pwd,grep,wc,touch,find"
      }
    },
  }
}

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp shell server": {
            "mcp-shell-server": {
                "command": "npx",
                "args": [
                    "-y",
                    "@smithery/cli",
                    "install",
                    "mcp-shell-server",
                    "--client",
                    "claude"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-shell-server": {
        "command": "npx",
        "args": [
            "-y",
            "@smithery/cli",
            "install",
            "mcp-shell-server",
            "--client",
            "claude"
        ]
    }
}

codecov
smithery badge

MseeP.ai Security Assessment Badge

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.

<a href="https://glama.ai/mcp/servers/rt2d4pbn22">mcp-shell-server MCP server</a>

Features

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
Minimal Child Environment: Child processes receive a small allowlisted environment instead of inheriting all server secrets
Structured Audit Logging: Success, rejection, timeout, output-cap, and process-error outcomes are logged with redaction

MCP client setting in your Claude.app

Published version

code ~/Library/Application\ Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "shell": {
      "command": "uvx",
      "args": [
        "mcp-shell-server"
      ],
      "env": {
        "ALLOW_COMMANDS": "ls,cat,pwd,grep,wc,touch,find"
      }
    },
  }
}

Local version

Configuration
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "shell": {
      "command": "uv",
      "args": [
        "--directory",
        ".",
        "run",
        "mcp-shell-server"
      ],
      "env": {
        "ALLOW_COMMANDS": "ls,cat,pwd,grep,wc,touch,find"
      }
    },
  }
}

Installation

Installing via Smithery

To install Shell Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install mcp-shell-server --client claude

Manual Installation

pip install mcp-shell-server

Usage

Starting the Server

```bash
ALLOW_COMMANDS="ls,cat,echo" uvx mcp-shell-server

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.

Videos about MCP Shell Server

Relevant YouTube tutorials, setups, and demos