Windows Command Line MCP Server

Windows Command Line MCP Server

一个安全的模型上下文协议服务器,允许人工智能模型安全地与 Windows 命令行功能交互,从而实现对系统命令的受控执行、项目创建和系统信息检索。

Category
访问服务器

Tools

list_running_processes

List all running processes on the system. Can be filtered by providing an optional filter string that will match against process names.

get_system_info

Retrieve system information including OS, hardware, and user details. Can provide basic or full details.

get_network_info

Retrieve network configuration information including IP addresses, adapters, and DNS settings. Can be filtered to a specific interface.

get_scheduled_tasks

Retrieve information about scheduled tasks on the system. Can query all tasks or get detailed status of a specific task.

get_service_info

Retrieve information about Windows services. Can query all services or get detailed status of a specific service.

list_allowed_commands

List all commands that are allowed to be executed by this server. This helps understand what operations are permitted.

execute_command

Execute a Windows command and return its output. Only commands in the allowed list can be executed. This tool should be used for running simple commands like 'dir', 'echo', etc.

execute_powershell

Execute a PowerShell script and return its output. This allows for more complex operations and script execution. PowerShell must be in the allowed commands list.

README

Windows 命令行 MCP 服务器

一个安全的模型上下文协议 (MCP) 服务器,使 AI 模型能够安全高效地与 Windows 命令行功能交互。

版本 许可证: MIT smithery badge

概述

Windows 命令行 MCP 服务器在 AI 模型和 Windows 系统操作之间提供了一个强大而安全的桥梁。 它允许受控地执行命令、创建项目和检索系统信息,同时保持严格的安全协议。

主要特性

🔒 增强的安全性

  • 全面的命令允许列表
  • 严格的输入验证
  • 防止破坏性的系统操作
  • 可配置的安全级别

🛠 开发工具支持

  • React、Node.js 和 Python 的项目创建
  • 安全的开发环境交互
  • 扩展的命令支持开发工作流程

🖥 系统交互能力

  • 执行 Windows CLI 命令
  • 运行 PowerShell 脚本
  • 检索系统和网络信息
  • 管理进程和服务

安装

通过 Smithery 安装

要通过 Smithery 为 Claude Desktop 自动安装 Windows 命令行 MCP 服务器:

npx -y @smithery/cli install @alxspiker/Windows-Command-Line-MCP-Server --client claude

前提条件

  • Node.js 16 或更高版本
  • npm 或 yarn
  • Windows 操作系统

设置

git clone https://github.com/alxspiker/Windows-Command-Line-MCP-Server.git
cd Windows-Command-Line-MCP-Server
npm install
npm run build

用法

命令行选项

  • 默认模式:使用预定义的安全命令
  • --allow-all: 在扩展模式下运行(具有额外的预防措施)
  • 自定义命令列表可以指定为参数

项目创建

使用内置的项目创建工具安全地创建新项目:

  • 支持的项目类型:React、Node.js、Python
  • 项目在沙盒 ~/AIProjects 目录中创建

可用工具

  1. execute_command: 运行 Windows CLI 命令
  2. execute_powershell: 执行 PowerShell 脚本
  3. create_project: 安全地创建新的开发项目
  4. list_running_processes: 检索活动的系统进程
  5. get_system_info: 收集系统配置详细信息
  6. get_network_info: 检索网络适配器信息
  7. get_scheduled_tasks: 列出和查询系统任务
  8. get_service_info: 管理和查询 Windows 服务
  9. list_allowed_commands: 列出服务器可以执行的所有命令

与 Claude for Desktop 一起使用

要将此服务器与 Claude for Desktop 一起使用:

  1. 使用上面的设置说明构建服务器
  2. 将其添加到您的 claude_desktop_config.json
{
  "mcpServers": {
    "windows-cmd": {
      "command": "node",
      "args": ["/path/to/dist/index.js"]
    }
  }
}

/path/to/dist/index.js 替换为 dist 目录中构建的 index.js 文件的绝对路径。

  1. 重新启动 Claude for Desktop
  2. 现在,您可以通过要求 Claude 执行 Windows 系统操作来使用这些工具

安全注意事项

允许的命令

默认情况下,仅允许安全命令:

  • 系统信息检索
  • 网络配置
  • 进程管理
  • 开发工具交互

阻止的操作

危险命令始终被阻止,包括:

  • 磁盘格式化
  • 用户管理
  • 系统关闭
  • 关键注册表修改

配置

通过指定允许的命令或使用配置标志来自定义服务器的行为。

示例

# 使用默认的安全命令运行
node dist/index.js

# 使用特定的允许命令运行
node dist/index.js dir echo npm git

# 在扩展模式下运行(谨慎使用)
node dist/index.js --allow-all

贡献

  1. Fork 仓库
  2. 创建您的功能分支 (git checkout -b feature/amazing-feature)
  3. 提交您的更改 (git commit -m 'Add some amazing feature')
  4. 推送到分支 (git push origin feature/amazing-feature)
  5. 打开一个 Pull Request

许可证

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

致谢

  • 受模型上下文协议规范的启发
  • 开发时考虑了安全性和灵活性

版本历史

  • 0.3.0: 实现了 README 中提到的所有工具(系统信息、网络信息、进程管理、服务信息)
  • 0.2.0: 添加了项目创建,扩展了开发工具
  • 0.1.0: 初始版本,具有基本的命令执行功能

支持

如有问题、疑问或建议,请在 GitHub 上打开一个 issue

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选