Skip to main content
Glama

PowerShell MCP Server

by maithaen

PowerShell MCP Server

A Model Context Protocol (MCP) server for automating Windows PowerShell tasks using Python. This server enables programmatic execution of PowerShell scripts, clipboard operations, and terminal output capture via a JSON-RPC interface.

Features

  • Execute PowerShell Scripts: Paste and run PowerShell scripts in Windows Terminal using the clipboard.
  • Clipboard Access: Retrieve the current clipboard content.
  • Terminal Screenshot: Capture the output of the PowerShell terminal as an image.

Requirements

Install dependencies:

pip install uv && uv sync && uv pip install -e .

Usage

Start the server:

uv run powershell-mcp

The server communicates via JSON-RPC over stdin/stdout.

Available Tools

  • execute_pwsh_script: Execute a PowerShell script by pasting it into the terminal.
  • get_clipboard: Get the current clipboard content.
  • capture_pwsh_response: Capture a screenshot of the PowerShell terminal output.

Example Request

{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "execute_pwsh_script", "arguments": { "script": "Get-Process", "timeout": 30 } } }

Basic configuration on claude desktop

  1. Open claude desktop
  2. Go to file -> settings -> developer -> edit config
{ "globalShortcut": "", "mcpServers": { "powershell-mcp": { "command": "uv", "args": [ "--directory", "D:\\MCP antropic\\powershell-mcp", # change to your path "run", "powershell-mcp" ] } } }

Project Structure

pyproject.toml README.md uv.lock config/ src/ powershell_mcp/ main.py temp/ tests/ __init__.py

License

MIT License

-
security - not tested
F
license - not found
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

A server that enables programmatic execution of PowerShell scripts, clipboard operations, and terminal output capture via a JSON-RPC interface.

  1. Features
    1. Requirements
      1. Usage
        1. Available Tools
        2. Example Request
      2. Basic configuration on claude desktop
        1. Project Structure
          1. License

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              A secure shell command execution server implementing the Model Context Protocol (MCP). This server allows remote execution of whitelisted shell commands with support for stdin input.
              Last updated -
              1
              74
              Python
              MIT License
              • Apple
            • A
              security
              F
              license
              A
              quality
              A CLI command execution server that enables running shell commands with structured output, providing detailed execution results including stdout, stderr, exit code, and execution duration.
              Last updated -
              2
              16
              TypeScript
              • Apple
            • -
              security
              F
              license
              -
              quality
              A cross-platform shell command execution server that supports Windows, macOS, and Linux environments with PowerShell, CMD, GitBash, and Bash shells, optimized for Japanese language environments.
              Last updated -
              24
              JavaScript
              • Apple
              • Linux
            • -
              security
              A
              license
              -
              quality
              A lightweight FastAPI server that allows remote execution of shell commands on Windows, with real-time output streaming and security features like API key authentication and rate limiting.
              Last updated -
              Python
              MIT License

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/maithaen/pwsh-mcp'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server