Skip to Content

shell-mcp

View original on GitHub 

Shell command execution MCP server

Version License

An MCP server implementation that provides secure shell command execution capabilities for LLMs.

Features

  • Secure Execution: Whitelisted commands and arguments only
  • Resource Control: Memory and CPU usage monitoring
  • Timeout Control: Automatic termination of long-running commands
  • Size Limits: Output size restrictions for safety
  • MCP Integration: Works with Claude and other MCP-compatible LLMs

Installation

npm install @kevinwatt/shell-mcp

Configuration with Dive Desktop 

  1. Click ”+ Add MCP Server” in Dive Desktop
  2. Copy and paste this configuration:
{ "mcpServers": { "shell": { "command": "npx", "args": [ "-y", "@kevinwatt/shell-mcp" ] } } }

Tool Documentation

  • shell_ls, shell_pwd, shell_df, etc.
    • Execute whitelisted shell commands
    • Inputs:
      • command (string, required): Command to execute
      • args (array, optional): Command arguments
      • timeout (number, optional): Execution timeout in ms

Usage Examples

Ask your LLM to:

"Show current directory using shell_pwd" "List files using shell_ls with -l argument" "Check disk usage using shell_df with -h argument"

Manual Start

If needed, start the server manually:

npx @kevinwatt/shell-mcp

Requirements

  • Node.js 18+
  • MCP-compatible LLM service

Development

# Install dependencies npm install # Watch mode npm run watch # Run tests npm test # Lint npm run lint

License

MIT Β© Dewei Yen

Keywords

  • mcp
  • shell
  • command
  • claude
  • llm
  • automation

Available Commands

The following shell commands are available:

CommandDescriptionAllowed Arguments
lsList directory contents-l, -a, -h, -R, β€”help, *
catConcatenate and display file contents-n, -b, β€”help, *
pwdShow current working directoryNone
dfShow disk usage-h, -T, β€”help
echoDisplay textAny text
psShow process status-e, -f, -u, β€”help
freeShow memory usage-h, -m, -g, β€”help
uptimeShow system uptimeNone
dateShow system date and time+%Y-%m-%d, +%H:%M:%S, β€”help
grepSearch text patterns in files-i, -v, -n, -r, -l, β€”color, *
wShow who is logged on and what they are doing-h, -s, β€”no-header, β€”help
whoisQuery WHOIS domain registration information-H, *
findSearch for files in a directory hierarchy-name, -type, -size, -mtime, *
netstatNetwork connection information-a, -n, -t, -u, -l, -p, β€”help
lspciList PCI devices-v, -k, -mm, -nn, β€”help
lsusbList USB devices-v, -t, -d, -s, β€”help
digDNS lookup utility+short, +trace, +dnssec, @*, *
nslookupQuery DNS records-type=, -query=, *
ipShow network devices and interfacesaddr, link, route, neigh, -br, *
whereisLocate binary, source and manual files-b, -m, -s, *
Last updated on