Shell-MCP
The Shell-MCP server enables secure execution of whitelisted shell commands for MCP-compatible LLMs with robust safety controls.
Execute Whitelisted Commands: Run commands like
ls,cat,pwd,df,grep,ps,free,date,netstat,find, and more with allowed arguments.Security Measures: Ensures only pre-approved commands and arguments can be executed.
Resource Management: Monitors memory and CPU usage, automatically terminates long-running commands, and restricts output size.
Integration: Works with MCP-compatible LLMs such as Claude.
Flexible Setup: Can be configured with Dive Desktop or started manually.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Shell-MCPlist files in the current directory with details using ls -l"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
shell-mcp
Shell command execution MCP server
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: MCP Command Server
Installation
npm install @kevinwatt/shell-mcpConfiguration with Dive Desktop
Click "+ Add MCP Server" in Dive Desktop
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 executeargs(array, optional): Command argumentstimeout(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-mcpRequirements
Node.js 18+
MCP-compatible LLM service
Development
# Install dependencies
npm install
# Watch mode
npm run watch
# Run tests
npm test
# Lint
npm run lintLicense
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, * |
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/kevinwatt/shell-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server