Skip to content

feat: PM2 Native MCP Server — Proposal #6026

@elasticdotventures

Description

@elasticdotventures

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions