Skip to main content
Glama

shell-mcp

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

Related MCP server: terminal-mcp

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:

Command

Description

Allowed Arguments

ls

List directory contents

-l, -a, -h, -R, --help, *

cat

Concatenate and display file contents

-n, -b, --help, *

pwd

Show current working directory

None

df

Show disk usage

-h, -T, --help

echo

Display text

Any text

ps

Show process status

-e, -f, -u, --help

free

Show memory usage

-h, -m, -g, --help

uptime

Show system uptime

None

date

Show system date and time

+%Y-%m-%d, +%H:%M:%S, --help

grep

Search text patterns in files

-i, -v, -n, -r, -l, --color, *

w

Show who is logged on and what they are doing

-h, -s, --no-header, --help

whois

Query WHOIS domain registration information

-H, *

find

Search for files in a directory hierarchy

-name, -type, -size, -mtime, *

netstat

Network connection information

-a, -n, -t, -u, -l, -p, --help

lspci

List PCI devices

-v, -k, -mm, -nn, --help

lsusb

List USB devices

-v, -t, -d, -s, --help

dig

DNS lookup utility

+short, +trace, +dnssec, @*, *

nslookup

Query DNS records

-type=, -query=, *

ip

Show network devices and interfaces

addr, link, route, neigh, -br, *

whereis

Locate binary, source and manual files

-b, -m, -s, *

Available Tools

20 tools
shell_catC

Concatenate and display file contents

Inputs: args.

shell_dateC

Show system date and time

Inputs: args.

shell_dfC

Show disk usage

Inputs: args.

shell_digC

DNS lookup utility

Inputs: args.

shell_echoC

Display text

Inputs: args.

shell_findC

Search for files in a directory hierarchy

Inputs: args.

shell_freeC

Show memory usage

Inputs: args.

shell_grepC

Search text patterns in files

Inputs: args.

shell_ipC

Show / manipulate routing, network devices, interfaces and tunnels

Inputs: args.

shell_lsC

List directory contents

Inputs: args.

shell_lspciC

List PCI devices

Inputs: args.

shell_lsusbC

List USB devices

Inputs: args.

shell_netstatC

Network connection information

Inputs: args.

shell_nslookupC

Query DNS records

Inputs: args.

shell_psC

Show process status

Inputs: args.

shell_pwdA

Show current working directory

Inputs: args.

shell_uptimeB

Show system uptime

Inputs: args.

shell_wC

Show who is logged on and what they are doing

Inputs: args.

shell_whereisB

Locate the binary, source, and manual page files for a command

Inputs: args.

shell_whoisC

Query WHOIS domain registration information

Inputs: args.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 20 tools

    Disambiguation5/5

    Each tool corresponds to a distinct, well-known Unix/Linux command with a clear, non-overlapping purpose. For example, shell_cat is for file display, shell_df for disk usage, and shell_ps for process status, making it easy for an agent to select the right tool without confusion.

    Naming Consistency5/5

    All tool names follow a consistent 'shell_' prefix followed by the exact command name (e.g., shell_cat, shell_date, shell_df). This uniform pattern enhances readability and predictability across the entire set.

    Tool Count4/5

    With 20 tools, the server covers a broad range of system utilities, which is reasonable for a shell command interface. It might be slightly heavy, but each tool is a standard command, so the count aligns well with the server's purpose of providing comprehensive shell access.

    Completeness5/5

    The tool set offers extensive coverage of common Unix/Linux commands for file operations, system monitoring, network tasks, and process management. There are no obvious gaps for a shell utility server, as it includes essential tools like ls, grep, ps, and networking commands, ensuring agents can handle typical tasks without dead ends.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      A
      maintenance
      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.
      1
      202
      MIT
    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      A secure and pluggable MCP server to run terminal commands on your local machine or cloud server — remotely, safely, and with LLMs or agentic clients.
      -
    • A
      license
      B
      quality
      C
      maintenance
      A secure MCP server for shell operations, terminal management, and process control, enabling AI assistants to safely execute commands and manage interactive sessions.
      13
      158 npm
      6
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A secure, production-grade MCP server that provides filesystem operations, AST math evaluation, and system diagnostics for LLM agents.
      MIT