PowerShell MCP server
Commit Nov 10, 2026Lets AI clients run PowerShell commands and any CLI tool in a shared, visible console session on Windows, Linux, or macOS.
Also known as yotsuda/PowerShell.MCP, powershell-mcp
- Stars
- 110
- Tools
- β
- Downloads, 30 days
- β
- Latest version
- β
- Last commit
- Nov 10, 2026
- License
- MIT
What is PowerShell MCP?
PowerShell lets AI clients run PowerShell commands and any CLI tool in a shared, visible console session on Windows, Linux, or macOS.
Summary generated from the project's README
About PowerShell MCP server
Running PowerShell commands and any CLI tool from inside an AI client is what PowerShell.MCP enables for developers on Windows, Linux, and macOS. By connecting AI assistants directly to the PowerShell ecosystem, it allows users to collaborate with an AI in a shared, visible console session where every command is executed in real-time. This setup is ideal for professionals who need to manage cloud infrastructure, automate system tasks, or process data using existing command-line tools.
Users can access over 10,000 modules from the PowerShell Gallery, including specialized tools like Az, AWS.Tools, and Microsoft.Graph. The server supports a multi-client architecture where each instance receives an exclusive console, preventing resource conflicts. It also features remote control capabilities, allowing an AI to connect to a console on a different machine using tools like connect_remote_console. Because it uses a shared session, authentication for services like Azure or AWS persists, and sensitive inputs like MFA codes or passwords remain secure by staying within the local interactive prompt rather than being passed to the AI.
What you can do with it
- 1Manage cloud infrastructureAn AI can list your running Azure virtual machines and their specific hardware sizes.
- 2Automate GitHub repository tasksYou can ask an AI to filter and display specific bug issues from a GitHub repository using JSON processing.
- 3Execute complex data pipelinesA developer can instruct an AI to find the largest log files on a system using a single pipeline command.
- 4Perform remote system administrationUsers can connect an AI client to a console running on a different machine to execute commands remotely.
Written from the project's README. Every use case is checked against a quote from it.
Configuration
POWERSHELL_MCP_TIMEOUT_CEILING
Automated checks
Ran Nov 13, 2026Full report βNot verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work Β· What to fix for more points
- Source repository linked and reachablePass
- Open source license (OSI)Pass
- Commit or release in the last yearPass
- Package name not close to a popular packageNot checked
- Remote endpoint uses HTTPSNot checked
- Destructive tools are labelledNot checked
- No hidden instructions to the modelPass
- No critical advisory in the package or its dependenciesNot checked
README
View on GitHubPowerShell.MCP
Security Warning: This module provides complete PowerShell access to your system. Malicious use could result in severe damage. Use responsibly and only in trusted environments.
Overview
The universal MCP serverβone installation gives AI access to 10,000+ PowerShell modules and any CLI tool.
PowerShell.MCP connects AI assistants to the entire PowerShell ecosystem through a single MCP server. You and AI collaborate in the same PowerShell consoleβevery command the AI runs appears there as it runs, and a transcript can record all of it (see Auditing an AI Session).
Need bash, a language REPL, a SQL console, or a debugger instead? If you can't install PowerShell 7, or you'd rather drive another shell (bash, cmd, zsh), a language REPL (python, node, racket, lua, β¦), a SQL console (sqlite3, β¦), or a language debugger (pdb, jdb, perldb), check out ripple β the same shared-console concept generalized to any REPL, with unified ConPTY-based consoles running side by side.
Why PowerShell.MCP?
A universal gateway to the PowerShell ecosystem.
PowerShell.MCP takes a different approach from service-specific MCP servers. Rather than providing curated tools for individual services, it gives AI assistants direct access to PowerShellβletting them use the same modules and CLI tools that professionals use every day.
This means:
- One MCP server replaces many β no need for separate servers for each service
- Immediate access to 10,000+ modules on PowerShell Gallery without waiting for dedicated MCP servers
- Cross-service workflows combining multiple services in a single pipeline
- API exploration β prototype and verify API behavior with immediate feedback before writing production code
- Self-evolving capabilities β AI writes PowerShell scripts that both AI and users can execute, continuously extending what's possible
- Industry-standard skills β commands you learn transfer directly to your own work
Examples: PowerShell pipeline processing
"Show me bug issues from the PowerShell repo with their authors"
gh issue list --repo PowerShell/PowerShell --json title,author,labels |
ConvertFrom-Json |
Where-Object { $_.labels.name -contains "Issue-Bug" } |
Select-Object title, @{N='by';E={$_.author.login}}
"List my running Azure VMs with their sizes"
Get-AzVM -Status | Where-Object PowerState -eq "VM running" |
Select-Object Name, @{N='Size';E={$_.HardwareProfile.VmSize}}, Location
"Check if GitHub's API returns rate limit info"
Invoke-RestMethod https://api.github.com/rate_limit |
Select-Object -ExpandProperty rate
"Get the current user's Windows username via Win32 API"
Add-Type -MemberDefinition '[DllImport("advapi32.dll")] public static extern bool GetUserName(System.Text.StringBuilder sb, ref int len);' -Name Win32 -Namespace API
$sb = [System.Text.StringBuilder]::new(256); $len = 256
[API.Win32]::GetUserName($sb, [ref]$len); $sb.ToString()
PowerShell.MCP complements your existing MCP setup by providing a flexible, general-purpose foundation.
What Makes It Powerful
π₯οΈ Multi-Client Architecture
- Each client instance gets its own exclusive consoleβrun multiple Claude Code sessions in parallel
- Safe parallel operation with no resource conflicts
- Unique window titles (e.g., "#12345 Taxi") for easy identification
Get-MCPOwnercmdlet shows which client owns the current console
π€ Shared Console Experience
- You and AI collaborate in the same PowerShell session with full transparency
- Every command AI executes appears in your console in real-time
- You can respond to interactive prompts directly in the console
- Short commands are added to the console history on Windowsβlearn by watching AI work
π Persistent Session State
- Authenticate once, stay authenticated: Azure, AWS, Microsoft 365, and more
- Modules, variables, and functions persist across commands
- No re-initialization overhead
π Universal Access
- PowerShell Gallery: 10,000+ modules including Az, AWS.Tools, Microsoft.Graph
- Any CLI tool: git, docker, kubectl, terraform, gh, az cli, aws cli
- AI learns syntax automatically via
Get-Help
π Pipeline Composability
- Describe what you want in natural languageβAI constructs the optimal pipeline
- "Top 5 largest logs" β
Get-ChildItem *.log | Sort-Object Length -Descending | Select-Object -First 5 - Chain any commands across any services
β‘ Instant Execution
- Commands execute immediately in an existing console
- No process startup overhead per command
- Real-time streaming output
π Enterprise-Ready Security
- Local named pipes by default; a TCP port only while remote control is on β on the remote machine (
Enable-MCPRemoteControl), or on this one while the AI waits for a console to dial in (accept_remote_console) (Remote Control) - Every command visible, and recordable with
Start-Transcriptor Script Block Logging (Auditing an AI Session) - Integrates with existing security policies
π Secrets stay with you, not the AI
- Interactive prompts (
Read-Host -AsSecureString,Get-Credential, MFA codes) hide input from the AI - Enter passphrases for code-signing,
gpg,ssh-add,sudo, cloud CLI MFA β keystrokes go to the program, never to AI's output stream - AI orchestrates the workflow ("build, sign, push the tag"); you supply the secret at the right moment
- Impossible with stdin-piped MCP shells, where the AI must somehow feed the secret in
Architecture
Eleven tools β six for consoles on this machine, five for a console on another machine; waiting is shared:
| Tool | Purpose |
|---|---|
| This machine | |
start_console |
Reuse a standby console, or launch a new one |
get_current_location |
Get the current directory, available drives, and system info (OS, PowerShell version, user, culture) |
execute_command |
Execute any PowerShell command or CLI tool (literal text via var1βvar8) |
wait_for_completion |
Wait for busy consoles β here or on a remote machine β to finish and collect their cached output |
cancel |
Interrupt the command currently running in the console (stops the pipeline and sends Ctrl+C) |
close_console |
Kill a console by PID (e.g. one paused at an interactive prompt), returning any output it still holds |
| Another machine (Remote console) | |
connect_remote_console |
Connect to a console that is listening (Enable-MCPRemoteControl) with its pairing code |
accept_remote_console |
Let a console dial in (for machines behind NAT or a firewall) β returns the Enable-MCPRemoteControl -ConnectTo line to run there, or, where nothing can be installed, one line to paste |
execute_remote_command |
Execute a command in the remote console (a result that outran its timeout comes back with wait_for_completion, or with the next tool call of any kind) |
cancel_remote_command |
Send Ctrl+C to the remote console |
disconnect_remote_console |
Disconnect from one remote console (or stop accepting) |
Quick Start
Prerequisites
All platforms require:
- PowerShell 7.4+ (installation guide)
- Claude Desktop, Claude Code, or any MCP client
| Platform | OS Requirements |
|---|---|
| Windows | Windows 10/11 or Windows Server 2016+ |
| Linux | Ubuntu 22.04+, Debian 11+, RHEL 8+, or another distribution PowerShell 7.4 supports; a GUI desktop to see the console |
| macOS | macOS 12 (Monterey)+, Intel or Apple Silicon |
1. Open PowerShell 7
Press Win + R, type pwsh, press Enter
2. Install PowerShell.MCP
Install-PSResource PowerShell.MCP
3. Configure your MCP client
For Claude Code:
Register-PwshToClaudeCode
It then asks whether to disable Claude Code's built-in Bash and PowerShell tools, so that every command runs in the console you can see (recommended, and the default answer). -DisableBuiltInShellTools or -KeepBuiltInShellTools answers without asking.
For Claude Desktop:
Register-PwshToClaudeDesktop
For other MCP clients: Run Get-MCPProxyPath -Escape to get the JSON-escaped executable path, then add it to your client's configuration file manually.
4. Restart your MCP client
1. Install PowerShell 7
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install -y wget apt-transport-https software-properties-common
source /etc/os-release
wget -q https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y powershell
2. Install PowerShell.MCP, set permissions, and configure your MCP client
# Run in PowerShell (pwsh)
Install-PSResource PowerShell.MCP
chmod +x "$(Get-MCPProxyPath)"
For Claude Code:
Register-PwshToClaudeCode
It then asks whether to disable Claude Code's built-in Bash and PowerShell tools, so that every command runs in the console you can see (recommended, and the default answer). -DisableBuiltInShellTools or -KeepBuiltInShellTools answers without asking.
For Claude Desktop:
Register-PwshToClaudeDesktop
For other MCP clients: Run Get-MCPProxyPath -Escape to get the JSON-escaped executable path, then add it to your client's configuration file manually.
3. Restart your MCP client
1. Install PowerShell 7
brew install --cask powershell
# If the cask is unavailable, install from GitHub Release (on an Intel Mac, use osx-x64 instead of osx-arm64):
# curl -sSL -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v7.5.4/powershell-7.5.4-osx-arm64.tar.gz
# sudo mkdir -p /usr/local/microsoft/powershell/7
# sudo tar zxf /tmp/powershell.tar.gz -C /usr/local/microsoft/powershell/7
# sudo chmod +x /usr/local/microsoft/powershell/7/pwsh
# sudo ln -sf /usr/local/microsoft/powershell/7/pwsh /usr/local/bin/pwsh
2. Install PowerShell.MCP, set permissions, and configure your MCP client
# Run in PowerShell (pwsh)
Install-PSResource PowerShell.MCP
chmod +x "$(Get-MCPProxyPath)"
For Claude Code:
Register-PwshToClaudeCode
It then asks whether to disable Claude Code's built-in Bash and PowerShell tools, so that every command runs in the console you can see (recommended, and the default answer). -DisableBuiltInShellTools or -KeepBuiltInShellTools answers without asking.
For Claude Desktop:
Register-PwshToClaudeDesktop
For other MCP clients: Run Get-MCPProxyPath -Escape to get the JSON-escaped executable path, then add it to your client's configuration file manually.
3. Restart your MCP client
Updating
Every installed version lives in its own folder, so the proxy path your MCP client launches changes with each update. Re-register after updating: otherwise the client keeps starting the previous version's proxy, and commands fail with "PowerShell.MCP.Proxy version is outdated".
1. Update the module
Open a new PowerShell 7 window (not one of the PowerShell.MCP consoles) and run:
Update-PSResource PowerShell.MCP
2. Re-register from another new window
A window that has already loaded PowerShell.MCP keeps the old version, so open one more new window, which loads the version just installed:
chmod +x "$(Get-MCPProxyPath)" # Linux / macOS only: the new proxy needs the execute bit again
Register-PwshToClaudeCode # Claude Code
Register-PwshToClaudeDesktop # Claude Desktop
Both replace the existing pwsh entry and keep the arguments and environment variables already set on it, such as --no-profile. For other MCP clients: replace the path in your configuration with the output of Get-MCPProxyPath -Escape.
3. Close the old consoles and restart your MCP client
Close the PowerShell.MCP console windows (titled like #12345 Taxi) β each keeps running the version it was started with β then quit and restart your MCP client.
To see what is installed, and remove a version no console is using any more:
Get-InstalledPSResource PowerShell.MCP
Uninstall-PSResource PowerShell.MCP -Version <old version>
Configuration
Lean consoles (--no-profile)
By default, every console the proxy launches loads your PowerShell $PROFILE (prompt, aliases, PSReadLine, theme) β these are real interactive shells, not just automation targets. Pass --no-profile to start them with -NoProfile instead, for faster startup and a clean, deterministic environment.
Claude Code:
claude mcp remove pwsh -s user # if pwsh is already registered: 'claude mcp add' refuses an existing name
claude mcp add pwsh -s user -- "$(Get-MCPProxyPath)" --no-profile
From then on Register-PwshToClaudeCode keeps the flag, including when you re-register after an update.
Claude Desktop / other MCP clients: add an args array with --no-profile to the pwsh entry in your config (Register-PwshToClaudeDesktop keeps it when it re-registers):
"mcpServers": {
"pwsh": {
"command": "...PowerShell.MCP.Proxy.exe",
"args": ["--no-profile"]
}
}
The headless / CI launcher always uses
-NoProfileregardless of this flag.
Idle consoles close themselves
When consoles pile up, an owned console that neither the AI nor you have used for 10 minutes prints a warning and closes itself 60 seconds later. The most recently used console of each session is always kept, and a console that is busy, waiting at a prompt, still holding output that has not been collected, has text typed at its prompt, or has an unfinished background job (Start-Job, &) is never closed. Typing anything, or any AI command, cancels a pending close. A console started by a sub-agent (is_subagent=true) is not kept: once idle it closes like any other, since a finished sub-agent never comes back for it.
A console an AI session started and then left behind (the client exited, the session ended) shows AI session disconnected and waits for the next session to claim it. If none does, it closes 10 minutes after the disconnect, with the warning 60 seconds before that, under the same guards. It stays open for good once you run a command in it, and a window you opened yourself is never closed, even if an AI used it for a while.
A console that closes itself leaves a note, and the AI's next tool call reports it: Console #N was closed: it closed itself after 10 min without use β¦. A console that disappeared any other way (its window closed, its process ended) is reported too, without the reason. Either way the line says what else went with it: jobs the console was running end with the console, while a process started with Start-Process keeps running.
Several AI sessions on one machine
Each MCP client session runs its own proxy, and a proxy sees only the consoles it started or claimed: a console's pipe is named after the proxy that owns it, so two sessions (say two Claude Code windows) never share, borrow or close each other's consoles, even on the same server registration. The only consoles up for grabs are unowned ones β a window you opened yourself and ran Import-Module PowerShell.MCP in, or one whose proxy has exited β and the first session that needs a console claims it (the window says so). Idle closing is per session as well: each session keeps its own most recently used console, and a session's consoles are never counted against another's.
| Variable | Default | Meaning |
|---|---|---|
POWERSHELL_MCP_STANDBY_REAP_MINUTES |
10 |
Idle minutes before the warning; 0 turns closing off |
POWERSHELL_MCP_STANDBY_REAP_GRACE_SECONDS |
60 |
Seconds between the warning and the close |
Set these as user or system environment variables (Windows: System Properties β Environment Variables, or setx; macOS / Linux: your login shell's profile), not in your MCP client's env block. Each console is a new terminal window rather than a child of the proxy, so a variable set only for the proxy generally does not reach it.
Timeout ceiling
A blocking call is capped to what your MCP client will actually wait for: 170 seconds for Claude Code and 50 seconds for any other client. Nothing is lost when the cap is reached: the command keeps running, and its result arrives with the next tool call. If your client waits longer than 50 seconds, raise the cap with POWERSHELL_MCP_TIMEOUT_CEILING (seconds, at most 170). This one is read by the proxy, so set it in your MCP client's env block:
"mcpServers": {
"pwsh": {
"command": "...PowerShell.MCP.Proxy.exe",
"env": { "POWERSHELL_MCP_TIMEOUT_CEILING": "120" }
}
}
With the Claude Code CLI, pass it as -e POWERSHELL_MCP_TIMEOUT_CEILING=120 to claude mcp add; Register-PwshToClaudeCode and Register-PwshToClaudeDesktop keep it when they re-register.
Admin work on this machine
The consoles the AI starts are not elevated. For admin work, open PowerShell 7 as Administrator and run Import-Module PowerShell.MCP; then close the AI's own consoles (or let the AI close them with close_console). With none of its own left, the next command goes to your elevated console, whose title shows Administrator:. That first command stops once to say where the console is; the AI re-issues it there. No remote control is involved.
PowerShell MCP questions
What does PowerShell.MCP let an AI client do?
It gives AI assistants access to PowerShell and any CLI tool, running commands in a shared console where you can watch every command execute.
What are the prerequisites for PowerShell.MCP?
You need PowerShell 7.4+ and an MCP client such as Claude Desktop or Claude Code. It runs on Windows, Linux, and macOS.
How do I install PowerShell.MCP for Claude Code?
Install the module with Install-PSResource, then run Register-PwshToClaudeCode and restart your client.
Does the AI see secrets I type at interactive prompts?
No, input from prompts like Read-Host -AsSecureString or Get-Credential stays with you and is not shown to the AI.
Can multiple client sessions run at once?
Yes, each client instance gets its own exclusive console with a unique window title, so parallel sessions do not conflict.