Token导航 LogoToken导航

MCP Server · 开发工具

Win CLI MCP Server

Model Context Protocol server for secure command-line interactions on Windows systems

stdio官方级别未说明来源级核验工具 9@simonb97/server-win-cli
命令行工具JavaScriptClaude安全控制Claude Desktop

快速开始

作者 / 组织
SimonB97
提供方
SimonB97
运行时
Node.js

工具数量

9

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

268

仓库热度

收录来源

2 个

MCP.so

选型结论

Win CLI MCP Server 属于开发工具类 MCP Server,公开资料标注 9 个工具,通过stdio 本地进程接入,适配 Claude、Claude Desktop,有可以直接复制的安装命令;接入前先确认权限范围。

分类

开发工具

传输方式

stdio

认证方式

无需认证

部署方式

公开资料未说明

安装与配置

安装命令

npx @simonb97/server-win-cli --init-config ./config.json

客户端配置示例

{
  "mcpServers": {
    "win-cli-mcp-server": {
      "command": "npx",
      "args": [
        "@simonb97/server-win-cli",
        "--init-config",
        "./config.json"
      ]
    }
  }
}

按公开安装命令拼出来的示例,字段名和参数以仓库 README 为准;带 YOUR_API_KEY 这类占位符的位置记得换成自己的值。

上手步骤

  1. 1

    准备运行环境

    stdio 服务在本地起进程,需要先装好 Node.js,再按安装命令拉取依赖。

  2. 2

    安装服务

    复制下面的安装命令执行;命令里带占位符的位置换成自己的密钥或路径。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 9 个工具,随便调一个只读工具确认能返回结果。

接入前确认

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

详细介绍

Windows CLI MCP服务器

\[!小心\] 项目已弃用 -不再维持。 使用https://github.com/wonderwhy-er/DesktopCommanderMCP而是用于类似的功能。
\[!重要\] 此MCP服务器通过SSH提供对系统命令行界面和远程系统的直接访问。启用后,它授予对文件、环境变量、命令执行功能和远程服务器管理的访问权限。 - 检查并限制允许的路径和SSH连接 - 启用目录限制 - 配置命令块 - 考虑安全影响 看 配置 了解更多详情。

- 配置位置 - 默认配置 - 配置设置 - 安全设置 - 外壳配置 - SSH配置

- 工具 - 资源

特性

  • 多壳支持:在PowerShell、命令提示符(CMD)和Git Bash中执行命令
  • SSH支持:通过SSH在远程系统上执行命令
  • 资源暴露:将SSH连接、当前目录和配置作为MCP资源查看
  • 安全控制:

- 命令和SSH命令阻止(完整路径,大小写变化) - 工作目录验证 - 最大命令长度限制 - 命令记录和历史跟踪 - 智能论证验证

  • 可配置的:

- 自定义安全规则 - 外壳特定设置 - SSH连接配置文件 - 路径限制 - 已阻止的命令列表

请参阅 API 有关服务器为MCP客户端提供的工具和资源的更多详细信息,请参阅第节。

备注:服务器只允许在配置的目录内、使用允许的命令和配置的SSH连接上进行操作。

使用Claude Desktop

将此添加到您的 claude_desktop_config.json:

{
  "mcpServers": {
    "windows-cli": {
      "command": "npx",
      "args": ["-y", "@simonb97/server-win-cli"]
    }
  }
}

要与特定的配置文件一起使用,请添加 --config 标志:

{
  "mcpServers": {
    "windows-cli": {
      "command": "npx",
      "args": [
        "-y",
        "@simonb97/server-win-cli",
        "--config",
        "path/to/your/config.json"
      ]
    }
  }
}

配置后,您可以:

  • 使用可用工具直接执行命令
  • 在参考资料部分查看配置的SSH连接和服务器配置
  • 通过提供的工具管理SSH连接

配置

服务器使用JSON配置文件来定制其行为。您可以指定安全控制、shell配置和SSH连接的设置。

  1. 要创建默认配置文件,请执行以下操作之一:

一 复制 config.json.example 向 config.json,或

b 运行:

npx @simonb97/server-win-cli --init-config ./config.json
  1. 然后设置 --config 标记指向配置文件,如中所述 使用Claude Desktop 部分。

配置位置

服务器在以下位置查找配置(按顺序):

  1. 指定的路径 --config 旗帜
  2. 当前目录中的./config.json
  3. ~/.win-cli-mcp/config.json位于用户的主目录中

如果找不到配置文件,服务器将使用默认(受限)配置:

默认配置

备注:默认配置被设计为具有限制性和安全性。在中查找有关每个设置的更多详细信息 配置设置 部分。

{
  "security": {
    "maxCommandLength": 2000,
    "blockedCommands": [
      "rm",
      "del",
      "rmdir",
      "format",
      "shutdown",
      "restart",
      "reg",
      "regedit",
      "net",
      "netsh",
      "takeown",
      "icacls"
    ],
    "blockedArguments": [
      "--exec",
      "-e",
      "/c",
      "-enc",
      "-encodedcommand",
      "-command",
      "--interactive",
      "-i",
      "--login",
      "--system"
    ],
    "allowedPaths": ["User's home directory", "Current working directory"],
    "restrictWorkingDirectory": true,
    "logCommands": true,
    "maxHistorySize": 1000,
    "commandTimeout": 30,
    "enableInjectionProtection": true
  },
  "shells": {
    "powershell": {
      "enabled": true,
      "command": "powershell.exe",
      "args": ["-NoProfile", "-NonInteractive", "-Command"],
      "blockedOperators": ["&", "|", ";", "`"]
    },
    "cmd": {
      "enabled": true,
      "command": "cmd.exe",
      "args": ["/c"],
      "blockedOperators": ["&", "|", ";", "`"]
    },
    "gitbash": {
      "enabled": true,
      "command": "C:\\Program Files\\Git\\bin\\bash.exe",
      "args": ["-c"],
      "blockedOperators": ["&", "|", ";", "`"]
    }
  },
  "ssh": {
    "enabled": false,
    "defaultTimeout": 30,
    "maxConcurrentSessions": 5,
    "keepaliveInterval": 10000,
    "keepaliveCountMax": 3,
    "readyTimeout": 20000,
    "connections": {}
  }
}

配置设置

配置文件分为三个主要部分: security, shells,以及 ssh.

安全设置
{
  "security": {
    // Maximum allowed length for any command
    "maxCommandLength": 1000,

    // Commands to block - blocks both direct use and full paths
    // Example: "rm" blocks both "rm" and "C:\\Windows\\System32\\rm.exe"
    // Case-insensitive: "del" blocks "DEL.EXE", "del.cmd", etc.
    "blockedCommands": [
      "rm", // Delete files
      "del", // Delete files
      "rmdir", // Delete directories
      "format", // Format disks
      "shutdown", // Shutdown system
      "restart", // Restart system
      "reg", // Registry editor
      "regedit", // Registry editor
      "net", // Network commands
      "netsh", // Network commands
      "takeown", // Take ownership of files
      "icacls" // Change file permissions
    ],

    // Arguments that will be blocked when used with any command
    // Note: Checks each argument independently - "cd warm_dir" won't be blocked just because "rm" is in blockedCommands
    "blockedArguments": [
      "--exec", // Execution flags
      "-e", // Short execution flags
      "/c", // Command execution in some shells
      "-enc", // PowerShell encoded commands
      "-encodedcommand", // PowerShell encoded commands
      "-command", // Direct PowerShell command execution
      "--interactive", // Interactive mode which might bypass restrictions
      "-i", // Short form of interactive
      "--login", // Login shells might have different permissions
      "--system" // System level operations
    ],

    // List of directories where commands can be executed
    "allowedPaths": ["C:\\Users\\YourUsername", "C:\\Projects"],

    // If true, commands can only run in allowedPaths
    "restrictWorkingDirectory": true,

    // If true, saves command history
    "logCommands": true,

    // Maximum number of commands to keep in history
    "maxHistorySize": 1000,

    // Timeout for command execution in seconds (default: 30)
    "commandTimeout": 30,

    // Enable or disable protection against command injection (covers ;, &, |, \`)
    "enableInjectionProtection": true
  }
}
外壳配置
{
  "shells": {
    "powershell": {
      // Enable/disable this shell
      "enabled": true,
      // Path to shell executable
      "command": "powershell.exe",
      // Default arguments for the shell
      "args": ["-NoProfile", "-NonInteractive", "-Command"],
      // Optional: Specify which command operators to block
      "blockedOperators": ["&", "|", ";", "`"]  // Block all command chaining
    },
    "cmd": {
      "enabled": true,
      "command": "cmd.exe",
      "args": ["/c"],
      "blockedOperators": ["&", "|", ";", "`"]  // Block all command chaining
    },
    "gitbash": {
      "enabled": true,
      "command": "C:\\Program Files\\Git\\bin\\bash.exe",
      "args": ["-c"],
      "blockedOperators": ["&", "|", ";", "`"]  // Block all command chaining
    }
  }
}
SSH配置
{
  "ssh": {
    // Enable/disable SSH functionality
    "enabled": false,

    // Default timeout for SSH commands in seconds
    "defaultTimeout": 30,

    // Maximum number of concurrent SSH sessions
    "maxConcurrentSessions": 5,

    // Interval for sending keepalive packets (in milliseconds)
    "keepaliveInterval": 10000,

    // Maximum number of failed keepalive attempts before disconnecting
    "keepaliveCountMax": 3,

    // Timeout for establishing SSH connections (in milliseconds)
    "readyTimeout": 20000,

    // SSH connection profiles
    "connections": {
      // NOTE: these examples are not set in the default config!
      // Example: Local Raspberry Pi
      "raspberry-pi": {
        "host": "raspberrypi.local", // Hostname or IP address
        "port": 22, // SSH port
        "username": "pi", // SSH username
        "password": "raspberry", // Password authentication (if not using key)
        "keepaliveInterval": 10000, // Override global keepaliveInterval
        "keepaliveCountMax": 3, // Override global keepaliveCountMax
        "readyTimeout": 20000 // Override global readyTimeout
      },
      // Example: Remote server with key authentication
      "dev-server": {
        "host": "dev.example.com",
        "port": 22,
        "username": "admin",
        "privateKeyPath": "C:\\Users\\YourUsername\\.ssh\\id_rsa", // Path to private key
        "keepaliveInterval": 10000,
        "keepaliveCountMax": 3,
        "readyTimeout": 20000
      }
    }
  }
}

API

工具

  • execute_命令

- 在指定的shell中执行命令 - 输入: - shell (string):要使用的Shell(“powershell”、“cmd”或“gitbash”) - command (string):要执行的命令 - workingDir (可选字符串):工作目录 - 以文本形式返回命令输出,如果执行失败,则返回错误消息

  • get_command_history

- 获取已执行命令的历史记录 - 输入: limit (可选编号) - 返回带有时间戳的命令历史记录及其输出

  • ssh执行

- 通过SSH在远程系统上执行命令 - 输入: - connectionId (string):要使用的SSH连接的ID - command (string):要执行的命令 - 以文本形式返回命令输出,如果执行失败,则返回错误消息

  • ssh断开连接

- 断开与SSH服务器的连接 - 输入: - connectionId (string):要断开的SSH连接的ID - 返回确认消息

  • create_ssh_connection

- 创建新的SSH连接 - 输入: - connectionId (string):新SSH连接的ID - connectionConfig (object):连接配置详细信息,包括主机、端口、用户名以及密码或privateKeyPath - 返回确认消息

  • read_ssh_连接

- 读取所有已配置的SSH连接 - 从配置中返回所有SSH连接的列表

  • update_ssh_connection

- 更新现有的SSH连接 - 输入: - connectionId (string):要更新的SSH连接的ID - connectionConfig (对象):新连接配置详细信息 - 返回确认消息

  • delete_ssh_connection

- 删除SSH连接 - 输入: - connectionId (string):要删除的SSH连接的ID - 返回确认消息

  • get_current目录

- 获取服务器的当前工作目录 - 返回当前工作目录路径

资源

  • SSH连接

- URI格式: ssh://{connectionId} - 包含隐藏敏感信息的连接详细信息 - 每个配置的SSH连接对应一个资源 - 例子: ssh://raspberry-pi 显示了“raspberry pi”连接的配置

  • SSH配置

- URI: ssh://config - 包含整体SSH配置和所有连接(密码被屏蔽) - 显示defaultTimeout、maxConcurrentSessions和连接列表等设置

  • 当前目录

- URI: cli://currentdir - 包含CLI服务器的当前工作目录 - 显示默认情况下执行命令的路径

  • CLI配置

- URI: cli://config - 包含CLI服务器配置(不包括敏感数据) - 显示安全设置、shell配置和SSH设置

安全考虑

内置安全功能(始终处于活动状态)

以下安全功能已硬编码到服务器中,无法禁用:

  • 不区分大小写的命令阻止:所有命令阻塞都不区分大小写(例如,如果“DEL”在blockedCommands中,则“DEL.EXE”、“DEL.cmd”等都会被阻塞)
  • 智能路径解析:服务器解析完整的命令路径以防止绕过尝试(如果“rm”被阻止,则阻止“C:\\Windows\\System32\\rm.exe”)
  • 命令解析智能:避免了误报(例如,“warm_dir”不会因为“rm”在blockedCommands中而被阻止)
  • 输入验证:所有用户输入在执行前都经过验证
  • 壳牌工艺管理:进程在执行或超时后正确终止
  • 敏感数据屏蔽:密码在资源中自动屏蔽(替换为\*\*\*\*\*\*)

可配置的安全功能(默认为活动)

这些安全功能可以通过config.json文件进行配置:

  • 命令阻止:中指定的命令 blockedCommands 数组被阻止(默认包括rm、del、format等危险命令)
  • 参数阻止:中指定的参数 blockedArguments 数组被阻止(默认包括潜在危险标志)
  • 指令注入保护:防止命令链(默认情况下通过启用 enableInjectionProtection: true)
  • 工作目录限制:将命令执行限制到指定目录(默认情况下通过启用 restrictWorkingDirectory: true)
  • 命令长度限制:限制最大命令长度(默认值:2000个字符)
  • 命令超时:终止运行时间过长的命令(默认值:30秒)
  • 命令记录:记录命令历史记录(默认情况下通过启用 logCommands: true)

重要安全警告

这些不是功能,而是需要注意的重要安全考虑因素:

  • 环境准入:命令可以访问可能包含敏感信息的环境变量
  • 文件系统访问:命令可以在允许的路径内读/写文件-请仔细配置 allowedPaths 防止访问敏感数据

许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。

工具与能力

工具数量

9

资源数量

0

提示词数量

0

能力标签

os-automationmcpclaudeclaude-aimcp-servermodelcontextprotocol命令行工具JavaScript

支持客户端

ClaudeClaude Desktop

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

让助手直接读代码

把仓库、提交记录和 issue 交给模型检索,补全和重构时不用来回复制文件。

在对话里跑命令

触发构建、测试和脚本,执行结果直接回到上下文,省去切终端。

接进开发流程

把 PR、CI 状态和代码审查接进助手,减少在几个工具之间跳。

选择建议

值得选的地方

  • 只提供 9 个工具,职责集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已经适配 Claude、Claude Desktop,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好 Node.js,换机器要重新装一遍。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在开发工具场景里让模型直接调用外部能力的人。
  • 已经在用 Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
Win CLI MCP Server

MCP.so · 本页

9stdio有2 个2026-05-17
Git 838e2ec1

MCP World

12stdio有2 个2026-05-17
Markitdown MCP 2c653a5f

MCP World

1stdio有1 个2026-05-17
Context7 MCP C671e75a

MCP World

0stdio有1 个2026-05-17
Context7 831acf40

MCP World

0stdio有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

Win CLI MCP Server 怎么安装?

公开资料给出的安装命令是 npx @simonb97/server-win-cli --init-config ./config.json,运行环境为 Node.js。装完后按客户端要求写进 MCP 配置,重启客户端生效。

Win CLI MCP Server 怎么在 Claude Desktop、Cursor 里配置?

它是stdio 本地进程,客户端配置里要写启动命令和参数,运行环境是 Node.js;保存后完全退出客户端再打开,配置才会生效。

Win CLI MCP Server 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Win CLI MCP Server 需要 API Key 吗?

公开资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

Win CLI MCP Server 支持哪些客户端?

公开资料标注支持 Claude、Claude Desktop;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

来源信息

继续浏览同类 MCP