Provides process and service management capabilities for Docker services running on Windows, including discovery, monitoring, and control of Docker Desktop Service and related processes
Enables management and monitoring of Node.js processes, including port-based discovery, process termination, and resource analysis for Node.js development servers and applications
PortMaster MCP
Overview
PortMaster MCP is a comprehensive Windows process and service management tool that provides both AI-assisted and direct command-line interfaces. It enables secure discovery, inspection, and control of any Windows service or process by name, PID, or port number with integrated UAC elevation.
๐ Dual Interface Design
๐ค Claude Code Integration: Full MCP server for AI-assisted process management
โก Standalone CLI: Direct PowerShell interface via
portmaster-cli.ps1
๐ Unified Security: Consistent UAC elevation across both interfaces
Key Features
๐ Discovery & Inspection
Find processes by service name (supports wildcards)
Find processes listening on specific ports or port ranges
Get detailed process information by single or multiple PIDs
List all listening ports on the system
Analyze complete process trees with parent/child relationships
Network connection analysis (listening ports + active connections)
Process chain visualization with memory and resource usage
๐ ๏ธ Management Capabilities
Kill individual processes by PID
Kill multiple processes at once
Kill all processes using specific ports
Start, stop, and restart Windows services
UAC elevation for admin operations (no need to run Claude Code as admin)
๐ Security Features
UAC Elevation: Only prompts for admin privileges when needed
Confirmation Required: All destructive operations require explicit confirmation
Safe Defaults: Read-only operations work without elevation
Process Tree Analysis: Shows impact before performing operations
Installation
Prerequisites
Windows OS (Windows 10/11 or Windows Server)
Python 3.8+
PowerShell (pre-installed on Windows)
Claude Code installed
Quick Setup (Recommended)
Option A: Automatic Setup
The setup script will:
โ Check dependencies and PowerShell policy
โ Automatically add MCP server to your Claude config
โ Create backup of existing config
โ Show next steps
Option B: Manual Setup
1. Install Python Dependencies
2. Configure PowerShell Execution Policy
3. Add to Claude Code Settings
Add this configuration to your Claude Code settings file (%USERPROFILE%\.claude.json
):
Replace the path with your actual installation directory.
4. Restart Claude Code
Close and restart Claude Code to load the new MCP server.
Standalone CLI Usage
For direct command-line access without Claude Code, use the included portmaster-cli.ps1
script:
๐ Quick Start
Option 1: Automated Setup (Recommended)
Option 2: Quick CLI Examples
๐ CLI Commands Reference
Command | Description | Admin Required | Example |
| Check what's listening on ports | โ |
|
| Show all listening ports | โ |
|
| Find services by pattern | โ |
|
| Get service details | โ |
|
| Comprehensive process analysis | โ |
|
| Terminate specific process | โ |
|
| Kill processes using ports | โ |
|
| Kill multiple processes | โ |
|
| Stop Windows service | โ |
|
| Start Windows service | โ |
|
| Restart Windows service | โ |
|
Claude Code Usage Examples
Service Management
Port-Based Discovery
Process Management
Multiple Process Analysis
Advanced Operations
Available MCP Tools
Discovery Tools (No Admin Required)
Tool | Description | Example Usage |
| Find processes for any service pattern |
|
| Find processes on specific ports |
|
| List all listening ports |
|
| Get details for a PID |
|
| NEW : Get details for multiple PIDs |
|
| Get details for a service |
|
Management Tools (UAC Elevation Required)
Tool | Description | Security |
| Terminate a process by PID | UAC + Confirmation |
| Kill all processes on port(s) | UAC + Confirmation |
| Kill multiple processes by PIDs | UAC + Confirmation |
| Stop a Windows service | UAC + Confirmation |
| Start a Windows service | UAC |
| Restart a Windows service | UAC + Confirmation |
File Structure
How UAC Elevation Works
Normal Operations: Claude Code runs with standard user privileges
Admin Required: When you request a destructive operation (kill process, stop service)
UAC Prompt: Windows shows a UAC dialog asking for administrator approval
Elevated Execution: If approved, the operation runs with admin privileges in a separate session
Return to Normal: After completion, returns to standard privileges
This approach is more secure than running Claude Code as administrator constantly.
Troubleshooting
"Administrator privileges required"
This is normal for kill/service operations
Approve the UAC prompt when it appears
If UAC is disabled, you could run Claude Code as Administrator but I would advise to NOT do this.
"PowerShell execution policy error"
"Module not found" errors
"Service not found"
Use wildcards:
*partial-name*
Check exact service name:
Get-Service
in PowerShell
"Process not found"
Process may have already terminated
Check PID with Task Manager or
Get-Process
Getting Service Names
To find the exact names of Windows services:
Checking Port Usage
To see what's using ports:
Security Considerations
Safe Operations
Read operations never require elevation
Discovery tools are completely safe
UAC prompts appear only for destructive operations
Admin Operations
Always confirm before approving UAC prompts
Review the operation in the confirmation dialog
Cancel if you're unsure about the operation
Best Practices
Use discovery tools first to understand what you're managing
Review process trees before killing multiple processes
Prefer service operations over direct process killing when possible
Test on non-critical systems first
Example Workflows
Troubleshooting a Web Service
"Find processes for *Web*"
- Discover web-related services"What's listening on port 80?"
- Check if port is in use"Get info for service W3SVC"
- Get IIS service details"Restart service W3SVC"
- Restart if needed
Cleaning Up Development Processes
"Find processes on ports 3000, 8080, 9000"
- Find dev servers"Kill processes using ports 3000, 8080"
- Clean up dev ports"Show all listening ports"
- Verify cleanup
CLI Alternative:
Managing Database Services
"Find services matching *SQL*"
- Find database services"Stop service MSSQLSERVER"
- Stop SQL Server"Start service MSSQLSERVER"
- Start SQL Server
Analyzing Multiple Processes (NEW)
Comprehensive analysis of multiple processes at once:
Claude Code Examples:
CLI Example:
What Multiple Process Analysis Shows:
Individual Details: Complete process info for each PID
Parent/Child Relationships: Process tree visualization
Network Analysis: Listening ports + active connections per process
Resource Summary: Combined memory usage and process type grouping
Process Chain: How processes relate to each other
Service Associations: Which processes belong to services
Example Output Summary:
๐ง Advanced Configuration
PowerShell Execution Policy
If you encounter execution policy errors:
Custom Port Ranges
The CLI supports flexible port specifications:
Environment Variables
Set these for customized behavior:
PORTMASTER_TIMEOUT
- Command timeout in seconds (default: 30)PORTMASTER_FORCE_COLOR
- Force colored output (true/false)
๐ค Contributing
PortMaster MCP is designed with these principles:
๐ก๏ธ Security First - UAC elevation only when needed
๐ง Extensible - Easy to add new commands and features
๐ฏ User-Friendly - Clear confirmations and error messages
๐ Comprehensive - Complete process and service lifecycle management
Development Setup
๐ License
This project is provided as-is under the MIT License for managing Windows processes and services.
๐ Acknowledgments
Built for Claude Code MCP integration
Powered by Windows PowerShell and Python
Designed for Windows system administrators and developers
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
Enables comprehensive Windows process and service management with secure UAC elevation. Supports discovery, inspection, and control of processes by name, PID, or port number, with both AI-assisted and direct command-line interfaces.