WindowsInstall MCP

WindowsInstall MCP

MCP server for Windows batch deployment management, enabling machine management, WinRM remote restart, iVentoy-based PXE unattended reinstall, and scheduled reboot/reinstall tasks via natural language.

Category
Visit Server

README

WindowsInstall MCP

基于 MCP (Model Context Protocol) 的 Windows 批量部署管理工具,支持远程重启、PXE 重装、定时任务等功能。

功能概览

功能 说明
机器管理 查看、添加、修改、删除机器配置
WinRM 远程操作 通过 WinRM 重启远程 Windows 机器
PXE 重装 通过 iVentoy + WinRM 实现无人值守重装
定时任务 定时重启/重装,到时间自动执行
TrustedHosts 管理 自动管理 WinRM 信任列表

环境要求

  • Windows 10/11 或 Windows Server

  • Python 3.10+

  • PowerShell 5.1+

  • 管理员权限AI 客户端需以管理员身份运行

  • WinRM 已启用(运行 winrm quickconfig 或在 PowerShell 中执行以下命令):

    Enable-PSRemoting -Force
    Set-Item WSMan:\localhost\Client\TrustedHosts * -Concatenate -Force
    
  • iVentoy 已安装并在运行(PXE 重装功能依赖,默认监听 http://127.0.0.1:26000

前置配置

1. 生成机器凭据

MCP 会通过 PowerShell Export-Clixml 自动生成 <机器名>.credential.xml 加密文件,用于 WinRM 认证。

注意:同一个 Windows 用户创建的 XML 才能读取。MCP Server 需以创建凭据的同一用户身份运行。如果换人使用这台 MCP Server,需要重新为所有机器生成凭据。

通过 MCP 对话添加机器(推荐),MCP 会自动生成凭据文件并写入 machines.json

添加 PC-03
IP 是 172.30.8.203
MAC 是 AA-BB-CC-DD-EE-03
用户名 public
密码 123456

也可以手动编辑 machines.json,但需要先生成凭据文件:

{
    "PC-01": {
        "ip": "172.30.8.200",
        "mac": "AA-BB-CC-DD-EE-01",
        "credential_file": "PC-01.credential.xml"
    }
}

2. MCP 客户端配置

详见 根目录 README

功能用法

查看机器

查看所有电脑
查看 PC-01

添加机器

添加 PC-03
IP 是 172.30.8.203
MAC 是 AA-BB-CC-DD-EE-03
用户名 public
密码 123456

也可以一次提供多台机器的信息。

修改机器

把 PC-01 的 IP 改成 172.30.8.201
把 PC-01 的 MAC 改成 AA-BB-CC-DD-EE-02
更新 PC-01 的登录凭据,用户名 public,密码 123456

删除机器

删除 PC-01
同时删除 PC-01 和 PC-02

重启机器

重启 PC-01
同时重启 PC-01、PC-02、PC-03

重装机器(PXE 无人值守安装)

重装 PC-01
同时重装 PC-01 和 PC-02

流程:添加 MAC 到 iVentoy → 等待 60 秒自动移除 → WinRM 重启 → PXE 启动 → 无人值守安装。

定时重启

2026-08-19 02:00 重启 PC-01
2026-08-19 02:00 同时重启 PC-01 和 PC-02

时间格式:YYYY-MM-DD HH:MM

定时重装

2026-08-19 03:00 重装 PC-01
2026-08-19 03:00 同时重装 PC-01、PC-02、PC-03

查看/取消定时任务

查看所有定时任务
取消任务 MCP_Reboot_20260819_0200_xxxxxxxx
取消 MCP_Reboot_xxx 和 MCP_Reinstall_xxx
取消全部定时任务

查看 TrustedHosts

查看 TrustedHosts

项目结构

.
├── server.py              # MCP Server 主程序
├── machines.json          # 机器配置(本地 JSON 文件存储)
├── scheduled_tasks.json   # 定时任务记录(本地 JSON 文件存储)
├── scheduled_jobs/        # 定时任务详情(本地 JSON 文件存储)
├── *.credential.xml       # 认证凭据(本地加密 XML 文件)
├── mcp.json               # MCP 客户端连接配置
├── requirements.txt       # Python 依赖
└── README.md

安全说明

  • 凭证文件*.credential.xml 使用 PowerShell Export-Clixml 加密,仅创建者可读取
  • 敏感文件已加入 .gitignore.credential.xmlmachines.jsonscheduled_tasks.json 不会被提交到 Git
  • 运行用户:MCP Server 需以创建凭据的同一 Windows 用户身份运行。不同用户创建的凭据互不兼容,换人使用需重新生成所有凭据
  • 网络暴露:iVentoy API 默认监听 127.0.0.1:26000,仅限本机访问。如需远程调用,请确认防火墙规则

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured