powershell-mcp
v0.9.1Headless Windows ops over MCP: hidden PowerShell plus in-process SSH, WinRM and SFTP.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
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.
| Parameter | Type | Description |
|---|---|---|
script * | string | PowerShell script or command to execute. |
cwd | string | Working directory. |
engine | string | Explicit engine; no fallback when specified. Omit to use only configured PWSH_MCP_EXE if set; otherwise try pwsh then powershell.exe on Windows (pwsh only elsewhere). |
errorPolicy | string | Default legacy raw script; strict detects unhandled PowerShell ErrorRecords. Check native exits immediately in the script. |
logOutput | boolean | Opt in to private file-backed raw output logs; may include secrets emitted by command. |
logQuotaBytes | integer | Combined stdout/stderr quota (default 8 MiB); incomplete beyond quota. |
maxOutputBytes | integer | Raw UTF-8 bytes per stream (default 1 MiB). |
parameters | object | JSON-safe named script parameters, delivered via stdin; never interpolated into source. |
tail | boolean | Keep last bytes rather than first; incomplete UTF-8 boundary scalars are omitted. |
timeoutMs | integer | Hard timeout in ms (default 60000). |
list_services
List Windows services, optionally filtered by a name pattern. Returns Name, DisplayName, Status.
| Parameter | Type | Description |
|---|---|---|
filter | string | Wildcard name filter, e.g. 'Sql*' or '*backup*'. |
get_service
Get detailed status of one Windows service by name.
| Parameter | Type | Description |
|---|---|---|
name * | string | Exact service name (not display name). |
control_service
Start, stop, or restart a Windows service (requires the MCP host process to have sufficient privileges).
| Parameter | Type | Description |
|---|---|---|
action * | string | Action to perform. |
name * | string | Exact service name. |
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.
| Parameter | Type | Description |
|---|---|---|
command * | string | Command to run on the remote host. |
host * | string | Remote host or IP. |
username * | string | SSH username. |
credentialRef | string | Operator-provisioned scoped credential reference, exclusive with raw auth. |
hostKeyPins | array | Explicit SHA256:base64 trusted host key fingerprints; multiple keys permit rotation. |
jumps | array | |
logOutput | boolean | Opt in to private file-backed raw output logs; may include secrets emitted by command. |
logQuotaBytes | integer | Combined stdout/stderr quota (default 8 MiB); incomplete beyond quota. |
maxOutputBytes | integer | Cap captured stdout/stderr per stream (bytes, default 1 MiB). |
passphrase | string | Passphrase for the private key, if any. |
password | string | Password auth (used if no key). |
port | integer | SSH port (default 22). |
privateKeyPath | string | Path to a private key file on this Windows host, e.g. C:\\Users\\isak\\.ssh\\id_ed25519. |
tail | boolean | Keep the LAST maxOutputBytes instead of the first (tail) — useful for long logs. |
timeoutMs | integer | Hard timeout in ms (default 60000). Also bounds the connection handshake. |
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).
| Parameter | Type | Description |
|---|---|---|
command * | string | PowerShell command/scriptblock body to run remotely. |
computerName * | string | Remote Windows host name or IP. |
authentication | string | WinRM auth mechanism. |
credentialRef | string | Operator-provisioned scoped credential reference, exclusive with raw auth. |
logOutput | boolean | Opt in to private file-backed raw output logs; may include secrets emitted by command. |
logQuotaBytes | integer | Combined stdout/stderr quota (default 8 MiB); incomplete beyond quota. |
maxOutputBytes | integer | Raw UTF-8 bytes per stream (default 1 MiB). |
parameters | object | JSON-safe named remote script parameters; delivered through protected WinRM stdin payload. |
password | string | Credential password. |
tail | boolean | Keep last bytes rather than first; incomplete UTF-8 boundary scalars are omitted. |
timeoutMs | integer | Hard timeout in ms (default 120000). |
useSsl | boolean | Use HTTPS/5986 WinRM. |
username | string | Credential username (DOMAIN\\user or host\\user). Omit to use the host process identity. |
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.
| Parameter | Type | Description |
|---|---|---|
host * | string | Remote host or IP. |
localPath * | string | Local file path on this Windows host. |
remotePath * | string | Destination path on the remote host. |
username * | string | SSH username. |
credentialRef | string | Operator-provisioned scoped credential reference, exclusive with raw auth. |
hostKeyPins | array | Explicit SHA256:base64 trusted host key fingerprints; multiple keys permit rotation. |
passphrase | string | Passphrase for the private key, if any. |
password | string | Password auth (used if no key). |
port | integer | SSH port (default 22). |
privateKeyPath | string | Path to a private key file on this Windows host. |
staged | boolean | Opt-in verified staging. Upload fails closed where atomic no-clobber is unsupported; download uses SHA-256 readback and atomic no-clobber hard link. |
timeoutMs | integer | Hard timeout in ms (default 120000). |
sftp_download
Download a file from a remote host to this Windows host over SFTP, in-process (ssh2 — no scp.exe, no WSL, headless).
| Parameter | Type | Description |
|---|---|---|
host * | string | Remote host or IP. |
localPath * | string | Destination path on this Windows host. |
remotePath * | string | Source path on the remote host. |
username * | string | SSH username. |
credentialRef | string | Operator-provisioned scoped credential reference, exclusive with raw auth. |
hostKeyPins | array | Explicit SHA256:base64 trusted host key fingerprints; multiple keys permit rotation. |
passphrase | string | Passphrase for the private key, if any. |
password | string | Password auth (used if no key). |
port | integer | SSH port (default 22). |
privateKeyPath | string | Path to a private key file on this Windows host. |
staged | boolean | Opt-in verified staging. Upload fails closed where atomic no-clobber is unsupported; download uses SHA-256 readback and atomic no-clobber hard link. |
timeoutMs | integer | Hard timeout in ms (default 120000). |
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). For work expected to outlast the synchronous deadline, choose start_execution before launching, then poll execution_status and read_execution_output. A timeout never a…
| Parameter | Type | Description |
|---|---|---|
program * | string | Executable name on PATH or a full path, e.g. 'git' or 'C:\Program Files\GitHub CLI\gh.exe'. |
args | array | Arguments as an array; each element is passed verbatim (no shell quoting). |
cwd | string | Working directory. |
logOutput | boolean | Opt in to private file-backed raw output logs; may include secrets emitted by command. |
logQuotaBytes | integer | Combined stdout/stderr quota (default 8 MiB); incomplete beyond quota. |
maxOutputBytes | integer | Raw UTF-8 bytes per stream (default 1 MiB). |
stdin | string | UTF-8 stdin, max 1 MiB bytes. Empty string still opens stdin and sends EOF; no stdin in argv, environment or logs. |
tail | boolean | Keep last bytes rather than first; incomplete UTF-8 boundary scalars are omitted. |
timeoutMs | integer | Hard timeout in ms (default 60000). |
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.
| Parameter | Type | Description |
|---|---|---|
concurrency * | integer | |
targets * | array | |
timeoutMs * | integer |
remote_batch_status
Read ordered per-target batch records; unavailable after process restart.
| Parameter | Type | Description |
|---|---|---|
id * | string |
cancel_remote_batch
Stop dispatch of queued targets; active targets become unknown, not confirmed terminated.
| Parameter | Type | Description |
|---|---|---|
id * | string |
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.
| Parameter | Type | Description |
|---|---|---|
idempotencyKey * | string | |
owner * | string | Private caller namespace token; keep secret and stable across restarts. This is a bearer secret, not authenticated MCP identity. |
program * | string | |
args | array | |
cwd | string |
execution_status
Read a local execution state. Unknown after restart means no automatic replay or verified ownership.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
owner * | string | Private caller namespace token; keep secret and stable across restarts. This is a bearer secret, not authenticated MCP identity. |
read_execution_output
Read a bounded base64 output page, including while running.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
length * | integer | |
offset * | integer | |
owner * | string | Private caller namespace token; keep secret and stable across restarts. This is a bearer secret, not authenticated MCP identity. |
stream * | string |
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.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
owner * | string | Private caller namespace token; keep secret and stable across restarts. This is a bearer secret, not authenticated MCP identity. |
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.
| Parameter | Type | Description |
|---|---|---|
handle * | string | |
length * | integer | |
offset * | integer | |
stream * | string |
delete_output_log
Delete a session log by opaque handle.
| Parameter | Type | Description |
|---|---|---|
handle * | string |