Skip to content

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.

License

Notifications You must be signed in to change notification settings

yotsuda/PowerShell.MCP

PowerShell.MCP

PowerShell Platform PowerShell Gallery PowerShell Gallery License: MIT

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 is visible, auditable, and saved to history.

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-MCPOwner cmdlet 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
  • Commands are saved to historyβ€”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

πŸ”— 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-only named pipe communicationβ€”no network exposure
  • Every command visible and auditable
  • Integrates with existing security policies

Architecture

Five tools provide maximum flexibility with minimum complexity:

Tool Purpose
start_powershell_console Launch a persistent console for the MCP client
get_current_location Get current directory and available drives
invoke_expression Execute any PowerShell command or CLI tool
wait_for_completion Wait for long-running commands to complete
generate_agent_id Generate a unique agent ID for sub-agent console isolation

Quick Start

Prerequisites

All platforms require:

Platform OS Requirements
Windows Windows 10/11 or Windows Server 2016+
Linux Ubuntu 22.04+, Debian 11+, RHEL 8+, or distributions with GUI desktop
macOS macOS 12 (Monterey)+, Intel or Apple Silicon

Windows Setup

1. Open PowerShell 7

Press Win + R, type pwsh, press Enter

2. Install PowerShell.MCP

Install-Module PowerShell.MCP

3. Configure your MCP client

For Claude Code:

Get-MCPProxyPath
# Example: C:\Users\YourName\Documents\PowerShell\Modules\PowerShell.MCP\1.6.0\bin\win-x64\PowerShell.MCP.Proxy.exe
claude mcp add PowerShell -- "C:\path\to\PowerShell.MCP.Proxy.exe"

For Claude Desktop β€” Add to %APPDATA%\Claude\claude_desktop_config.json:

Get-MCPProxyPath -Escape  # Returns JSON-escaped path (e.g., C:\\Users\\...\\PowerShell.MCP.Proxy.exe)
{
  "mcpServers": {
    "PowerShell": {
      "command": "C:\\Users\\YourName\\Documents\\PowerShell\\Modules\\PowerShell.MCP\\1.6.0\\bin\\win-x64\\PowerShell.MCP.Proxy.exe"
    }
  }
}

4. Restart your MCP client

Linux Setup

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

pwsh -Command "Install-Module PowerShell.MCP -Scope CurrentUser"

3. Get your Proxy path and set permissions

pwsh -Command "Import-Module PowerShell.MCP; Get-MCPProxyPath"
# Example: /home/username/.local/share/powershell/Modules/PowerShell.MCP/1.6.0/bin/linux-x64/PowerShell.MCP.Proxy

chmod +x /path/to/PowerShell.MCP.Proxy

4. Configure your MCP client

For Claude Code:

claude mcp add PowerShell -- /path/to/PowerShell.MCP.Proxy

For Claude Desktop β€” Edit ~/.config/Claude/claude_desktop_config.json

macOS Setup

1. Install PowerShell 7

brew install powershell/tap/powershell

2. Install PowerShell.MCP

pwsh -Command "Install-Module PowerShell.MCP -Scope CurrentUser"

3. Get your Proxy path and set permissions

pwsh -Command "Import-Module PowerShell.MCP; Get-MCPProxyPath"
# Apple Silicon: ~/.local/share/powershell/Modules/PowerShell.MCP/1.6.0/bin/osx-arm64/PowerShell.MCP.Proxy
# Intel Mac: ~/.local/share/powershell/Modules/PowerShell.MCP/1.6.0/bin/osx-x64/PowerShell.MCP.Proxy

chmod +x /path/to/PowerShell.MCP.Proxy

4. Configure your MCP client

For Claude Code:

claude mcp add PowerShell -- /path/to/PowerShell.MCP.Proxy

For Claude Desktop β€” Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "PowerShell": {
      "command": "/Users/YourName/.local/share/powershell/Modules/PowerShell.MCP/1.6.0/bin/osx-arm64/PowerShell.MCP.Proxy"
    }
  }
}

5. Restart your MCP client


First-Time Demo

Experience PowerShell.MCP's capabilities:

  • "Show what PowerShell.MCP can do in a colorful, dynamic, and fun demo"
  • "Try out different styles of notifications using the BurntToast module"
  • "Automate Notepad: type text and smoothly move the window in a circle"
  • "How does it feel now that you have a tool like PowerShell.MCP?"

After trying these demos, explore the built-in prompts below or ask AI to explain any command.

Built-in Prompts

PowerShell.MCP includes 7 specialized prompts accessible from your MCP client's prompts menu. Each prompt is designed for specific tasks and guides AI to provide optimal results.

Built-in Prompts Menu
Built-in Prompts Menu
Selecting a Prompt
Selecting a Prompt

πŸ“‹ Create Work Procedure + βš™οΈ Execute Work Procedure

Best for: Complex, multi-step tasks you'll perform repeatedly

Work together as a powerful workflow system with automatic file management:

  1. Create Work Procedure - AI analyzes the task and generates work_procedure.md as the reusable procedure and work_progress.txt as the execution plan.
  2. Execute Work Procedure - AI follows and refines work_procedure.md during execution, and tracks and records outcomes in work_progress.txt.

Key benefits: self-refining procedures, resumable workflows, automatic progress tracking, consistent results

Example: "Write Get-Help markdown for multiple cmdlets through execution and verification"

AI-generated work_procedure.md
AI-generated work_procedure.md
AI-generated work_progress.md
AI-generated work_progress.md

πŸ“Š Analyze Content

Best for: Deep analysis of files, folders, or datasets

Generates comprehensive reports with insights and recommendations. Combine with HTML Generation Guidelines for AI for visual reports with charts.

Examples: "Analyze my project's log files" β€’ "Create a report on this CSV dataset" β€’ "Analyze this HAR file"

C# code quality analysis report
C# code quality analysis report
C# code quality analysis report (continued)
C# code quality analysis report (continued)

🎨 HTML Generation Guidelines for AI

Best for: Professional HTML reports with charts and styling

Companion prompt that ensures AI generates high-quality HTML with Chart.js visualization, responsive design, and proper styling. Works with any prompt or task that needs HTML output.

Examples: Analyze Content + this = visual reports β€’ Your custom prompt + this = professional HTML β€’ Any data task + this = interactive output

Combined prompts generate visual HTML file
Combined prompts generate visual HTML file

πŸ“š Learn Programming & CLI

Best for: Learning programming languages and command-line tools at any level

Provides personalized learning experiences with clear explanations, practical examples, and hands-on exercises. Specify your learning goals directly without worrying about experience levels.

Examples: "Learn Python basics for data analysis" β€’ "Learn Git commands for version control" β€’ "Learn PowerShell scripting"


πŸ—£οΈ Foreign Language Dictation Training

Best for: Improving listening skills in foreign languages

Creates dictation exercises with automatic checking.

Examples: "English dictation at beginner level" β€’ "Japanese conversation at the zoo"


πŸ—ΊοΈ Show Interactive Map

Best for: Visualizing geographic data or locations

Generates interactive HTML maps with markers, descriptions, and optional 3D display using PowerShell.Map module.

Examples: "Show major Roman battles in chronological order" β€’ "Create a map of hot springs in Japan"

Roman Battle Map
Roman Battle Locations
Colosseum 3D View
Colosseum 3D Visualization

Platform Notes

Windows

  • PSReadLine module is automatically loaded for enhanced console experience
  • Full color support for PowerShell output

Linux

  • Requires a GUI desktop environment (GNOME, KDE, XFCE, etc.)
  • Supported terminal emulators: gnome-terminal, konsole, xfce4-terminal, xterm, lxterminal, mate-terminal, terminator, tilix, alacritty, kitty
  • PSReadLine is automatically removed (not supported on Linux)

macOS

  • Works with Terminal.app (default)
  • PSReadLine is automatically removed (not supported on macOS)
  • Both Apple Silicon (M1/M2/M3/M4) and Intel Macs are supported

Limitations

  • AI Command Cancellation: Commands executed by AI cannot be cancelled with Ctrl+C. Close the console to stop.
  • User Command Privacy: Commands you execute are not visible to AI assistants.
  • Verbose/Debug Streams: Not captured. Share via clipboard if needed.
  • CLI stderr: Not captured by default. Use $result = & command.exe 2>&1 to capture.
  • External Command Colors: Color output from some CLI tools may not be preserved (git colors are supported).

Disclaimer

This software is provided "AS IS" without warranty of any kind, either expressed or implied. The author assumes no responsibility for any damages arising from the use of this software.

License

MIT License - see LICENSE for details.

Author

Yoshifumi Tsuda


For enterprise use, ensure compliance with your organization's security policies.

About

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.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •