Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

mcp-powershell-exec

MCP.Pizza Chef: dfinke

MCP PowerShell Exec Server is a lightweight MCP server that executes PowerShell scripts received as string inputs. It securely runs scripts within an MCP environment and returns execution results in real-time, enabling AI assistants and developers to interact programmatically with PowerShell for automation, system management, and scripting workflows.

Use This MCP server To

Run PowerShell scripts remotely via MCP protocol Automate system administration tasks with script execution Integrate PowerShell execution into AI-assisted workflows Return real-time script output for monitoring and debugging Enable AI copilots to execute and analyze PowerShell commands Test and validate PowerShell scripts programmatically Trigger PowerShell scripts from natural language commands

README

MCP PowerShell Exec Server

Overview

MCP PowerShell Exec Server is a lightweight server that accepts PowerShell scripts as strings, executes them, and returns the output. Enabling AI assistants to understand and work with PowerShell.

Features

  • Accepts PowerShell scripts via string input
  • Executes scripts securely in an MCP Server environment
  • Returns execution results in real-time

Installation

Clone the repository and set up the server:

git clone https://github.com/yourusername/mcp-powershell-exec.git
cd mcp-powershell-exec

In Action

Watch the video to see MCP PowerShell Exec Server in action:

Usage

Integration with GitHub Copilot in VSCode Insiders

To use this MCP server with GitHub Copilot in VSCode Insiders, follow these steps:

  1. Install VSCode Insiders

  2. Install GitHub Copilot Extension

    • Open VSCode Insiders
    • Go to the Extensions marketplace
    • Search for and install "GitHub Copilot"
  3. Configure MCP Server

    • Open .vscode/mcp.json
    {
     "servers": {
         "powershell-integration": {
             "command": "py", // Python executable
             "args": [
                "drive:/yourpath/server.py"
             ],
             "env": {}
         }
     }
    }

    Replace the path with the actual path to your server.py file.

  4. Enable Agent Mode

    • Open Copilot chat in VSCode Insiders
    • Click on "Copilot Edits"
    • Choose "Agent mode"
    • Click the refresh button in the chat input to load the available tools

System Requirements

  • Python: Version 3.10 or higher (required for optimal performance)
  • PowerShell: Version 5.1

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For issues and questions:

  • Create an issue in this GitHub repository

mcp-powershell-exec FAQ

How do I install the MCP PowerShell Exec Server?
Clone the GitHub repository and follow the setup instructions to run the server locally.
Is script execution secure in this MCP server?
Yes, it runs scripts in a controlled MCP server environment to ensure security and isolation.
Can this server return output in real-time?
Yes, it streams execution results back to the client as the script runs.
What kind of PowerShell scripts can I run?
You can run any valid PowerShell script passed as a string, subject to server security policies.
How does this server integrate with AI assistants?
It allows AI models to send PowerShell commands and receive outputs, enabling automated scripting workflows.
Can I use this server with VSCode or GitHub Copilot?
Yes, it supports integration with VSCode Insiders and GitHub Copilot for enhanced scripting assistance.
Does it support error handling in scripts?
Yes, script errors are captured and returned as part of the execution output.
Which LLM providers can work with this MCP server?
It is provider-agnostic and works with OpenAI, Anthropic Claude, Google Gemini, and others.