winrm-mcp

winrm-mcp

Enables running PowerShell and CMD commands on Windows hosts over WinRM, with multi-host inventory management.

Category
Visit Server

README

winrm-mcp

A deliberately small MCP server for running PowerShell and CMD commands on Windows hosts over WinRM. It takes the WinRM execution ideas from ssh-winrm-mcp, adds a focused multi-host inventory, and leaves out SSH, persistent sessions, jobs, command groups, and file transfer.

Tools

  • winrm_test — verify authentication and connectivity.
  • winrm_execute_powershell — execute PowerShell.
  • winrm_execute_cmd — execute CMD.
  • winrm_inventory_status, winrm_inventory_init, winrm_inventory_validate — manage inventory files.
  • winrm_host_list, winrm_host_get, winrm_host_save, winrm_host_update, winrm_host_delete — manage reusable hosts.

Each tool accepts an optional connection object. Values in it override the process environment:

{
  "host": "192.168.1.50",
  "username": "Administrator",
  "password_env": "MY_WINRM_PASSWORD",
  "auth": "ntlm",
  "ssl": true,
  "cert_validation": false
}

ssl chooses HTTPS (normally port 5986) versus HTTP (normally port 5985). cert_validation=false is needed for self-signed HTTPS listeners, but should only be used for trusted hosts.

Supported connection fields are host, username, password, password_env, port, ssl, auth, cert_validation, encryption, path, connect_timeout, read_timeout, and operation_timeout.

Multi-host inventory

Hosts can be stored in either inventory scope:

  • user (default): ${XDG_CONFIG_HOME:-~/.config}/winrm-mcp/inventory.json on Linux/macOS, or the matching %APPDATA% location on Windows.
  • project: .winrm-mcp/inventory.json under the current working directory.

Choose the process default with WINRM_MCP_INVENTORY_SCOPE=user or WINRM_MCP_INVENTORY_SCOPE=project. Every inventory and host tool also accepts an explicit scope, and execution tools accept inventory_scope. Project scope uses WINRM_MCP_PROJECT_DIR, then the launcher's logical PWD, then the process working directory. It refuses temporary deepagents_server_* paths instead of silently saving disposable inventory data. Set WINRM_MCP_PROJECT_DIR when the launcher working directory is not the desired project root. A fully custom file is supported through WINRM_MCP_INVENTORY_FILE; it is used when a call does not explicitly select a scope.

Create a project inventory and save two hosts:

winrm_inventory_init(scope="project")

winrm_host_save(
  name="epv1",
  scope="project",
  settings={
    "host": "10.0.110.50",
    "username": "Administrator",
    "password_env": "EPV1_WINRM_PASSWORD",
    "auth": "ntlm",
    "ssl": true,
    "cert_validation": false
  }
)

winrm_host_save(
  name="epv2",
  scope="project",
  settings={
    "host": "10.0.110.51",
    "username": "Administrator",
    "password_env": "EPV2_WINRM_PASSWORD",
    "auth": "ntlm",
    "ssl": true,
    "cert_validation": false
  }
)

Use a saved host by name:

winrm_test(saved_host="epv1", inventory_scope="project")
winrm_execute_powershell(saved_host="epv1", inventory_scope="project", command="hostname")
winrm_execute_cmd(saved_host="epv2", inventory_scope="project", command="whoami")

The optional connection object overrides fields from the saved host for that call. Inventory writes are atomic, and the inventory file is restricted to the current user (0600) on Unix-like systems. Inline passwords are supported but stored as plaintext in that protected JSON file; prefer password_env.

Omit connection when no overrides are needed. For compatibility with agents that serialize an optional value as text, connection="None", connection="null", and an empty connection string are treated as JSON null.

DeepAgents

DeepAgents can run the server directly from GitHub, so a local checkout is not required. Add the following entry to your DeepAgents .deepagents/.mcp.json file:

{
  "winrm": {
    "type": "stdio",
    "command": "uv",
    "args": [
      "tool",
      "run",
      "--with",
      "mcp>=1.28,<2",
      "--from",
      "git+https://github.com/bigbatmanorg/winrm-mcp.git",
      "winrm-mcp"
    ],
    "env": {
      "WINRM_MCP_HOST": "192.168.1.50",
      "WINRM_MCP_USERNAME": "Administrator",
      "WINRM_MCP_PASSWORD": "YOUR_SECRET",
      "WINRM_MCP_PORT": "5986",
      "WINRM_MCP_AUTH": "ntlm",
      "WINRM_MCP_SSL": "true",
      "WINRM_MCP_CERT_VALIDATION": "false",
      "WINRM_MCP_INVENTORY_SCOPE": "project",
      "WINRM_MCP_PROJECT_DIR": "${PWD}",
      "WINRM_MCP_CONNECT_TIMEOUT": "30",
      "WINRM_MCP_READ_TIMEOUT": "60",
      "WINRM_MCP_OPERATION_TIMEOUT": "30"
    }
  }
}

For reproducible installations, pin the repository to a release tag or commit:

"git+https://github.com/bigbatmanorg/winrm-mcp.git@YOUR_TAG_OR_COMMIT"

The example uses HTTPS with certificate verification disabled for a trusted development host with a self-signed certificate. Keep WINRM_MCP_CERT_VALIDATION=true when the listener certificate is trusted. Do not commit a real password to source control; use your normal DeepAgents secret-injection workflow for WINRM_MCP_PASSWORD. DeepAgents expands ${PWD} before launching the MCP server. Replace it with an absolute path if DeepAgents itself is launched from somewhere other than the project root.

Install and run

uv sync --extra dev
uv run pytest
uv run winrm-mcp

The default transport is stdio. A client configuration can supply stable connection defaults without putting credentials in every tool call:

{
  "servers": {
    "winrm": {
      "type": "stdio",
      "command": "uv",
      "args": ["--directory", "/home/toor/projects/winrm-mcp", "run", "winrm-mcp"],
      "env": {
        "WINRM_MCP_HOST": "192.168.1.50",
        "WINRM_MCP_USERNAME": "Administrator",
        "WINRM_MCP_PASSWORD_ENV": "MY_WINRM_PASSWORD",
        "MY_WINRM_PASSWORD": "replace-me",
        "WINRM_MCP_AUTH": "ntlm",
        "WINRM_MCP_SSL": "true",
        "WINRM_MCP_CERT_VALIDATION": "false"
      }
    }
  }
}

Available environment defaults correspond to the connection fields and use the WINRM_MCP_ prefix. Server settings are WINRM_MCP_TRANSPORT, WINRM_MCP_SERVER_HOST, and WINRM_MCP_SERVER_PORT. Inventory settings are WINRM_MCP_INVENTORY_SCOPE, WINRM_MCP_PROJECT_DIR, and WINRM_MCP_INVENTORY_FILE.

For Kerberos or CredSSP support, install the matching optional extra:

uv sync --extra kerberos
uv sync --extra credssp

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
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
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
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
E2B

E2B

Using MCP to run code via e2b.

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