You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**This module provides complete PowerShell access to your system.**
11
-
Malicious use could result in severe damage. Use responsibly and only in trusted environments.
9
+
> **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.
12
10
13
11
## Overview
14
12
15
-
PowerShell.MCP is a tool that enables AI assistants (such as Claude Desktop) to execute any PowerShell commands and CLI tools within a PowerShell console. Users can also execute cmdlets/.ps1/.bat/CLI tools in the same console, allowing AI and users to work collaboratively. It operates at high speed without needing to launch a new console each time, while preserving the state of imported modules, functions and variables.
13
+
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.
16
14
17
-
Despite its powerful capabilities, PowerShell.MCP is built with just four carefully designed tools:
18
-
-**start_powershell_console:** launching a persistent console
19
-
-**get_current_location:** retrieving the current working directory
20
-
-**invoke_expression:** executing any cmdlets/.ps1/.bat/CLI tools (chainable with pipes) in the PS console
21
-
-**wait_for_completion:** waiting for busy console(s) to complete and retrieving cached results
15
+
## Why PowerShell.MCP?
22
16
23
-
This minimalist architecture provides maximum flexibility while maintaining simplicity.
17
+
**A universal gateway to the PowerShell ecosystem.**
24
18
25
-
### What Makes It Powerful
19
+
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.
20
+
21
+
This means:
22
+
-**Immediate access** to 10,000+ modules on [PowerShell Gallery](https://www.powershellgallery.com/) without waiting for dedicated MCP servers
23
+
-**Cross-service workflows** combining multiple services in a single pipeline
24
+
-**Industry-standard skills** — commands you learn transfer directly to your own work
25
+
-**API exploration** — prototype and verify API behavior with immediate feedback before writing production code
26
+
-**Self-evolving capabilities** — AI writes PowerShell scripts that both AI and users can execute, continuously extending what's possible
27
+
28
+
**Examples: PowerShell pipeline processing**
29
+
30
+
*"Show me bug issues from the PowerShell repo with their authors"*
31
+
32
+
```powershell
33
+
gh issue list --repo PowerShell/PowerShell --json title,author,labels |
PowerShell.MCP complements your existing MCP setup by providing a flexible, general-purpose foundation.
62
+
63
+
## What Makes It Powerful
64
+
65
+
**🖥️ Multi-Client Architecture**
66
+
- Each MCP client (Claude Code, Claude Desktop, etc.) gets its own exclusive console
67
+
- Safe parallel operation with no resource conflicts
68
+
- Unique window titles (e.g., "#12345 Taxi") for easy identification
69
+
-`Get-MCPOwner` cmdlet shows which client owns the current console
26
70
27
71
**🤝 Shared Console Experience**
28
-
- You and AI collaborate in the same PowerShell session
29
-
- Every command the AI executes appears in your console in real-time
30
-
- PowerShell cmdlets display colorful output
31
-
- You can respond to input requests from AI-executed commands directly in the console
32
-
- You can run your own commands between AI operations
33
-
- AI-executed commands are saved to history, allowing you to recall and modify parameters for re-execution
34
-
- Complete transparency - see exactly what's happening
72
+
- You and AI collaborate in the same PowerShell session with full transparency
73
+
- Every command AI executes appears in your console in real-time
74
+
- You can respond to interactive prompts directly in the console
75
+
- Commands are saved to history—learn by watching AI work
35
76
36
77
**🔄 Persistent Session State**
37
-
- Current directory persists across all commands and interactions
38
-
- Imported modules and authenticated sessions remain active throughout the entire session
39
-
- Variables, functions, and mounted PSDrives stay available throughout the session
40
-
- No need to re-initialize or re-authenticate between commands
41
-
- True model context protocol implementation preserves your entire working state
42
-
43
-
**⚡ Instant Response, Zero Overhead**
44
-
- Commands execute immediately without launching new PowerShell processes
45
-
- Eliminates the typical 1-5 second startup delay per cmdlet
46
-
- Fast initial feedback to users with instant acknowledgment before full results
47
-
- Real-time streaming of output as commands run
48
-
49
-
**🔍 Comprehensive Output Stream Capture**
50
-
- Command output is captured and returned to the AI assistant, with PowerShell's critical streams (error, warning, success, information) completely separated
51
-
- Verbose and debug streams display naturally in the console under user control, and can be shared manually when needed
52
-
- Clear execution statistics for every command: duration, error count, warning count, and info count
53
-
54
-
**🌐 Universal Modules & CLI Integration**
55
-
- PowerShell.MCP acts as a universal bridge, instantly making any PowerShell modules or CLI tools available as fully functional MCP servers
56
-
- Access the vast ecosystem of PowerShell Gallery with over 3,000 pre-built modules, instantly integrating with everything from cloud services like [Azure](https://www.powershellgallery.com/packages/Az), [AWS](https://www.powershellgallery.com/packages/AWSPowerShell.NetCore), [Google Cloud](https://www.powershellgallery.com/packages/GoogleCloud) or [UiPath Orchestrator](https://www.powershellgallery.com/packages/UiPathOrch) to enterprise tools like [Active Directory](https://learn.microsoft.com/powershell/module/activedirectory/), [Exchange](https://www.powershellgallery.com/packages/ExchangeOnlineManagement) or [SQL Server](https://www.powershellgallery.com/packages/SqlServer)
57
-
- Uses `Get-Help` to automatically learn each cmdlet's syntax, parameters, and usage patterns for immediate productive use
58
-
- AI effectively leverages well-known command-line tools like [Git](https://git-scm.com/) or [Docker](https://www.docker.com/)
59
-
- PowerShell.MCP fundamentally transforms the MCP ecosystem by making virtually any command-line tool AI-accessible without custom development
60
-
61
-
**🔗 PowerShell Pipeline Composability**
62
-
- PowerShell naturally chains commands together, passing rich data between them
63
-
- AI assistants leverage this composability to build sophisticated workflows from simple building blocks
64
-
- Example: "Show me the top 5 largest log files" becomes `Get-ChildItem *.log | sort Length -Descending | select -First 5`
65
-
- Unlike approaches that expose each cmdlet/CLI tool as individual MCP tools, PowerShell.MCP enables AI to freely combine any commands into flexible pipelines
66
-
- You describe what you want in natural language - AI constructs the optimal pipeline automatically
67
-
- No need to understand pipeline syntax yourself - just tell AI what you need
68
-
69
-
**📝 LLM-Optimized Text File Operations**
70
-
- Traditional Get/Set-Content cmdlets frequently fail for LLMs due to line number confusion and poor performance
71
-
- To address this, PowerShell.MCP includes 5 specialized cmdlets designed specifically for AI assistants to handle text file operations reliably
72
-
- Single-pass processing architecture enables up to 100x faster performance than Get/Set-Content on large files
73
-
- 1-based line numbering eliminates array index confusion and matches compiler error messages
74
-
- Automatic encoding detection and preservation (UTF-8/16/32, Shift-JIS, line endings)
75
-
- Pattern matching with regex support and capture groups
76
-
77
-
**📚 No RAG or Context Grounding Required**
78
-
- Simply gather necessary documents and files in a folder
79
-
- Tell the AI assistant "Check this folder" in your prompt
80
-
- AI instantly accesses all the knowledge needed for the task
81
-
- Works with any content: documentation, project templates, code samples, configurations, and more
82
-
- No need for complex RAG systems or context grounding infrastructure
83
-
- Natural and intuitive way to provide domain-specific knowledge to AI
84
-
85
-
**🎯 Ready-to-Use Built-in Prompts**
86
-
- 7 specialized prompts for development, analysis, administration, and learning scenarios
87
-
- Intelligent automation with native language support and interactive guidance
88
-
- Built-in safety measures, progress tracking, and hands-on learning environments
89
-
- Accessible directly through MCP client prompts list - no command writing required
78
+
- Authenticate once, stay authenticated: Azure, AWS, Microsoft 365, and more
79
+
- Modules, variables, and functions persist across commands
80
+
- No re-initialization overhead
81
+
82
+
**🌐 Universal Access**
83
+
-[PowerShell Gallery](https://www.powershellgallery.com/): 10,000+ modules including [Az](https://www.powershellgallery.com/packages/Az), [AWS.Tools](https://www.powershellgallery.com/packages/AWS.Tools.Common), [Microsoft.Graph](https://www.powershellgallery.com/packages/Microsoft.Graph)
84
+
- Any CLI tool: git, docker, kubectl, terraform, gh, az cli, aws cli
85
+
- AI learns syntax automatically via `Get-Help`
86
+
87
+
**🔗 Pipeline Composability**
88
+
- Describe what you want in natural language—AI constructs the optimal pipeline
> **Note:** Claude Desktop and Claude Code are recommended. Claude Code is ideal for development work with its multi-console support. Other MCP clients may not deliver optimal performance.
121
+
| Platform | OS Requirements |
122
+
|----------|-----------------|
123
+
| Windows | Windows 10/11 or Windows Server 2016+ |
124
+
| Linux | Ubuntu 22.04+, Debian 11+, RHEL 8+, or distributions with GUI desktop |
125
+
| macOS | macOS 12 (Monterey)+, Intel or Apple Silicon |
Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
230
+
#### 4. Configure your MCP client
231
+
232
+
**For Claude Desktop** — Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
223
233
```json
224
234
{
225
235
"mcpServers": {
@@ -230,19 +240,27 @@ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
230
240
}
231
241
```
232
242
233
-
#### 6. Restart Claude Desktop
243
+
**For Claude Code:**
244
+
```bash
245
+
claude mcp add powershell-mcp -- /path/to/PowerShell.MCP.Proxy
246
+
```
247
+
248
+
#### 5. Restart your MCP client
249
+
250
+
</details>
234
251
235
252
---
236
253
237
254
## First-Time Demo
238
-
🎨 Experience PowerShell.MCP's capabilities with these engaging demonstrations:
255
+
256
+
Experience PowerShell.MCP's capabilities:
239
257
240
258
- "Show what PowerShell.MCP can do in a colorful, dynamic, and fun demo"
241
259
- "Try out different styles of notifications using the BurntToast module"
242
260
- "Automate Notepad: type text and smoothly move the window in a circle"
243
261
- "How does it feel now that you have a tool like PowerShell.MCP?"
244
262
245
-
After trying these demos, explore the 7 built-in prompts below or ask AI to explain any command - learning by doing is the best approach.
263
+
After trying these demos, explore the built-in prompts below or ask AI to explain any command.
246
264
247
265
## Built-in Prompts
248
266
@@ -406,21 +424,26 @@ Generates interactive HTML maps with markers, descriptions, and optional 3D disp
406
424
---
407
425
408
426
## Limitations
409
-
-**AI Command Cancellation**: Commands executed by AI assistants cannot be cancelled with Ctrl+C. To cancel AI-executed commands, close the PowerShell console
410
-
-**User Command Privacy**: Commands executed by users are not visible to AI assistants
411
-
-**Verbose/Debug Streams**: Verbose and Debug output streams are not captured. Users can share this information with AI assistants via clipboard if needed
412
-
-**Standard Error (stderr)**: Standard error output from CLI programs is not displayed in the PowerShell console and is not visible to AI assistants. To capture stderr, explicitly redirect it to a variable (e.g., `$result = & command.exe 2>&1`)
413
-
-**External Command Colors**: Color output from external commands (e.g., git.exe) is lost and displayed without colors in the PowerShell console
427
+
428
+
-**AI Command Cancellation**: Commands executed by AI cannot be cancelled with Ctrl+C. Close the console to stop.
429
+
-**User Command Privacy**: Commands you execute are not visible to AI assistants.
430
+
-**Verbose/Debug Streams**: Not captured. Share via clipboard if needed.
431
+
-**CLI stderr**: Not captured by default. Use `$result = & command.exe 2>&1` to capture.
432
+
-**External Command Colors**: Color output from CLI tools (e.g., git) is not preserved.
414
433
415
434
## Disclaimer
416
-
This software is provided "AS IS" without warranty of any kind, either expressed or implied.
435
+
436
+
This software is provided "AS IS" without warranty of any kind, either expressed or implied.
417
437
The author assumes no responsibility for any damages arising from the use of this software.
418
438
419
439
## License
440
+
420
441
MIT License - see [LICENSE](LICENSE) for details.
421
442
422
443
## Author
444
+
423
445
Yoshifumi Tsuda
424
446
425
447
---
448
+
426
449
**For enterprise use, ensure compliance with your organization's security policies.**
0 commit comments