# powershell-mcp [Health: Active]

**Category:** 📂 Browser Automation  
**Repository:** https://github.com/IMRRD/powershell-mcp  
**GitHub Stars:** 1  
**npm Downloads (last month):** 1341  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/powershell-mcp

## Description
Headless Windows ops over MCP: hidden PowerShell + in-process SSH, WinRM & SFTP.

## Tools
Capabilities this server exposes over MCP:

- **run_powershell** — Run a PowerShell script/command on this Windows host in a hidden process (no console window appears). Returns stdout, stderr and exit code. Use for any Windows command, file, or system task.
- **list_services** — List Windows services, optionally filtered by a name pattern. Returns Name, DisplayName, Status.
- **get_service** — Get detailed status of one Windows service by name.
- **control_service** — Start, stop, or restart a Windows service (requires the MCP host process to have sufficient privileges).
- **system_info** — Return OS, CPU, memory and disk summary for this Windows host.
- **ssh_exec** — Run a command on a remote host over SSH, fully in-process (no ssh.exe, no WSL â€” works headless). Use for Linux hosts or any OpenSSH target. Auth via privateKeyPath or password. Returns stdout, stderr, exit code.
- **winrm_exec** — Run a command on a remote Windows host via PowerShell Remoting (WinRM / Invoke-Command). Native to Windows Server â€” no SSH server or agent needed on the target, only WinRM enabled. Output captured in-process (no console window).
- **sftp_upload** — Upload a local file to a remote host over SFTP, in-process (ssh2 â€” no scp.exe, no WSL, headless). Use to deploy scripts/configs to Linux hosts.
- **sftp_download** — Download a file from a remote host to this Windows host over SFTP, in-process (ssh2 â€” no scp.exe, no WSL, headless).
- **run_program** — Run a native executable DIRECTLY (no shell) in a hidden process and capture clean stdout/stderr + exit code. Use this for console programs like gh, git, docker, node, python, etc. -- direct execution captures their stdout/stderr without PowerShell pipeline semantics. Historical hidden-shell native stdout loss is executable/environment-specific; it is not universal. Provide the program and an args array (no shell quoting needed).
- **start_remote_batch** — Opt-in process-local SSH/WinRM batch; 1–32 explicit targets, up to 8 concurrent, per-target deadline. No discovery or retry. SSH supports at most four explicit jumps. Unknown after server restart.
- **remote_batch_status** — Read ordered per-target batch records; unavailable after process restart.
- **cancel_remote_batch** — Stop dispatch of queued targets; active targets become unknown, not confirmed terminated.
- **runtime_capabilities** — Read-only runtime package, protocol, supported and available engines, transports and limits; no identity, environment or secrets.
- **start_execution** — Start a local executable directly with durable idempotency and bounded output. No shell; remote targets unsupported.
- **execution_status** — Read a local execution state. Unknown after restart means no automatic replay or verified ownership.
- **read_execution_output** — Read a bounded base64 output page, including while running.
- **cancel_execution** — Request bounded local cancellation. Windows Job Objects and Linux subreaper/pidfds confirm owned-tree termination asynchronously; failures remain unknown. Recovered runs are never signalled.
- **read_output_log** — Read a bounded raw byte page from an opt-in session log; base64 encoded. Handles are process-local and expire after one hour.
- **delete_output_log** — Delete a session log by opaque handle.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "powershell-mcp": {
    "command": "npx",
    "args": ["-y","@imrrd/powershell-mcp@latest"]
  }
}
```

## Documentation

## What powershell-mcp does

powershell-mcp exposes Windows administration and process-execution capabilities through MCP. Agents can run PowerShell in a hidden process, execute native programs directly without shell quoting, inspect Windows services and system resources, and start, monitor, read, or cancel bounded local executions.

Remote operations cover SSH commands for OpenSSH-compatible hosts, WinRM commands for remote Windows systems, and SFTP transfers in both directions. SSH and SFTP run in-process, so these operations do not require ssh.exe, scp.exe, or WSL. WinRM uses PowerShell Remoting and requires WinRM on the target.

## How it works

Local PowerShell and executable calls return structured execution information including standard output, standard error, exit status, duration, timeout state, termination status, and truncation details. Output is limited per stream, with head or tail retention available. PowerShell execution prefers PowerShell 7 through `pwsh` and can fall back to `powershell.exe`.

The service and system tools provide narrower operations for listing, inspecting, and controlling Windows services, plus summaries of the operating system, CPU, memory, and disk drives. Remote batch execution accepts explicitly supplied SSH or WinRM targets, supports up to 32 targets and eight concurrent operations, and allows per-target deadlines. Batch state and execution handles are process-local and are not recovered after a server restart.

Optional output logging preserves bounded raw stdout and stderr separately. Logs are disabled unless requested, use opaque process-local handles, support paginated base64 reads, and expire after one hour for completed handles.

## Setup and configuration

The PowerShell engine can be selected with `PWSH_MCP_EXE`; otherwise the server uses its preferred engine and fallback behavior. `POWERSHELL_MCP_LOG_PARENT` can select the parent directory for opt-in output-log files. Logging reserves up to 64 MiB in total and uses the configured location, `TMPDIR`, or the operating system temporary directory as applicable.

Remote SSH and SFTP calls accept a private-key path or password. WinRM calls can use a username, password, SSL, and an authentication mode. Credentials and authentication options are not included in execution results.

## Tools and capabilities

- Run hidden PowerShell commands with `run_powershell`.
- Execute native programs directly with `run_program`.
- List, inspect, start, stop, restart, and query Windows services.
- Read Windows OS, CPU, memory, and disk summaries.
- Execute SSH or WinRM commands on remote hosts.
- Upload and download files through SFTP.
- Start, inspect, page, and cancel local executions.
- Dispatch and manage explicit SSH or WinRM batches.
- Read runtime capabilities and optional raw output logs.

## Limitations and notes

Service control requires sufficient privileges in the MCP host process. WinRM requires the remote Windows host to have WinRM enabled. Batch targets are explicit; the batch tools do not discover targets or retry operations.

Timeouts and cancellation apply to the local process or dispatch state and do not prove that remote work or descendant processes stopped. Unknown status can result after a restart or when termination cannot be confirmed. Recovered executions are not automatically replayed or signalled.

Opt-in logs can contain secrets emitted by commands, so logging should be avoided for sensitive operations. Logs are protected for the current operating-system user and SYSTEM on Windows, or with restrictive permissions on POSIX systems. Constrained PowerShell endpoints that prohibit `Add-Type` are unsupported for the bounded framing used by strict PowerShell and WinRM execution.

_Full upstream README: https://allmcps.com/mcp/powershell-mcp/readme_

