Skip to main content
Glama

Windows Command Line MCP Server

Windows 命令行 MCP 服务器

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

版本许可证:MIT 铁匠徽章

概述

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

Related MCP server: Command Executor MCP Server

主要特点

🔒 增强的安全性

  • 全面的命令允许列表

  • 严格的输入验证

  • 防止破坏性系统操作

  • 可配置的安全级别

🛠 开发工具支持

  • 为 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. 执行命令:运行 Windows CLI 命令

  2. 执行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 桌面版

  2. 您现在可以通过要求 Claude 执行 Windows 系统操作来使用这些工具

安全注意事项

允许的命令

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

  • 系统信息检索

  • 网络配置

  • 流程管理

  • 开发工具交互

阻止的操作

危险命令总是被阻止,包括:

  • 磁盘格式化

  • 用户管理

  • 系统关闭

  • 关键注册表修改

配置

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

例子

# Run with default safe commands node dist/index.js # Run with specific allowed commands node dist/index.js dir echo npm git # Run in extended mode (use with caution) node dist/index.js --allow-all

贡献

  1. 分叉存储库

  2. 创建你的功能分支( git checkout -b feature/amazing-feature

  3. 提交您的更改( git commit -m 'Add some amazing feature'

  4. 推送到分支( git push origin feature/amazing-feature

  5. 打开拉取请求

执照

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

致谢

  • 受到模型上下文协议规范的启发

  • 开发时充分考虑了安全性和灵活性

版本历史记录

  • 0.3.0 :实现了 README 中提到的所有工具(系统信息、网络信息、进程管理、服务信息)

  • 0.2.0 :添加项目创建,扩展开发工具

  • 0.1.0 :具有基本命令执行功能的初始版本

支持

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

Latest Blog Posts

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/alxspiker/Windows-Command-Line-MCP-Server'

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