Skip to main content
Glama

Super Windows CLI MCP Server

by Faucet94

超级 Windows CLI MCP 服务器

Windows CLI MCP 服务器的增强分支,通过命令行界面 (MCP) 提供对 Windows 环境的不受限制的系统访问。

基于: SimonB97 的win-cli-mcp-server


⚠️ 严重安全警告 ⚠️

该服务器设计为在 Windows 上以SYSTEM 级权限运行。这使其能够完全且不受限制地访问整个操作系统,包括所有文件、进程和配置设置。

  • 除非您完全理解授予系统级访问权限的含义,否则请勿安装或运行此服务器。
  • 在您可以完全控制网络访问的高度受信任的环境中使用此服务器。
  • **网络安全至关重要:**由于应用程序级限制在设计上很少,因此严重依赖防火墙、网络分段和严格的访问控制列表 (ACL) 来保护运行此服务器的机器。
  • **仔细检查配置:**密切关注config.json中的allowedPathsblockedCommands和其他安全设置。错误的配置很容易暴露您的系统。

请负责任地使用本软件,并自行承担风险。维护人员对因使用本软件而导致的误用或安全漏洞不承担任何责任。


特征

  • 完全访问 Windows shell 环境(PowerShell、CMD、Git Bash - 可配置)。
  • 不受限制的命令执行(可通过config.json配置)。
  • 完整文件系统访问(可通过config.json配置)。
  • 通过 NSSM 安装 SYSTEM 级服务以实现持久性和自动恢复。
  • NSSM 提供的自动服务恢复功能。
  • 网络绑定控制(有意但主要在网络/防火墙级别进行管理)。
  • 禁用 PowerShell 遥测以增强隐私。
  • 进程重用以提高性能(对于 shell)。
  • 延长长时间运行操作的超时时间(可配置)。

先决条件

开始之前,请确保已安装以下软件:

  1. Node.js: 18.0.0 或更高版本。从nodejs.org下载。(包含 npm)。
  2. **NSSM(Non-Sucking Service Manager):**可靠服务安装所需。请从nssm.cc下载最新版本。

安装(使用 NSSM - 推荐)

此方法将服务器安装为持久 Windows 服务,以 SYSTEM 权限运行并自动启动。

  1. 克隆或下载:
    • 克隆此存储库: git clone <repository-url>
    • 或者下载源代码.zip文件并将其解压到合适的位置(例如, C:\Servers\SuperWinCLIServer )。避免使用用户配置文件文件夹。
  2. 放置 NSSM:
    • nssm.cc下载 NSSM。
    • 解压 zip 文件。
    • nssm.exe文件从相应的体系结构文件夹( win32win64 )复制到该项目的根目录(与install-service.ps1相同的文件夹)。
  3. 安装依赖项并构建:
    • 在项目的根目录中打开一个终端(PowerShell 或 CMD)。
    • 运行: npm install
    • 此命令安装必要的 Node.js 包并自动运行npm run build将 TypeScript 代码编译到dist文件夹中。
  4. 配置config.json
    • **复制:**在项目根目录中复制config.sample.json并将其命名为config.json
    • 编辑:打开config.json仔细检查并修改设置:
      • security.allowedPaths**关键!**请将示例路径更改为服务器需要访问的实际目录。为了安全起见,请尽可能具体。如果不确定,请从项目目录本身开始(例如, "C:\\Servers\\SuperWinCLIServer" - 记住使用双反斜杠\\ )。该服务以 SYSTEM 权限运行,因此路径必须对该帐户有效。
      • security.blockedCommands / blockedArguments :查看默认列表。根据您的安全策略添加或删除命令/参数。
      • shells :启用/禁用shell(PowerShell、CMD、Git Bash)并验证command路径(尤其是Git Bash)。
      • ssh :如果您打算使用 SSH 执行功能,请进行配置(默认情况下禁用)。
    • 保存config.json文件。
  5. 运行安装脚本:
    • 以管理员身份打开 PowerShell
    • 导航到项目的根目录( cd C:\Servers\SuperWinCLIServer )。
    • 执行安装脚本: .\install-service.ps1
    • 该脚本使用 NSSM 安装并配置MCPServer服务以LocalSystem身份运行node.exe dist/index.js ,并自动启动。
  6. 验证服务状态:
    • 在同一个管理 PowerShell 窗口中,运行: Get-Service MCPServer
    • 状态应为Running 。如果为Stopped ,请检查 NSSM 日志或 Windows 事件查看器(应用程序和系统日志)中是否存在错误。

配置( config.json )详细信息

  • security
    • maxCommandLength :命令字符串中允许的最大字符数。
    • blockedCommands :要阻止的命令名称数组(不带扩展名)(不区分大小写)。
    • blockedArguments :要阻止的精确参数数组(不区分大小写)。
    • allowedPaths**关键设置。**绝对路径数组。如果restrictWorkingDirectory为 true,则只有工作目录以这些路径之一开头的命令才能执行。路径在规范化后不区分大小写。请使用双反斜杠(例如, "C:\\Tools\\Scripts" )。
    • restrictWorkingDirectory :布尔值。如果为 true,则强制对工作目录进行allowedPaths检查。强烈建议保留true
    • logCommands :布尔值。如果为 true,则执行的命令及其输出(截断)将存储在内存中(最多为maxHistorySize )。
    • maxHistorySize :内存历史记录中保留的最大命令数。
    • commandTimeout :正在运行的命令自动终止前的秒数。
    • enableInjectionProtection :布尔值。如果为 true,则尝试阻止命令中的 shell 操作符( &|;等,每个 shell 都有定义)。
  • shells :配置可用的本地shell(powershell,cmd,gitbash)。
    • enabled :布尔值。允许使用此 shell。
    • command :shell 可执行文件的路径。
    • args :在用户命令之前传递给 shell 的默认参数数组。
    • blockedOperators :用于阻止此特定 shell 的命令的字符串/字符数组(如果enableInjectionProtection为 true 则使用)。
  • ssh :通过 SSH 配置远程命令执行。
    • enabled :布尔值。启用ssh_executessh_disconnect工具。
    • connections :包含命名连接配置(主机、端口、用户名、密码/privateKeyPath)的对象。
  • 配置合并:加载config.json时,如果其中包含securityshells部分,则整个部分将替换该部分的默认配置。它不会合并securityshells中的单个字段。ssh ssh的合并更精细。如果您自定义了这些部分,请确保config.json包含它们的所有必要字段。

服务管理(NSSM)

通过install-service.ps1安装后,您可以使用标准 Windows 工具或项目目录中的管理 PowerShell/CMD中的 NSSM 命令来管理该服务:

  • 启动: Start-Service MCPServer.\nssm.exe start MCPServer
  • 停止: Stop-Service MCPServer.\nssm.exe stop MCPServer
  • 重启: Restart-Service MCPServer.\nssm.exe restart MCPServer
  • 状态: Get-Service MCPServer.\nssm.exe status MCPServer
  • 编辑配置(高级): .\nssm.exe edit MCPServer (打开 NSSM GUI 编辑器)
  • 查看配置: .\nssm.exe dump MCPServer

卸载(NSSM)

  1. 以管理员身份打开 PowerShell
  2. 导航到项目的根目录。
  3. 执行卸载脚本: .\uninstall-service.ps1
  4. 这使用 NSSM 来停止并删除MCPServer服务。

替代执行(手动/调试)

您可以直接运行服务器,而无需将其安装为用于测试或调试目的的服务:

  1. 确保您已运行npm install
  2. 确保config.json存在并且已配置。
  3. 在项目根目录中打开一个普通终端(PowerShell/CMD)。
  4. 运行: npm run start
  5. 服务器将在前台运行。按Ctrl + C停止它。

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

-
security - not tested
-
license - not tested
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

命令行界面服务器,提供对具有系统级权限的 Windows 环境的不受限制的系统访问,允许完全控制文件、进程和配置设置。

  1. ⚠️ 严重安全警告 ⚠️
    1. 特征
      1. 先决条件
        1. 安装(使用 NSSM - 推荐)
          1. 配置( config.json )详细信息
            1. 服务管理(NSSM)
              1. 卸载(NSSM)
                1. 替代执行(手动/调试)
                  1. 执照

                    Related MCP Servers

                    • A
                      security
                      A
                      license
                      A
                      quality
                      An enhanced Windows CLI MCP server providing unrestricted system access capabilities, designed for trusted environments with full system access requirements.
                      Last updated -
                      4
                      350
                      3
                      TypeScript
                      MIT License
                    • A
                      security
                      A
                      license
                      A
                      quality
                      A Model Context Protocol server that provides programmatic access to the Windows terminal, enabling AI models to interact with the Windows command line through standardized tools for writing commands, reading output, and sending control signals.
                      Last updated -
                      3
                      JavaScript
                      MIT License
                    • -
                      security
                      A
                      license
                      -
                      quality
                      A secure server that enables AI applications to execute shell commands in specified directories, supporting multiple shell types (bash, sh, cmd, powershell) with built-in security features like directory isolation and timeout control.
                      Last updated -
                      9
                      Python
                      Apache 2.0
                      • Linux
                      • Apple
                    • A
                      security
                      A
                      license
                      A
                      quality
                      A Model Context Protocol server that provides secure command-line access to Windows systems, allowing MCP clients like Claude Desktop to safely execute commands in PowerShell, CMD, and Git Bash shells with configurable security controls.
                      Last updated -
                      9
                      350
                      105
                      JavaScript
                      MIT License

                    View all related MCP servers

                    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/Faucet94/super-win-cli-mcp-server'

                    If you have feedback or need assistance with the MCP directory API, please join our Discord server