LmsPs

LmsPs

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.

Category
Visit Server

README

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_set
  • Persistent 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)

cd K:/Repos/LmsPs
python -m venv .venv
. .venv/Scripts/activate  # Windows
pip install -e .

Run (stdio)

  • From WSL (recommended by LM Studio):
bash K:/Repos/LmsPs/scripts/start_ps_mcp_stdio.sh
  • Or directly (Windows):
python -m lmsps.server

Environment variables

  • LMSPS_PWSH — PowerShell executable (default pwsh.exe, fallback powershell.exe)
  • LMSPS_PWSH_FALLBACK — override fallback exe if needed
  • LMSPS_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:

{
  "mcpServers": {
    "lmsps": {
      "command": "bash",
      "args": ["-lc", "K:/Repos/LmsPs/scripts/start_ps_mcp_stdio.sh"],
      "env": {
        "LMSPS_PWSH": "/mnt/c/Program Files/PowerShell/7/pwsh.exe",
        "LMSPS_LOGDIR": "/mnt/k/LMstudio/LmsPs/logs",
        "LMSPS_TRIM_CHARS": "500"
      }
    }
  }
}

Smoke test (from LM Studio)

  • ps.runGet-Process | Select-Object -First 3
  • ps.cwd → should show current location
  • ps.cd → change to a test directory and re‑run ps.cwd
  • ps.env_set/ps.env_get → write/read a temp environment variable
  • Re‑run ps.run to 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 implementation
  • scripts/start_ps_mcp_stdio.sh — stdio launcher (used by LM Studio)
  • logs/ — default log directory (overridable via LMSPS_LOGDIR)

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured