IW

inframcp/win-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

6 stars 3 forks 质量 80 趋势 34MIT

Gives your AI Agent the ability to interact with windows servers, execute powershell, read system info, etc.

概览

A Model Context Protocol (MCP) server that provides AI agents with the ability to interact with Windows servers using Windows Remote Management (WinRM). This server enables secure remote PowerShell execution and system management tasks on Windows hosts. - : Uses domain credentials stored in macOS Keychain with TouchID authentication - : Execute arbitrary PowerShell commands on remote Windows hosts - : Get basic system information, running services, and disk space - : Comprehensive error handling with helpful error messages - : Credentials are cleared from memory immediately after use 1. : Ensure target Windows hosts have WinRM enabled and configured. 2. : The server will prompt for credentials on first use and cache them securely in macOS Keychain with 4-hour expiration. For non-interactive/CI environments you can skip the prompt entirely by setting environment variables.

README

以下为原文 README 节选,完整内容请查看原文。

Win MCP Server

A Model Context Protocol (MCP) server that provides AI agents with the ability to interact with Windows servers using Windows Remote Management (WinRM). This server enables secure remote PowerShell execution and system management tasks on Windows hosts.

Features

  • Secure Authentication: Uses domain credentials stored in macOS Keychain with TouchID authentication
  • PowerShell Execution: Execute arbitrary PowerShell commands on remote Windows hosts
  • System Information: Get basic system information, running services, and disk space
  • Error Handling: Comprehensive error handling with helpful error messages
  • Memory Safety: Credentials are cleared from memory immediately after use

Installation

pip install win-mcp-server

From Source

git clone https://github.com/rorymcmahon/win-mcp-server.git
cd win-mcp-server
pip install -e .

Configuration

Prerequisites

  1. WinRM Configuration: Ensure target Windows hosts have WinRM enabled and configured.

  2. Credential Setup: The server will prompt for credentials on first use and cache them securely in macOS Keychain with 4-hour expiration.

    For non-interactive/CI environments you can skip the prompt entirely by setting environment variables. When both are present they take precedence over any cached Keychain entry:

    export WINRM_USER="myuser"
    export WINRM_PWD="mypassword"
    

    The hyphenated names WINRM-USER / WINRM-PWD are also accepted if your launcher can set them.

MCP Configuration

Add to your MCP settings file (e.g., ~/.config/mcp/settings.json):

{
  "mcpServers": {
    "winrm": {
      "command": "winrm-mcp-server"
    }
  }
}

Available Tools

setup_credentials(hostname: str)

Setup credentials for a Windows host (interactive mode).

Parameters:

  • hostname: The target Windows hostname (FQDN)

Returns:

  • status: Success or error status
  • message: Confirmation message

execute_powershell(hostname: str, command: str)

Execute arbitrary PowerShell commands on a remote Windows host.

Parameters:

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "winrm": { "command": "winrm-mcp-server" } } }