Shell-MCP-Server

Krishnaqwerty/Shell-MCP-Server

3.2

If you are the rightful owner of Shell-MCP-Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

This document provides a structured summary of a model context protocol server.

Tools
2
Resources
0
Prompts
0

MCP Shell Server

A JavaScript MCP server that creates a directory, generates a shell script from a user-provided task, and executes it. It also attempts simple self-healing by detecting missing commands and installing them.

Features

  • Creates directory via mkdir
  • cd into the directory (execution cwd)
  • Creates .sh file via touch (implemented by writing the file)
  • Writes a shell script that interprets commands after the first colon in the task, e.g., task: ls -la
  • Runs the shell script
  • On failure, attempts to install missing commands using brew, apt-get, or apk if available
  • Exposes a tool get_instructions returning the embedded instruction text

Embedded instruction prompt

analyze the task provided by the user.
if the task can't be performed using shell scripting, deny to perform the task.
mcp will analyze how many module or script file to create and connect them to perform the task.
mcp will analyze the error on running the script and will fix the error
on error, mcp will also analyze if any installation of package is required, if required, it create a script to install those before running the final script.

Local run

Install dependencies and start the server:

npm install
npm start

The server uses stdio transport; integrate with an MCP client that supports stdio servers.

Use with Docker MCP Gateway (Docket MCP Kit)

Build the image and run with a volume for work artifacts:

# Build
docker build -t mcp-shell-server .

# Run (stdio)
docker run --rm -i \
  -v "$PWD/work":/work \
  mcp-shell-server

Then configure your Docker MCP Gateway to launch this container for an stdio MCP server (see gateway docs). The server binary is node src/server.js and expects stdio.

Tools

  • generate_and_run_script input:

    • task (string): description, can include commands after a colon, e.g., task: echo hello
    • workspace (optional string): subfolder name under WORK_ROOT (default /work)
  • get_instructions: returns the instruction text

Environment

  • WORK_ROOT: directory mounted for generated files and execution, default /work

Limitations

  • Heuristic feasibility check; some tasks may still fail.
  • Package installation is best-effort and depends on available package manager in the runtime.
  • The script interpreter looks only for the first colon to extract commands.