Integrations
Offers a Node.js-based server for executing PowerShell commands, with support for system information retrieval, module management, and script execution through Node.js runtime.
Enables interaction with PowerShell, providing tools for executing commands, retrieving system information, managing modules, getting command help, finding commands, and running scripts.
PowerShell MCP Server
A Model Context Protocol server for interacting with PowerShell. This server provides tools for executing PowerShell commands, retrieving system information, managing modules, and more.
Requirements
- Node.js 18+
- PowerShell 5.1 or PowerShell Core 7+
Installation
- Install dependencies:Copy
- Build the project:Copy
Configuration
For Claude Desktop
Edit config: $HOME/Library/Application\ Support/Claude/claude_desktop_config.json
Add to mcpServers:
For VS Code
Edit config: $HOME/Library/Application\ Support/Code/User/settings.json
Add to settings:
For Cursor IDE
Edit config: $HOME/.cursor/mcp.json
Add to mcpServers:
Available Tools
This PowerShell MCP server provides the following tools:
execute_ps
Execute a PowerShell command and get the result.
Example usage:
get_system_info
Retrieve detailed system information, including OS details, processor, memory, and PowerShell version.
Example usage:
list_modules
List all installed PowerShell modules with details like name, version, and type.
Example usage:
get_command_help
Get detailed help for a specific PowerShell command, including syntax, parameters, and examples.
Example usage:
find_commands
Search for PowerShell commands by name or pattern.
Example usage:
run_script
Run a PowerShell script file with optional parameters.
Example usage:
Development
To run in development mode:
Extending the Server
To add your own PowerShell tools:
- Edit
src/index.ts
- Add new tools in the
registerTools()
method - Follow the existing pattern for consistent error handling
- Build with
npm run build
Adding a Tool Example
Security Considerations
- This server executes PowerShell commands directly on your system
- Commands are executed with the same privileges as the process running the MCP server
- Use caution when exposing destructive operations
- Consider implementing additional validation for sensitive commands
Troubleshooting
Common Issues
- PowerShell execution policy restrictions
- You may need to adjust your PowerShell execution policy to allow script execution
- Use
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
to allow local scripts
- Path not found errors
- Ensure file paths are absolute or properly relative to the working directory
- Use appropriate path separators for your OS
- Command not found errors
- Some commands may require specific modules to be installed
- Use
Install-Module ModuleName
to install required modules
License
MIT
You must be authenticated.
local-only server
The server can only run on the client's local machine because it depends on local resources.
A Model Context Protocol server that enables AI assistants to execute PowerShell commands, retrieve system information, manage modules, and run scripts on Windows systems.
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that provides programmatic access to the Windows terminal, enabling AI models to interact with the Windows command line through standardized tools for writing commands, reading output, and sending control signals.Last updated -3JavaScriptMIT License
- AsecurityFlicenseAqualityA Model Context Protocol server that allows secure execution of pre-approved commands, enabling AI assistants to safely interact with the user's system.Last updated -1318JavaScript
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants like Claude to perform Python development tasks through file operations, code analysis, project management, and safe code execution.Last updated -1Python
- -securityFlicense-qualityA comprehensive Model Context Protocol server implementation that enables AI assistants to interact with file systems, databases, GitHub repositories, web resources, and system tools while maintaining security and control.Last updated -16TypeScript