Skip to main content

MCP Server for PowerShell

Project description

MCP server for PowerShell

PyPI PyPI Downloads License

Disclaimer

Unofficial Implementation: This project is an independent open-source software project. It is not affiliated with, endorsed by, sponsored by, or associated with Microsoft Corporation or the PowerShell team.

Trademarks: "PowerShell" and the PowerShell logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. All other trademarks cited herein are the property of their respective owners. Use of these names is for descriptive purposes only (nominative fair use) to indicate compatibility.

Installation

  • Run directly with uv (recommended): uvx mcp-server-for-powershell
  • pip: pip install mcp-server-for-powershell
  • uv: uv pip install mcp-server-for-powershell

Configuration

The server can be configured using the following command-line arguments:

Argument Description Default
--allowed-commands List of allowed PowerShell commands. If empty, all are allowed (subject to restrictions). []
--restricted-commands List of restricted PowerShell commands. Safe defaults
--restricted-directories List of restricted directories. System directories
--language-mode PowerShell Language Mode: 0 (NoLanguage), 1 (ConstrainedLanguage), 2 (RestrictedLanguage), 3 (FullLanguage). 1
--cwd Initial working directory. Current Directory

Language Modes

  • 0 (NoLanguage): No script execution allowed.
  • 1 (ConstrainedLanguage): Restricts access to sensitive language elements (default).
  • 2 (RestrictedLanguage): Only allows basic commands.
  • 3 (FullLanguage): Unrestricted access.

Security Profiles

We recommend different configurations based on your security needs:

Default (Balanced)

By default, the server runs in ConstrainedLanguage mode with a curated blocklist of dangerous commands and restricted system directories. This provides "good enough" defaults for general use, preventing common dangerous operations while allowing most read-only and safe actions.

uvx mcp-server-for-powershell

Safe Mode (Strict)

For environments requiring stricter controls, use NoLanguage mode (--language-mode 0). Only built-in commands and cmdlets can be executed.

uvx mcp-server-for-powershell --language-mode 0

Nuclear Mode (Allow-List Only)

For the highest security "nuclear" option, explicitly whitelist ONLY the commands you need (e.g., allow get-items only). This blocks everything else by default.

uvx mcp-server-for-powershell --allowed-commands Get-Item Get-ChildItem Get-Content

License

mcp-server-for-powershell is provided as-is under the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_server_for_powershell-1.0.4.tar.gz (94.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_server_for_powershell-1.0.4-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file mcp_server_for_powershell-1.0.4.tar.gz.

File metadata

File hashes

Hashes for mcp_server_for_powershell-1.0.4.tar.gz
Algorithm Hash digest
SHA256 3b8b930d40a359f0d5f58bed7d82b6341c78188b2a01a9d6916312b9103a5fcd
MD5 5ed36b462a7bd08c0a11d241396a4737
BLAKE2b-256 0f96df8e08196c44144ae83a203636c47762bcafb1ac7e2f9ae4964cd38e1f5b

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_server_for_powershell-1.0.4.tar.gz:

Publisher: create-release.yaml on danielklecha/mcp-server-for-powershell

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_server_for_powershell-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_server_for_powershell-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8acb77cbd9d6d66736c83e83111c105a5189cae832c22ff46c3d8031f1233812
MD5 4586ccf47159126c0e58ef09294dc367
BLAKE2b-256 656a7a3573e91fedde4b9024cb303428b49890ac2a609f0b5abcf73d2a714393

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_server_for_powershell-1.0.4-py3-none-any.whl:

Publisher: create-release.yaml on danielklecha/mcp-server-for-powershell

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page