feat: PM2 Native MCP Server — WORKING EXAMPLE
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
PM2 should optionally include a native MCP server to expose process introspection, logs, and control via HTTP/SSE.
Enablement:
pm2 start ecosystem.config.js --mcp
# or
pm2 set mcp.enabled true
pm2 set mcp.port 7777
Endpoints / Features:
/processes (GET) — list all processes, status, CPU/mem, uptime
/process/:id (GET) — detailed info on a process
/logs/:id (GET) — stream or search logs for a process (SSE or tail)
/restart/:id (POST) — restart a process
/stop/:id (POST) — stop a process
/scale/:id (POST) — scale cluster instances up/down
/metrics (GET) — CPU/mem, restart counts, uptime summary
/health (GET) — overall PM2 daemon health
Design Notes:
- MCP server disabled by default
- Authentication optional (token or local-only by default)
- Can serve multiple MCP clients concurrently
- Minimal footprint — reuses PM2 internal process table and log streams
Use Cases:
LLM / AI tool orchestration (query, restart, scale)
Dev workflows: auto-tail logs, search history
Ops dashboards / monitoring integration
Programmatic PM2 control without shell commands
Summary:
- Native, optional MCP server
- Exposes logs, metrics, status, and control
- Lightweight, secure, opt-in
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing PM2's existing CLI configuration and daemon interfaces, especially the internal process table and log streams mentioned in the issue. Define the integration points for the optional HTTP/SSE server and verify that the documented process, log, control, metrics, and health endpoints work while the server remains disabled by default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- api, backend, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100