Skip to main content
Glama
Faucet94

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中的allowedPaths 、 blockedCommands和其他安全设置。错误的配置很容易暴露您的系统。

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


Related MCP server: Windows CLI MCP Server

特征

  • 完全访问 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文件从相应的体系结构文件夹( win32或win64 )复制到该项目的根目录(与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_execute和ssh_disconnect工具。

    • connections :包含命名连接配置(主机、端口、用户名、密码/privateKeyPath)的对象。

  • 配置合并:加载config.json时,如果其中包含security或shells部分,则整个部分将替换该部分的默认配置。它不会合并security或shells中的单个字段。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文件。

Available Tools

4 tools
execute_commandB

Execute a command in the specified shell (powershell, cmd, or gitbash)

Example usage (PowerShell):

{
  "shell": "powershell",
  "command": "Get-Process | Select-Object -First 5",
  "workingDir": "C:\Users\username"
}

Example usage (CMD):

{
  "shell": "cmd",
  "command": "dir /b",
  "workingDir": "C:\Projects"
}

Example usage (Git Bash):

{
  "shell": "gitbash",
  "command": "ls -la",
  "workingDir": "/c/Users/username"
}
ParametersJSON Schema
NameRequiredDescriptionDefault
commandYesCommand to execute
shellYesShell to use for command execution
workingDirNoWorking directory for command execution (optional)

TDQS

B3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of disclosing behavior. It gives examples but does not mention return values, exit codes, error handling, side effects, environment specifics, or security implications. For a command execution tool, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The opening one-sentence description is concise and front-loaded. The three examples are redundant in structure but serve to illustrate cross-shell syntax. Each sentence earns its place, though the examples could be trimmed to one or two without loss.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool that executes arbitrary system commands, there is no mention of output format, timeouts, working directory defaults, or safety considerations. The presence of sibling ssh_execute suggests a need to clarify local vs remote execution, which is absent. The examples help but do not fill all gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already covers 100% of parameters, but the description adds value through concrete examples showing valid shell values, command syntax, and workingDir formatting (e.g., Windows paths vs Git Bash paths). This enhances understanding beyond the schema's terse descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool executes a command in a specified shell (powershell, cmd, or gitbash), which is a specific verb+resource. It is distinguishable from siblings like get_command_history and ssh_execute, though it does not explicitly call out these differences. The mention of the shell options adds specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is given on when to use this tool versus alternatives such as ssh_execute (remote execution) or get_command_history. The examples imply usage but do not provide context, prerequisites, or exclusions. This is a clear gap.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_command_historyA

Get the history of executed commands

Example usage:

{
  "limit": 5
}

Example response:

[
  {
    "command": "Get-Process",
    "output": "...",
    "timestamp": "2024-03-20T10:30:00Z",
    "exitCode": 0
  }
]
ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of history entries to return (default: 10, max: 1000)

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It adds transparency by showing a detailed example response with fields (command, output, timestamp, exitCode), which clarifies the return format. However, it does not explicitly state whether history is session-scoped, how results are ordered, or that it has no side effects. Given the absence of annotations, there are notable but not critical gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise: a single opening sentence plus two compact JSON examples. The purpose is front-loaded, and every element adds value—the example usage demonstrates the parameter, and the example response shows the expected output structure. No redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter, no-output-schema tool, the description is quite complete: it states the purpose, shows how to invoke it, and provides a representative response. Minor omissions like ordering or session scope are not critical for a list-history tool. The example response effectively substitutes for an output schema, making the tool actionable for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already fully documents the 'limit' parameter with default (10) and max (1000) values, providing 100% coverage. The description's example usage (limit: 5) reinforces the parameter but adds no new semantic meaning beyond the schema. Baseline 3 is appropriate because the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a clear verb+resource statement: 'Get the history of executed commands'. It distinguishes itself from sibling tools like execute_command (execution) and ssh_execute (remote execution) by focusing specifically on retrieval of prior commands. The example response reinforces the purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a clear usage context: to retrieve previously executed commands, with an example showing the optional limit parameter. It does not explicitly state when not to use it, but the purpose is self-evident and no competing history tools exist among siblings. No explicit exclusions are given, but this is clearly a read-only counterpart to the execution siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

ssh_disconnectA

Disconnect from an SSH server

Example usage:

{
  "connectionId": "raspberry-pi"
}

Use this to cleanly close SSH connections when they're no longer needed.

ParametersJSON Schema
NameRequiredDescriptionDefault
connectionIdYesID of the SSH connection to disconnect

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must carry the full burden. It mentions 'cleanly close' but doesn't disclose side effects like what happens to associated sessions, idempotency, or error behavior. It's minimally adequate but not rich.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is short and includes a practical JSON example, which helps the agent. It repeats the concept slightly ('Disconnect' and 'close SSH connections'), but overall it's well-structured and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter tool with no output schema, the description is adequate. It provides an example and clear use case. It doesn't cover errors or edge cases, but given the low complexity, this is not a significant gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with the parameter described as 'ID of the SSH connection to disconnect'. The example usage adds an illustrative value (raspberry-pi) but doesn't add semantic meaning beyond the schema, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Disconnect' and the resource 'SSH connection/server', which distinguishes it from siblings like ssh_execute and execute_command. The example usage reinforces the exact action.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It says 'when they're no longer needed', providing clear context for when to use this tool. It doesn't explicitly mention alternatives or when not to use, but the sibling tool names imply the distinction, so a slight deduction is warranted.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

ssh_executeA

Execute a command on a remote host via SSH

Example usage:

{
  "connectionId": "raspberry-pi",
  "command": "uname -a"
}

Configuration required in config.json:

{
  "ssh": {
    "enabled": true,
    "connections": {
      "raspberry-pi": {
        "host": "raspberrypi.local",
        "port": 22,
        "username": "pi",
        "password": "raspberry"
      }
    }
  }
}
ParametersJSON Schema
NameRequiredDescriptionDefault
commandYesCommand to execute
connectionIdYesID of the SSH connection to use

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions that SSH must be enabled in config.json and gives an example connection, which is useful. However, it does not disclose the command execution behavior (e.g., output format, error handling, potential destructive side-effects) or that it uses the specified password for authentication.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is structured and efficient, with a one-sentence purpose followed by illustrative JSON examples. The config block is large but necessary to show the setup requirements. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and no annotations, the description should explain what the tool returns or what 'execute' entails. It does neither, though it does provide configuration context. For a command execution tool, the lack of mention of output or error behavior leaves a moderate gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema descriptions are minimal ('Command to execute', 'ID of the SSH connection to use'). The description adds meaningful value by showing an example usage and the config structure, clarifying that connectionId refers to a key in the 'connections' object and command is a shell string.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Execute a command on a remote host via SSH', using a specific verb and resource. It distinguishes itself from sibling tools like ssh_disconnect (manage connection) and get_command_history (retrieve history).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a concrete example and configuration requirement, implying when to use the tool (when you have a configured SSH connection and need to run a command). However, it does not explicitly state when to use it over alternatives like execute_command, nor does it provide exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 4 tool updatesv1.0.0
    • First observedexecute_command
    • First observedget_command_history
    • First observedssh_disconnect
    • First observedssh_execute

TDQS

B3.1/5.0

Scored across 4 tools

Disambiguation3/5

The tools have some overlap in purpose that could cause confusion. Both execute_command and ssh_execute run commands, differing only in local vs. remote execution, which might lead to misselection if the agent doesn't carefully note the distinction. However, get_command_history and ssh_disconnect are clearly distinct, and the descriptions help clarify the differences.

Naming Consistency4/5

The naming follows a consistent verb_noun pattern throughout (e.g., execute_command, get_command_history, ssh_disconnect, ssh_execute), which is predictable and readable. There are minor deviations, such as the use of 'disconnect' versus 'execute' in the SSH tools, but overall, the pattern is maintained.

Tool Count3/5

With 4 tools, the count is borderline for the server's purpose as a 'Super Windows CLI MCP Server'. It feels thin, lacking coverage for common CLI operations like file management, process control, or network utilities, which might be expected in such a domain. However, it's not severely under-scoped.

Completeness2/5

There are significant gaps in the tool surface for a Windows CLI server. It lacks basic operations like listing files, managing processes, or handling network configurations, and the SSH tools seem like an add-on rather than core functionality. This incompleteness will likely cause agent failures when trying to perform common CLI tasks.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    F
    maintenance
    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.
    9
    1,570 npm
    267
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Enables secure command-line interactions on Windows systems with support for PowerShell, CMD, Git Bash, and WSL shells, providing controlled file access, command execution, and configurable security restrictions.
    6
    14 npm
    4
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    Enables secure command-line interactions on Windows systems through PowerShell, CMD, and Git Bash, with support for SSH remote connections, SFTP file transfers, system monitoring, and configurable security controls including command blocking and path restrictions.
    34
    2
    MIT