ai.smithery/DynamicEndpoints-powershell-exec-mcp-server
Execute PowerShell commands securely with controlled timeouts and input validation. Retrieve syste…
★ 1MITai-ml
Install
Config snippet generator goes here (5 client tabs)
README
# PowerShell Exec MCP Server
[](https://smithery.ai/server/@DynamicEndpoints/powershell-exec-mcp-server)
A secure Model Context Protocol (MCP) server that provides controlled PowerShell command execution capabilities through MCP tools. This server includes security features to prevent dangerous commands, provides timeouts for command execution, and specializes in enterprise script generation for **Microsoft Intune** and **IBM BigFix** management platforms.
## Features
- Secure PowerShell command execution
- JSON-formatted output for structured data
- System information retrieval
- Service management and monitoring
- Process monitoring and analysis
- Event log access
- PowerShell script generation
- Template-based script generation
- Dynamic script generation
- Microsoft Intune detection and remediation script generation
- IBM BigFix relevance and action script generation
- Command timeout support
- Blocking of dangerous commands
- Non-interactive and profile-less execution
- Async support
- Type hints and input validation
## Project Structure
```
mcp-powershell-exec/
├── mcp_powershell_exec/ # Main package directory
│ ├── __init__.py # Package initialization
│ ├── __main__.py # Entry point
│ ├── server.py # Server implementation
│ ├── templates/ # PowerShell script templates
│ │ ├── basic_script.ps1 # Basic script template
│ │ ├── system_inventory.ps1 # System inventory template
│ │ ├── intune_detection.ps1 # Intune detection script template
│ │ ├── intune_remediation.ps1 # Intune remediation script template
│ │ ├── bigfix_relevance.ps1 # BigFix relevance script template
│ │ └── bigfix_action.ps1 # BigFix action script template
│ └── py.typed # Type hints marker
├── pyproject.toml # Project metadata and dependencies
├── setup.py # Package installation
└── README.md # Documentation
```
## Installation
### Installing via Smithery
To install PowerShell Exec Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@DynamicEndpoints/powershell-exec-mcp-server):
```bash
npx -y @smithery/cli install @DynamicEndpoints/powershell-exec-mcp-server --client claude
```
### Manual Installation
1. Ensure you have Python 3.7+ installed
2. Install the package:
```bash
pip install .
```
Or install in development mode:
```bash
pip install -e .
```
## Usage
### Running the Server
You can run the server in several ways:
1. Using the MCP CLI:
```bash
mcp run mcp_powershell_exec
```
2. Using Python module:
```bash
python -m mcp_powershell_exec
```
3. Using the console script:
```bash
mcp-powershell-exec
```
For development and testing:
```bash
mcp dev mcp_powershell_exec
```
### Installing in Claude Desktop
To install the server in Claude Desktop:
```bash
mcp install mcp_powershell_exec
```
## Available Tools
### run_powershell
The base tool for executing PowerShell commands securely with timeout support.
Parameters:
- `code` (required): PowerShell code to execute
- `timeout` (optional): Command timeout in seconds (1-300, default 60)
Example:
```python
result = await run_powershell(
code="Get-Process | Select-Object Name, Id, CPU",
timeout=30
)
```
### get_system_info
Retrieve system information using Get-ComputerInfo cmdlet.
Parameters:
- `properties` (optional): List of ComputerInfo properties to retrieve
- `timeout` (optional): Command timeout in seconds (1-300, default 60)
Example:
```python
result = await get_system_info(
properties=["OsName", "OsVersion", "OsArchitecture"]
)
```
### get_running_services
Get information about Windows services.
Parameters:
- `name` (optional): Filter services by name (supports wildcards)
- `status` (optional): Filter by status (Running, Stopped, etc.)
- `timeout` (optional): Command timeout in seconds (1-300, default 60)
Example:
```python
result = await get_running_services(
name="*sql*",
status="Running"
)
```
### get_processes
Monitor running processes with filtering and sorting capabilities.
Parameters:
- `name` (optional): Filter processes by name (supports wildcards)
- `top` (optional): Limit to top N processes
- `sort_by` (optional): Property to sort by (e.g., CPU, WorkingSet)
- `timeout` (optional): Command timeout in seconds (1-300, default 60)
Example:
```python
result = await get_processes(
top=5,
sort_by="CPU"
)
```
### get_event_logs
Access Windows event logs with filtering capabilities.
Parameters:
- `logname` (required): Name of the event log (System, Application, Security, etc.)
- `newest` (optional): Number of most recent events to retrieve (default 10)
- `level` (optional): Filter by event level (1: Critical, 2: Error, 3: Warning, 4: Information)
- `timeout` (optional): Command timeout in seconds (1-300, default 60)
Example:
```python
result =