Skip to main content
Glama
PowerShell MCP

PowerShell MCP

by water-chika

PowerShell MCP

A provider-neutral MCP server for bounded PowerShell execution on explicit local or registered SSH targets.

This is an independent project and is not affiliated with or endorsed by Microsoft.

Tools

  • list_powershell_targets()

  • powershell_status(target)

  • powershell_run(target, script, ...)

Targets are always explicit:

local
ssh:example-windows

There is no implicit local fallback and arbitrary SSH destinations are rejected.

Related MCP server: cli-mcp

Install

Requires Python 3.11+, PowerShell (pwsh) for local execution, and OpenSSH for SSH targets.

pipx install .
claude mcp add --scope user --transport stdio powershell -- \
  ~/.local/bin/powershell-mcp

For development:

pipx install --editable .

Configuration

The default target registry is ~/.config/powershell-mcp/targets.conf. Override it with POWERSHELL_MCP_REGISTRY.

example-windows | developer@example.invalid | powershell
forwarded       | -p 2222 developer@127.0.0.1 | powershell

The registry is trusted configuration because its destination field is parsed as OpenSSH arguments. Keep it private and writable only by its owner.

Configure a pinned local runtime with POWERSHELL_MCP_PWSH; otherwise pwsh is resolved from PATH.

Examples

{"target":"local","script":"$PSVersionTable.PSVersion.ToString()"}
{"target":"ssh:example-windows","script":"Get-Process","max_lines":20}

Normal results contain only:

{"output":"...","exit_code":0}

Failure, truncation, timeout, and raw protocol fields appear only when relevant. Raw records are opt-in with include_raw_records: true.

Bounds and security

This tool executes arbitrary PowerShell with the selected account's authority. It is not a sandbox.

  • target is mandatory.

  • SSH targets are allowlisted.

  • Line, byte, record, diagnostic, and time limits are enforced.

  • Process groups receive bounded TERM/KILL cleanup.

  • Exactly one terminal protocol record must be last.

  • Normal OpenSSH host-key verification is retained.

  • MCP approval generally applies to the tool, not individual target values.

Use least-privilege accounts and keep client-side tool approval enabled.

See configuration, protocol, security, and migration.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables secure remote command execution and bidirectional file transfers on SSH servers through the Model Context Protocol. It features robust security controls including command whitelisting, credential isolation, and support for multiple SSH connection profiles.
      2,863 npm
      1,041
      ISC
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides secure execution of terminal commands (PowerShell, CMD, shell) with configurable security policies including command blocking, path restrictions, and timeout.
      1
      -
    • F
      license
      A
      quality
      D
      maintenance
      Enables secure file system operations (read, write, delete) and simulated command execution with server-enforced permission policies, risk assessment, and human-in-the-loop approval.
      5
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients to establish interactive-authenticated SSH sessions to explicitly configured targets, run and manage bounded background jobs, and transfer bounded UTF-8 text files over SFTP.
      MIT