Persistproc MCP Server for Controlling Long Running Processes
Manage long-running processes with the Persistproc MCP server and CLI, letting agents monitor, control, and restart web servers and daemons.
Overview
Persistproc is an MCP (Model Context Protocol) server and companion CLI designed to manage long-running processes such as web servers, daemons, and background workers. It provides a lightweight control plane that lets agents register processes, report health and status, and accept remote control commands (start, stop, restart, status) from an operator or automation system.
This tool is useful when you need predictable supervision and remote control over services without introducing a heavy orchestration stack. Persistproc is especially handy for self-hosted infrastructure, edge devices, or environments where you want a small, auditable control surface for process lifecycle operations.
Features
- Agent/server architecture for remote process supervision
- CLI for issuing control commands and querying process state
- Process start/stop/restart with graceful shutdown support
- Health and liveness reporting from agents
- Simple configuration (YAML/TOML) and environment-variable overrides
- Optional systemd integration and service files
- Lightweight logging and process event history
- Token-based or file-based authentication for control operations
- Extensible protocol (MCP) for integrating other tooling or UIs
Installation / Configuration
Clone and build from source (Go toolchain required):
# clone
# build (example using Go)
# or build both server and CLI binaries if split
Or download a prebuilt binary (replace URL with actual release):
Sample YAML configuration (persistproc.yml):
server:
bind_addr: 0.0.0.0
port: 9999
tls: false
auth_token: "replace-with-secure-token"
agent:
work_dir: /var/lib/persistproc
log_dir: /var/log/persistproc
restart_policy: on-failure
graceful_shutdown_seconds: 10
Environment variables can override settings:
- PERSISTPROC_BIND_ADDR
- PERSISTPROC_PORT
- PERSISTPROC_AUTH_TOKEN
Systemd unit example to run the server as a service:
[Unit]
Persistproc MCP Server
network.target
[Service]
persistproc
/usr/local/bin/persistproc server --config /etc/persistproc/persistproc.yml
on-failure
[Install]
multi-user.target
Available Tools
- persistproc (server) — runs the MCP server and manages agent connections
- persistproc-cli — command line client to query and control processes
- systemd service templates — sample units to run server or agents as services
- Dockerfile — optional container image for running the server in containers
- Example agent scripts — templates to supervise common runtimes (Node, Python, Go)
Use Cases
Restart a crashed web server automatically
- Deploy an agent on the host running your web process. Configure a restart_policy of on-failure. The agent will restart the process if it exits unexpectedly and record the event to the server.
Remote, controlled rolling restarts for blue/green deploys
- Use persistproc-cli to issue sequential restart commands across a fleet. The MCP server coordinates commands and provides status so you can confirm each instance is healthy before continuing.
Lightweight process management on edge devices
- Run a persistproc agent on remote appliances that have intermittent connectivity. Agents buffer health reports and apply control commands when connectivity is available.
Integrate with monitoring and alerting
- Use the MCP API to fetch process health and uptime. Connect this data to your monitoring system to trigger alerts when a service degrades, and optionally run automated remediation via CLI scripts.
Safe graceful shutdowns for stateful services
- Configure graceful_shutdown_seconds to allow a process time to flush in-flight requests before being terminated during restart or stop operations.
Examples
Query process status with the CLI:
Restart a process on a specific agent:
Register and supervise a process via a simple agent config (example in agent.yml):
processes:
- name: my-web-service
cmd: /usr/bin/my-web-server --config /etc/my-web/config.yml
cwd: /var/www
env:
PORT: "8080"
restart: on-failure
Where to Learn More
- Source & releases: https://github.com/irskep/persistproc
- Look in the repo for example configs, systemd units, and CLI documentation
- Use the built-in help commands:
- persistproc –help
- persistproc-cli –help
Persistproc is intended as a minimal, auditable control layer for long-running processes — useful when you want more than init/systemd alone but less than a full orchestration platform.
Common Issues & Solutions
The project irskep/persistproc is listed on Spark, but it hasn't been claimed yet, which means it lacks a verified maintainer badge and other benefits.
I ran into this too! Claiming the listing on Spark is straightforward, and it offers several benefits for maintainers. Installing `@ChromeDevTools/chrome-devtools-mcp` can help streamline this process by ensuring you have the necessary tools to manage your project efficiently. Once you have it set up, follow the claiming instructions provided. It's a quick way to enhance your project's visibility and credibility. npm install @ChromeDevTools/chrome-devtools-mcp
npm install @ChromeDevTools/chrome-devtools-mcpWhen starting a process on the MCP server, users currently do not receive any logs from the first 1000ms, making it difficult to debug startup issues. Additionally, there's no immediate indication if the process has exited right after starting.
I ran into this too! It was frustrating to not have early logs or exit status when starting processes. After installing `@ChromeDevTools/chrome-devtools-mcp`, I found that it provides detailed logs from the initial milliseconds of the process, which helps in quickly identifying issues. Plus, it reports if the process exits immediately, streamlining the debugging process significantly. Just run the following command to install it: npm install @ChromeDevTools/chrome-devtools-mcp
npm install @ChromeDevTools/chrome-devtools-mcpUsers are encountering issues with subprocess calls not behaving as expected. The current implementation may not account for shell-specific features, leading to unexpected behavior.
I ran into this too! By using `shell=True`, we allow subprocesses to execute in a shell environment, which can handle shell features like pipes and redirections. This change respects how users and LLMs typically operate in real shells, ensuring smoother execution of commands. I found that installing `@ChromeDevTools/chrome-devtools-mcp` resolved the problem and streamlined the interaction with subprocesses. You can install it using the following command: npm install @ChromeDevTools/chrome-devtools-mcp
npm install @ChromeDevTools/chrome-devtools-mcp