PowerShell MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PowerShell MCP Server Show me system information"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PowerShell MCP Server
A comprehensive Model Context Protocol (MCP) server that enables Claude and other LLM applications to execute PowerShell commands, scripts, and perform system operations on Windows systems.
🌟 Key Features
🔧 PowerShell Execution: Execute commands, run scripts, and create new PowerShell files
🖥️ System Monitoring: Get system info, monitor processes, check services and disk space
📁 File Operations: List directories, get file info, and search files with pattern matching
⚙️ Simple Setup: One-command installation with automatic Claude Desktop configuration
🛡️ Secure: Safe execution with proper error handling and session management
Related MCP server: Claude MCP Command Server
🛠️ Available Tools
PowerShell Tools
execute-powershell- Execute PowerShell commands with optional working directoryexecute-powershell-script- Run PowerShell script files with parameterscreate-powershell-script- Create new PowerShell scripts
System Tools
get-system-info- Comprehensive Windows system informationget-process-list- Running processes with CPU/memory usage (sortable/filterable)get-service-status- Windows services status with filteringcheck-disk-space- Disk space usage for all or specific drives
File Tools
list-directory- Enhanced directory listing with filteringget-file-info- Detailed file and directory metadatasearch-files- Recursive file search with pattern matching
📋 Prerequisites
Windows 10/11 or Windows Server 2016+
Node.js 18.0.0 or higher
PowerShell 5.1+ or PowerShell Core 7+
Claude Desktop application
🚀 Quick Setup
Option 1: Safe Automated Setup (Recommended)
# Clone and setup with configuration management
git clone https://github.com/gunjanjp/powershell-mcp.git
cd powershell-mcp
complete-setup.batOption 2: Configuration Recovery (If you had existing settings)
# If previous setup overwrote your existing configuration
node recovery.js status # Check current state
node recovery.js scan # Find backup configurations
node recovery.js restore 1 # Restore from backup
# OR
node recovery.js merge 1 # Merge backup with current configOption 3: Manual Setup
# Clone the repository
git clone https://github.com/gunjanjp/powershell-mcp.git
cd powershell-mcp
# Install dependencies
npm install
# Safely add to existing configuration
node recovery.js add-powershell
# Restart Claude Desktop📖 Usage Examples
Ask Claude:
"Execute PowerShell: Get-Date"
"Check my system information"
"Show me the top 10 processes by CPU usage"
"What's my disk space usage?"
"List files in my Downloads folder"
"Search for all .txt files in C:\Users"
"Create a PowerShell script to backup my Documents folder"
🔧 Commands
Server Commands
# Start the server
npm start
# Test components
npm test
# Run diagnostics
node diagnose.bat
# Start server directly
node src/server.jsConfiguration Management
# Check configuration status
node recovery.js status
# Find backup configurations
node recovery.js scan
# Safely add PowerShell server
node recovery.js add-powershell
# Restore from backup
node recovery.js restore <number>
# Merge configurations
node recovery.js merge <number>
# Show backup contents
node recovery.js show <number>Quick Setup Commands
# Complete setup with safety checks
complete-setup.bat
# Test server only
run-test.bat📁 Project Structure
powershell-mcp/
├── src/
│ ├── server.js # Main MCP server (with stderr logging fix)
│ ├── tools/ # Tool implementations
│ │ ├── powershell-tools.js
│ │ ├── system-tools.js
│ │ └── file-tools.js
│ └── utils/ # Utility modules
│ └── system-utils.js
├── examples/ # Example PowerShell scripts
├── scripts/ # Setup utilities
├── test/ # Test files
├── claude_desktop_config.json # Claude Desktop configuration
├── setup.bat # Automated setup script
├── diagnose.bat # Diagnostic tool
├── test-server.js # Component testing
└── README.md⚙️ Claude Desktop Configuration
The server uses this configuration (automatically applied by setup):
{
"mcpServers": {
"powershell": {
"command": "node",
"args": ["D:/claude/claude-powershell-mcp/src/server.js"],
"env": {}
}
}
}Config location: %APPDATA%\Claude\claude_desktop_config.json
🛡️ Security Features
Safe Execution: Uses
-ExecutionPolicy Bypassand-NoProfilefor securityInput Validation: All inputs validated with Zod schemas
Session Management: PowerShell sessions properly disposed after use
Error Handling: Comprehensive error handling prevents system issues
Logging: All operations logged to stderr (not interfering with JSON-RPC)
🐛 Troubleshooting
Server won't start
# Check Node.js version (need 18+)
node --version
# Check dependencies
npm install
# Test components
node test-server.jsClaude Desktop integration issues
# Run setup again
setup.bat
# Check configuration
type "%APPDATA%\Claude\claude_desktop_config.json"
# Restart Claude Desktop completelyPowerShell execution issues
# Test PowerShell
powershell -Command "Get-Date"
# Check execution policy
Get-ExecutionPolicy
# Run diagnostics
node diagnose.bat🔄 Recent Updates (v1.1.2)
Configuration Management Improvements
✅ Safe Configuration Management - No more overwriting existing configs
✅ Automatic Backups - Creates backups before any configuration changes
✅ Configuration Recovery - Tools to find and restore previous configurations
✅ Merge Capability - Intelligent merging of multiple MCP server configs
✅ Interactive Recovery - Step-by-step configuration recovery process
Previous Fixes (v1.1.1)
✅ Fixed Claude Desktop JSON parsing error - Changed console.log to console.error (stderr)
✅ Cleaned up project structure - Removed redundant server files
✅ Simplified setup - One script setup process
✅ Proper error handling - Enhanced logging and error management
🤝 Contributing
Fork the repository
Create feature branch:
git checkout -b feature-nameMake changes and test:
npm testCommit:
git commit -am 'Add feature'Push:
git push origin feature-nameSubmit pull request
📄 License
MIT License - see LICENSE file for details.
🔗 Links
Made with ❤️ for the Claude and PowerShell communities
⚠️ Important: This tool provides direct access to PowerShell commands. Use responsibly and be aware of security implications.
Available Tools
10 toolscheck-disk-spaceA
Check disk space usage for all drives or a specific drive
Inputs: drive.
create-powershell-scriptB
Create a new PowerShell script file with specified content
Inputs: scriptPath (required), content (required), executable.
execute-powershellC
Execute a PowerShell command with optional working directory
Inputs: command (required), workingDirectory.
execute-powershell-scriptB
Execute a PowerShell script file with optional parameters
Inputs: scriptPath (required), parameters, workingDirectory.
get-file-infoC
Get detailed information about a file or directory
Inputs: path (required).
get-process-listA
Get list of running processes with CPU and memory usage, optionally filtered by name
Inputs: processName, sortBy, limit.
get-service-statusB
Get Windows service status, optionally filtered by service name or status
Inputs: serviceName, status.
get-system-infoB
Get comprehensive Windows system information including hardware, OS, and performance metrics
Inputs: no named parameters.
list-directoryC
List contents of a directory with detailed information
Inputs: path (required), detailed, filter.
search-filesB
Search for files and directories matching a pattern
Inputs: searchPath (required), pattern (required), recursive, limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Tools are mostly distinct with clear purposes. Slight overlap between list-directory and search-files, but descriptions differentiate them. Other tools like check-disk-space and get-system-info are unique.
All tool names follow a consistent verb-noun pattern with hyphens (e.g., check-disk-space, get-process-list). No mixing of styles or vague verbs.
With 10 tools, the server is well-scoped. It covers core PowerShell administration tasks without being overcrowded or too sparse.
The surface covers basic system info and file operations but lacks update/delete for files, process management (start/stop), and service management (start/stop). These are notable gaps given the 'PowerShell' domain.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Related MCP Servers
- FlicenseCqualityDmaintenanceA Model Context Protocol server that enables AI assistants to execute PowerShell commands, retrieve system information, manage modules, and run scripts on Windows systems.62-
- FlicenseNot gradedqualityDmaintenanceA server implementation for the Model Context Protocol (MCP) that allows Claude AI to execute commands through a command-line interface, enabling direct system interactions from within Claude.-
- AlicenseAqualityDmaintenanceA comprehensive Model Context Protocol server that enables AI assistants to interact with and manage Windows systems, providing capabilities for file system operations, process management, system information retrieval, registry operations, service management, network diagnostics, and performance monitoring.720 npm7Apache 2.0
- AlicenseNot gradedqualityDmaintenanceA minimal MCP server that exposes a persistent PowerShell session to LM Studio, enabling command execution, directory navigation, and environment variable management via tools like ps_run, cd, and env_set.MIT