A minimal, transparent PowerShell 7 MCP for Windows โ one tool: raw exit code, stdout, stderr.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
๐ก Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
A minimal, transparent PowerShell 7 MCP for Windows โ one tool: run a command, get raw exit code / stdout / stderr back.
pwsh-exec is a minimal, transparent PowerShell 7 MCP server for Windows. It exposes a single tool, run_command, that runs a command in a fresh pwsh process and returns the raw exit_code, stdout, and stderr โ nothing parsed, filtered, or reformatted.
command, timeout (seconds), optional working_directory.It gives any AI agent on Windows a real terminal: you send a command, you get back exactly what the terminal produced.
Feature-complete and stable. One tool, a frozen v1.0.0 API, 38 passing tests, in daily use driving real agent work since April 2026 with no known bugs. Reproducible bugs get fixed; the scope stays intentionally small โ it does one thing.
pwsh) on PATH โ this is the modern cross-platform PowerShell, not the built-in Windows PowerShell 5.1 (powershell.exe). Install it via winget install Microsoft.PowerShell or from the official install guide.uvx runner used below.No clone required โ uvx fetches and runs it on demand. Register it with your MCP client (stdio transport):
Use this as the server's launch command:
Edit claude_desktop_config.json:
The
cmd /cwrapper is recommended on Claude Desktop: as an Electron app it has no console of its own, and launching a console program directly can leave child processes (pwsh โ git and other external.exes) without a working console โ flickering windows, lost stdout, PATH lookups failing.cmd.exeacquires the hidden console first and every child inherits it. This is the same pattern Desktop Commander and other Windows MCP servers use.
run_command| Parameter | Type | Required | Description |
|---|---|---|---|
command | string | yes | The PowerShell command or script to run. |
timeout | integer | yes | Timeout in seconds (not milliseconds). 1โ300. |
working_directory | string | no | Absolute path. Defaults to the resolved working directory (see Configuration). |
The output is plain text: the exit code first, then labelled stdout and stderr sections (empty ones still show, so the two streams are never ambiguous), then a diagnostic footer with a timestamp and elapsed time.
For example, calling run_command with command: "git status" returns the raw git output, untouched:
Nothing is summarised or filtered. A non-zero exit code, a syntax error written to stderr, an empty result โ all of it comes back as the terminal produced it. Output longer than 500 lines per stream is trimmed to the first and last 250 lines so it never floods the context window.
Running a shell on Windows from a host process is full of small traps. pwsh-exec handles them so the agent doesn't have to:
REG_EXPAND_SZ values like %USERPROFILE%\... are expanded correctly).pwsh plus any children it spawned, e.g. node, python), leaving no orphans.The small scope is the design. pwsh-exec deliberately does not do:
cd and variables don't carry over. Pass working_directory, or combine dependent steps into one command.working_directory defaults to a resolved directory, chosen in this order (highest priority first):
working_directory argument passed on the call.PWSH_EXEC_DEFAULT_DIR environment variable, if set.%TEMP%\pwsh-exec.To change the default, set PWSH_EXEC_DEFAULT_DIR in your MCP client's config:
An unset or blank value falls back to the built-in default. The default lives under %TEMP% (its own subfolder, so you can wipe it wholesale) rather than scattering files into the shared temp directory.
MIT ยฉ 2026 Jason26214
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/pwsh-exec-mcp)<a href="https://allmcps.com/mcp/pwsh-exec-mcp"><img src="https://allmcps.com/api/badge/pwsh-exec-mcp?style=directory" alt="Pwsh Exec Mcp on AllMCPs" /></a>