Provides a persistent PowerShell session interface with tools for running commands, managing working directory, and handling environment variables
LmsPs — LM Studio PowerShell MCP Server
A minimal, environment‑driven MCP server that exposes a persistent PowerShell session to LM Studio. It keeps a single pwsh.exe/powershell.exe process alive and offers tools to run commands, manage cwd, and get/set env vars. Responses to the client are trimmed (default 500 chars) while full I/O is logged.
Features
Tools:
ps.run,ps.cd,ps.cwd,ps.reset,ps.env_get,ps.env_setPersistent PowerShell between calls (stateful session)
500‑char response trim to the client; full logs on disk
All paths/config via environment variables (no hardcoded paths)
Install (dev)
Run (stdio)
From WSL (recommended by LM Studio):
Or directly (Windows):
Environment variables
LMSPS_PWSH— PowerShell executable (defaultpwsh.exe, fallbackpowershell.exe)LMSPS_PWSH_FALLBACK— override fallback exe if neededLMSPS_LOGDIR— log directory (default:<repo>/logs)LMSPS_TRIM_CHARS— max characters returned to client (default:500)LMSPS_TIMEOUT_SEC— per‑call timeout in seconds (default:30)
LM Studio configuration example
Add to your LM Studio settings JSON:
Smoke test (from LM Studio)
ps.run→Get-Process | Select-Object -First 3ps.cwd→ should show current locationps.cd→ change to a test directory and re‑runps.cwdps.env_set/ps.env_get→ write/read a temp environment variableRe‑run
ps.runto confirm session persistence
Logs
Full request/response JSON lines are appended to
LMSPS_LOGDIR/lmsps_server.log.
Repo layout
src/lmsps/server.py— MCP server implementationscripts/start_ps_mcp_stdio.sh— stdio launcher (used by LM Studio)logs/— default log directory (overridable viaLMSPS_LOGDIR)
License
MIT
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enables interaction with a persistent PowerShell session through LM Studio. Provides tools to run commands, manage directories, and handle environment variables while maintaining session state between calls.
Related MCP Servers
- Asecurity-licenseAqualityEnables LLMs to interact with web pages, take screenshots, and execute JavaScript in a real browser environmentLast updated -10633264MIT License
- -security-license-qualityA comprehensive toolkit that enhances LLM capabilities through the Model Context Protocol, allowing LLMs to interact with external services including command-line operations, file management, Figma integration, and audio processing.Last updated -26Apache 2.0
- Asecurity-licenseAqualityEnables interaction with lightning addresses and common lightning tools via your LLM, providing Lightning Network functionality through natural language.Last updated -3121
- Asecurity-licenseAqualityA local Model Context Protocol server that allows LLMs to securely execute shell commands on remote Linux and Windows systems via SSH connections.Last updated -612