Shell

by blazickjp

9 stars
4.3k downloads
Not rated
GitHub

About

Integrates with the local shell environment to enable execution of system commands, file operations, and retrieval of system information for task automation and system management.

Details

Author
blazickjp
Repository
blazickjp/shell-mcp-server
GitHub stars
9
Downloads
4,254
License
Apache License 2.0
Categories
Developer Tools, Infrastructure, Other, Security, Productivity, Design, File Management, AI, Frontend, Automation, Project Management

- 🔒 Secure Execution - Commands run only in specified directories
- 🐚 Multiple Shells - Support for bash, sh, cmd, powershell
- ⏱️ Timeout Control - Automatic termination of long-running commands
- 🌍 Cross-Platform - Works on both Unix and Windows systems
- 🛡️ Safe by Default - Built-in directory and shell validation

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 Shell
    Command (node, npx, python, etc.) uv
    Arguments
    • Argument 1 --directory
    • Argument 2 /path/to/shell-mcp-server
    • Argument 3 run
    • Argument 4 shell-mcp-server
    • Argument 5 /path/to/allowed/dir1
    • Argument 6 /path/to/allowed/dir2
    • Argument 7 --shell
    • Argument 8 bash
    • Argument 9 /bin/bash
    • Argument 10 --shell
    • Argument 11 zsh
    • Argument 12 /bin/zsh

    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

``bash

result = execute_command(
command="df -h && free -h",
shell="bash",
cwd="/path/to/dir"
)

Configure behavior with command-line arguments:

| Argument | Description |
|----------|-------------|
|
directories | 📁 List of allowed directories |
|
--shell name path | 🐚 Shell specifications (name and path) |

Environment variables:
-
COMMAND_TIMEOUT`: ⏱️ Max execution time in seconds (default: 30)

uv venv
source .venv/bin/activate

uv pip install -e ".[test]"

execute_command

Executes a shell command in a specified directory using the given shell. Parameters: command (string), shell (string), cwd (string)

Claude Desktop / Cursor

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

{
    "mcpServers": {
        "shell": {
            "cwd": null,
            "env": {},
            "args": [
                "--directory",
                "/path/to/shell-mcp-server",
                "run",
                "shell-mcp-server",
                "/path/to/allowed/dir1",
                "/path/to/allowed/dir2",
                "--shell",
                "bash",
                "/bin/bash",
                "--shell",
                "zsh",
                "/bin/zsh"
            ],
            "shell": false,
            "command": "uv"
        }
    }
}

Linux

{
    "cwd": null,
    "env": [],
    "args": [
        "--directory",
        "/path/to/shell-mcp-server",
        "run",
        "shell-mcp-server",
        "/path/to/allowed/dir1",
        "/path/to/allowed/dir2",
        "--shell",
        "bash",
        "/bin/bash",
        "--shell",
        "zsh",
        "/bin/zsh"
    ],
    "shell": false,
    "command": "uv"
}

Macos

{
    "cwd": null,
    "env": [],
    "args": [
        "--directory",
        "/path/to/shell-mcp-server",
        "run",
        "shell-mcp-server",
        "/path/to/allowed/dir1",
        "/path/to/allowed/dir2",
        "--shell",
        "bash",
        "/bin/bash",
        "--shell",
        "zsh",
        "/bin/zsh"
    ],
    "shell": false,
    "command": "uv"
}

Windows

{
    "cwd": null,
    "env": [],
    "args": [
        "--directory",
        "/path/to/shell-mcp-server",
        "run",
        "shell-mcp-server",
        "/path/to/allowed/dir1",
        "/path/to/allowed/dir2",
        "--shell",
        "bash",
        "/bin/bash",
        "--shell",
        "zsh",
        "/bin/zsh"
    ],
    "shell": false,
    "command": "uv"
}

🖥️ Shell MCP Server

PyPI version
License: MIT
Python
Code style: black

> 🚀 Add secure shell command execution capabilities to your AI applications with the Shell MCP Server! Built for the Model Context Protocol.

<a href="https://glama.ai/mcp/servers/@blazickjp/shell-mcp-server">
Shell Server MCP server
</a>

✨ Features

- 🔒 Secure Execution - Commands run only in specified directories
- 🐚 Multiple Shells - Support for bash, sh, cmd, powershell
- ⏱️ Timeout Control - Automatic termination of long-running commands
- 🌍 Cross-Platform - Works on both Unix and Windows systems
- 🛡️ Safe by Default - Built-in directory and shell validation

🚀 Quick Start

Installation

```bash

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.