Shell-MCP
shell-mcp
Shell命令执行MCP服务器
为 LLM 提供安全 shell 命令执行功能的 MCP 服务器实现。
特征
安全执行:仅限白名单命令和参数
资源控制:内存和 CPU 使用率监控
超时控制:自动终止长时间运行的命令
尺寸限制:出于安全考虑的输出尺寸限制
MCP 集成:与 Claude 和其他兼容 MCP 的 LLM 兼容
Related MCP server: terminal-mcp
安装
npm install @kevinwatt/shell-mcp使用Dive Desktop进行配置
在 Dive Desktop 中点击“+ 添加 MCP 服务器”
复制并粘贴此配置:
{
"mcpServers": {
"shell": {
"command": "npx",
"args": [
"-y",
"@kevinwatt/shell-mcp"
]
}
}
}工具文档
shell_ls、shell_pwd、shell_df 等。
执行白名单中的shell命令
输入:
command(字符串,必需):要执行的命令args(数组,可选):命令参数timeout(数字,可选):执行超时(以毫秒为单位)
使用示例
要求你的法学硕士:
"Show current directory using shell_pwd"
"List files using shell_ls with -l argument"
"Check disk usage using shell_df with -h argument"手动启动
如果需要,请手动启动服务器:
npx @kevinwatt/shell-mcp要求
Node.js 18+
MCP 兼容的 LLM 服务
发展
# Install dependencies
npm install
# Watch mode
npm run watch
# Run tests
npm test
# Lint
npm run lint执照
麻省理工学院 © Dewei Yen
关键词
甲基氯丙烯
壳
命令
克劳德
法学硕士
自动化
可用命令
可用的 shell 命令如下:
命令 | 描述 | 允许的参数 |
ls | 列出目录内容 | -l、-a、-h、-R、--help、* |
猫 | 连接并显示文件内容 | -n、-b、--帮助、* |
密码 | 显示当前工作目录 | 没有任何 |
自由度 | 显示磁盘使用情况 | -h、-T、--帮助 |
回声 | 显示文本 | 任何文本 |
附言 | 显示进程状态 | -e、-f、-u、--帮助 |
自由的 | 显示内存使用情况 | -h、-m、-g、--帮助 |
正常运行时间 | 显示系统正常运行时间 | 没有任何 |
日期 | 显示系统日期和时间 | +%Y-%m-%d, +%H:%M:%S, --帮助 |
grep | 在文件中搜索文本模式 | -i、-v、-n、-r、-l、--颜色、* |
西 | 显示谁登录以及他们正在做什么 | -h、-s、--无标题、--帮助 |
whois | 查询WHOIS域名注册信息 | -H,* |
寻找 | 在目录层次结构中搜索文件 | -名称、-类型、-大小、-修改时间、* |
网络状态 | 网络连接信息 | -a、-n、-t、-u、-l、-p、--帮助 |
lspci | 列出 PCI 设备 | -v、-k、-mm、-nn、--帮助 |
lsusb | 列出 USB 设备 | -v、-t、-d、-s、--帮助 |
挖 | DNS 查找实用程序 | +短,+跟踪,+ dnssec,@ *,* |
nslookup | 查询 DNS 记录 | -type=*,-query=*,* |
ip | 显示网络设备和接口 | 地址、链接、路由、邻居、-br、* |
其中 | 找到二进制文件、源文件和手册文件 | -b、-m、-s、* |
Available Tools
20 toolsshell_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
Scored across 20 tools
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.
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.
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.
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
MCP server for Superserve sandboxes: create, exec, and manage Firecracker microVMs
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Related MCP Servers
- AlicenseAqualityAmaintenanceA 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.1202MIT
- FlicenseNot gradedqualityNot gradedmaintenanceA secure and pluggable MCP server to run terminal commands on your local machine or cloud server — remotely, safely, and with LLMs or agentic clients.-
- AlicenseBqualityCmaintenanceA secure MCP server for shell operations, terminal management, and process control, enabling AI assistants to safely execute commands and manage interactive sessions.13158 npm6MIT
- AlicenseNot gradedqualityDmaintenanceA secure, production-grade MCP server that provides filesystem operations, AST math evaluation, and system diagnostics for LLM agents.MIT