Token导航 LogoToken导航TokenDH.com
Secure Command Executor MCP Server logo
开发工具未说明官方级别未说明来源级核验

Secure Command Executor MCP Server

MCP Server

A robust command execution service with daily log rotation, designed to securely manage and execute system commands with safety checks and logging.

工具数

4

提示词数

0

GitHub Stars

0

资源数

0
命令执行JavaScript日志记录系统管理

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

HappyAny

提供方

HappyAny

最后核验

2026/5/18 03:27

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

安全命令执行器MCP服务器

一个强大的命令执行MCP服务,具有每日日志轮换功能,旨在通过安全检查和日志记录安全地管理和执行系统命令。这个README.md是由DeepSeek V3编写的。

特性

  • 命令执行:使用可选参数执行系统命令。
  • 安全检查:警告并要求确认危险命令。
  • 命令管理:添加、更新、删除、启用或禁用命令。
  • 日志记录:每日日志轮换,并进行详细的行动跟踪。
  • 查询工具:使用筛选器查询可用命令和日志。

安装

  1. 克隆存储库:
   git clone https://github.com/HappyAny/secure-command-executor-mcp-server.git
   cd secure-command-executor-mcp-server
  1. 安装依赖项:
   npm install minimist
   npm install @modelcontextprotocol/sdk
   npm install zod
  1. 配置服务:

- 修改 commands.json 以定义可用命令。 - 设置环境变量(可选)。

用法

启动服务

node index.js --file commands.json --logs logs --port 3000

MCP设置

{
    "mcpServers": {
        "cmd-exec": {
          "command": "node",
          "args": [
            "path_to_file/index.js",
            "--file",
            "path_to_file/commands.json",
            "--logs",
            "path_to_dict/logs"
          ]
        }
    }
}

命令文件

commands.json 文件定义了可用的命令。例子:

[
  {
    "name": "dir",
    "description": "List directory contents",
    "example": "dir /w",
    "dangerous": false,
    "enabled": true,
    "confirmationPrompt": "",
    "consequences": ""
  },
  {
    "name": "format",
    "description": "Format disk drive",
    "example": "format C:",
    "dangerous": true,
    "enabled": false,
    "confirmationPrompt": "This will PERMANENTLY erase all data. Confirm?",
    "consequences": "Permanent data loss"
  }
]

API终点

执行命令

curl -X POST http://localhost:3000/execute -H "Content-Type: application/json" -d '{"command": "dir", "args": "/w"}'

查询命令

curl -X GET http://localhost:3000/queryCommands?filter=enabled&detailed=true

管理命令

curl -X POST http://localhost:3000/manageCommand -H "Content-Type: application/json" -d '{"action": "add", "name": "ping", "description": "Test network connection", "example": "ping example.com"}'

查询日志

curl -X GET http://localhost:3000/queryLogs?limit=50&filter=failed

配置

  • 环境变量:

- NODE_ENV:设置为 production 对于生产模式。 - PORT:覆盖默认端口(3000)。

  • 命令行参数:

- --file:命令文件的路径(默认值: commands.json). - --logs:日志目录的路径(默认值: logs). - --port:运行服务的端口(默认值:3000)。

日志记录

日志以每日轮换的方式存储在指定的目录中。每个日志文件都命名为 YYYY-MM-DD.json.

贡献

欢迎拉取请求。对于重大更改,请先打开一个问题来讨论您想要更改的内容。

许可证

麻省理工学院

目录标签

目录标签

命令执行JavaScript日志记录系统管理developer-toolssecure-command-executorcommand-executionsystem-management本地部署安全管理

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

4

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP