MCP Server: List and Terminate Processes
List and terminate OS processes on the MCP server using natural language queries for fast, secure process management.
npx -y @misiektoja/kill-process-mcpOverview
This MCP (Model Context Protocol) server provides a compact, developer-focused way to inspect and terminate operating system processes via natural-language queries. It exposes a small API that can be integrated with local LLM agents or other tooling that speaks MCP, so you can ask—using plain language—to find offending processes and stop them quickly and securely.
The server is useful when you need a programmatic, auditable way to manage processes from CI runners, remote developer tools, or AI assistants that are able to reason about system state. Instead of manually searching by PID or command line, you can issue descriptive queries (for example, “kill the longest-running Python process started by user alice”) and let the MCP-enabled tooling resolve the correct process and perform the action.
Features
- List active OS processes with useful metadata (PID, user, CPU, memory, command line, start time).
- Terminate processes by PID or by natural-language query resolved by the MCP agent.
- Simple JSON HTTP API suitable for automation and MCP integration.
- Authentication support (token-based) to restrict who can query or terminate processes.
- Optional Docker support for consistent deployment.
- Audit-friendly responses and explicit result reporting after kill attempts.
Installation / Configuration
Below are general setup examples. Adjust to your platform and follow the repository README for language-specific instructions.
Clone the repository:
Run locally (example patterns — adapt to the actual runtime in the repo):
# If the project is a Node app
# Or if it's a Python app
Docker (build and run):
Environment variables (common examples):
# Port where the server listens
PORT=8080
# Token used by clients and MCP agents to authenticate
MCP_AUTH_TOKEN=replace_with_secure_token
# Optional: enable verbose logging
LOG_LEVEL=info
Available Tools / Resources
The server exposes a minimal set of HTTP endpoints suitable for automation or integration with MCP-capable agents.
Example endpoints:
GET /processes
- Returns a list of running processes.
- Query parameters: sort (cpu|mem|time), limit, user.
- Example response (JSON):
POST /kill
- Terminates a process. Accepts either a PID or a natural-language query.
- Payload examples:
or - Response includes success/failure, signal used, and a short reason.
Authentication
- Add header: Authorization: Bearer <MCP_AUTH_TOKEN>
Process fields (table):
| Field | Description |
|---|---|
| pid | Process identifier (integer) |
| user | Owner of the process |
| cpu_percent | CPU usage percentage |
| memory_mb | Resident memory in MB |
| cmd | Full command line |
| start_time | ISO-8601 start timestamp |
Use Cases
Kill a runaway process by PID
- Use case: CI job spawns a job that doesn’t terminate.
- Example:
Kill a process using a natural-language query
- Use case: You remember the process by description, not PID.
- Example:
- The server (or MCP agent tied to it) resolves the query to a PID, returns the intended target for confirmation, then performs the termination.
Inspect processes before acting
- Use case: Audit and verification prior to any kill.
- Example:
&limit=10
Integrate with an LLM-based operator
- Use case: Add process management capability to an assistant that can safely request process termination when necessary. The MCP protocol lets the assistant query the process list and request kills using human language, while the server enforces auth and returns structured results.
Security and Best Practices
- Always protect the server with a strong authentication token and network-level controls (firewalls, local-only binding when appropriate).
- Prefer read-only listing for less-privileged workflows; require stricter auth for /kill.
- Log every kill request with requester identity and reason to maintain audit trails.
- Use dry-run or confirm modes in automated agents to avoid accidental termination.
- Run the server with least privilege; avoid running as root unless required.
Where to find the project
Source and issues: https://github.com/misiektoja/kill-process-mcp
For detailed runtime