PowerShell.MCP
The universal MCP server for Claude Code and other MCP-compatible clients. One installation gives AI access to 10,000+ PowerShell modules and any CLI tool. You and AI collaborate in the same console with full transparency. Supports Windows, Linux, and macOS.
claude mcp add --transport stdio yotsuda-powershell.mcp pwsh -NoProfile -Command Import-Module PowerShell.MCP; Start-PowerShellMCPServer -Name 'PowerShell' -Port 5000 \ --env POWER_SHELL_MCP_DATA_DIR="Path to store session data" \ --env POWER_SHELL_MCP_LOG_LEVEL="Info"
How to use
PowerShell.MCP exposes a universal MCP server that grants AI assistants direct access to the entire PowerShell ecosystem, including thousands of modules from the PowerShell Gallery and any CLI tool available on the host. Once the server is running, clients connect to the PowerShell MCP instance and share a single PowerShell console with the AI, with all commands, prompts, and outputs visible and auditable. This enables cross-tool workflows where AI can invoke Get-Help, load modules from Gallery, run Azure, AWS, Microsoft 365 cmdlets, and call external CLIs like git, docker, kubectl, or az cli in a single pipeline. You can describe the desired outcome in natural language and the agent will construct the appropriate PowerShell commands and pipelines across these tools, streaming results in real time and persisting session state across commands.
To use, start the MCP server as configured, then connect with your preferred MCP client (Claude Code, Claude Desktop, or any compatible client). The client will present you with a console session named after the server (e.g., PowerShell). You can run commands directly, respond to interactive prompts, and watch the agent build complex workflows such as retrieving data from REST APIs, orchestrating cloud cmdlets, and performing system administration tasks—all within the same PowerShell session.
How to install
Prerequisites:
- PowerShell 7.4+ installed on Windows, Linux, or macOS
- An MCP client (e.g., Claude Code, Claude Desktop) or any MCP-compatible client
Installation steps (PowerShell):
- Install PowerShell.MCP from the PowerShell Gallery
Install-PSResource PowerShell.MCP
- Import the module and start the MCP server
Import-Module PowerShell.MCP
Start-PowerShellMCPServer -Name 'PowerShell' -Port 5000
- (Optional) Configure the MCP client to connect to the server
- Claude Code: add the server via the mcp add command and point it to the proxy path returned by Get-MCPProxyPath
- Claude Desktop: edit the Claude desktop config to include the server with the appropriate proxy executable path
Notes:
- Adjust the port (default 5000 in the example) as needed and ensure the port is accessible from clients
- If running on Linux/macOS, ensure pwsh is available in PATH as pwsh
- The server stores session data and history to the configured data directory; customize via environment variables if needed
Additional notes
Tips and considerations:
- Security: PowerShell.MCP provides broad system access. Run in trusted environments and limit client access. Consider using firewall rules and least-privilege accounts.
- Persistence: Session state (modules, variables, and functions) persists across commands during a session; you can re-enter the console and continue where you left off.
- Tool coverage: Besides PowerShell cmdlets, you can call any CLI tool installed on the host (git, docker, kubectl, terraform, gh, az cli, aws cli, etc.). The agent can chain commands across tools in pipelines.
- Troubleshooting: If clients cannot connect, verify the server is running, the port is open, and the PowerShell.MCP module is properly imported. Check logs for any initialization errors.
- Environment variables: You can tune behavior via env vars such as POWER_SHELL_MCP_LOG_LEVEL (Info, Warning, Error) and POWER_SHELL_MCP_DATA_DIR for session data storage.
Related MCP Servers
mcp
🤖 Taskade MCP · Official MCP server and OpenAPI to MCP codegen. Build AI agent tools from any OpenAPI API and connect to Claude, Cursor, and more.
browserai
A powerful Model Context Protocol (MCP) server that provides an access to serverless browser for AI agents and apps
mcpbi
PowerBI MCP server to give LLM clients (Claude, GH Copilot,etc) context from locally running PowerBI Desktop instances.
shodan
Shodan MCP server for Claude, Cursor & VS Code. 20 tools for passive reconnaissance, CVE/CPE intelligence, DNS analysis, and device search. 4 tools work free without an API key. OSINT and vulnerability research from your IDE.
akyn-sdk
Turn any data source into an MCP server in 5 minutes. Build AI-agents-ready knowledge bases.
statelessagent
Your AI forgets everything between sessions. SAME fixes that. Local-first, no API keys, single binary.