Skip to content

Conversation

@elasticdotventures
Copy link
Contributor

Package: github.com/PromptExecution/pm2-mcp

PM2 with Model Context Protocol (MCP) server support for process management.

What is pm2-mcp?

PM2 is a production process manager for Node.js applications. This fork adds MCP server capabilities, allowing process management through MCP-compatible clients like Claude Code and Codex.

Key Features

  • Full PM2 Functionality: All standard PM2 process management features
  • MCP Server: Built-in pm2-mcp binary that exposes process management via MCP
  • 12 MCP Tools: Process lifecycle, logging, and monitoring operations
  • 2 MCP Resources: Real-time process list and detailed process information
  • Sandbox Detection: Automatically adapts to sandboxed environments
  • Multiple Transports: Supports stdio and HTTP transports

Package Details

  • Distributable: GitHub source tarball from releases
  • Build: npm install from source (npm install --global)
  • Dependencies: Node.js >= 22.0.0
  • Version Discovery: GitHub tags (strips leading v)
  • License: AGPL-3.0

Binaries Provided

  • pm2 - Main PM2 CLI
  • pm2-dev - Development mode
  • pm2-docker - Docker runtime
  • pm2-runtime - Production runtime
  • pm2-mcp - MCP server

Testing

# Installation test
pkgx github.com/PromptExecution/pm2-mcp pm2 --version

# MCP server test
pkgx github.com/PromptExecution/pm2-mcp pm2-mcp --help

# Integration with MCP clients
claude mcp add pm2-mcp -- pkgx github.com/PromptExecution/pm2-mcp pm2-mcp

Links

Related

This package follows the same pattern as the recently merged just-mcp package (github.com/promptexecution/just-mcp), which is also an MCP server implementation.

Checklist

  • Package name follows domain-based convention
  • All required sections present (distributable, versions, build, test)
  • Build script installs to {{prefix}}
  • Test script validates functionality
  • Package is relocatable (no hardcoded paths)
  • Metadata is accurate (description, license, homepage)
  • README.md included with usage documentation
  • GitHub release exists with source tarball

PM2 with Model Context Protocol (MCP) server support.

Features:
- Full PM2 process manager functionality
- Built-in MCP server for process management
- 12 MCP tools for process lifecycle, logging, and monitoring
- 2 MCP resources for process information
- Automatic sandbox environment detection
- Support for stdio and HTTP transports
- Compatible with Claude Code, Codex, and other MCP clients

Provides binaries:
- pm2: Main PM2 CLI
- pm2-dev: Development mode
- pm2-docker: Docker runtime
- pm2-runtime: Production runtime
- pm2-mcp: MCP server

Requirements:
- Node.js >= 22.0.0
- Source build using npm install

Related:
- Repository: https://github.com/PromptExecution/pm2-mcp
- MCP Spec: https://modelcontextprotocol.io/
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new package for pm2-mcp, a fork of the PM2 process manager that includes Model Context Protocol (MCP) server support. The package enables process management through MCP-compatible clients by providing both the standard PM2 binaries and a new pm2-mcp binary that exposes MCP functionality.

Key Changes:

  • New package definition for github.com/PromptExecution/pm2-mcp
  • Installs from GitHub source tarballs using npm with Node.js >=22
  • Provides 5 binaries: pm2, pm2-dev, pm2-docker, pm2-runtime, and pm2-mcp
  • Includes README documentation with installation and usage examples

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
projects/github.com/PromptExecution/pm2-mcp/package.yml Package definition with build/test configuration for pm2-mcp installation
projects/github.com/PromptExecution/pm2-mcp/README.md Documentation covering features, installation, and MCP integration examples

Critical Issue Found: The package directory path uses incorrect casing (PromptExecution vs promptexecution). According to pkgx conventions demonstrated by the sister package just-mcp and other GitHub packages, the directory structure should use all lowercase even when the actual GitHub organization uses mixed case. The directory should be projects/github.com/promptexecution/pm2-mcp/ not projects/github.com/PromptExecution/pm2-mcp/.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,65 @@
# pm2-mcp pkgx package
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package directory path uses incorrect casing. According to pkgx conventions, GitHub project paths should use lowercase for the directory structure even when the actual GitHub organization name uses mixed case.

The directory should be:

projects/github.com/promptexecution/pm2-mcp/

Not:

projects/github.com/PromptExecution/pm2-mcp/

This matches the pattern used by the sister package just-mcp which is correctly located at projects/github.com/promptexecution/just-mcp/ while still referencing github: PromptExecution/just-mcp/tags in the versions field and using PromptExecution in URLs.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,30 @@
distributable:
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package directory path uses incorrect casing. According to pkgx conventions, GitHub project paths should use lowercase for the directory structure even when the actual GitHub organization name uses mixed case.

The directory should be:

projects/github.com/promptexecution/pm2-mcp/

Not:

projects/github.com/PromptExecution/pm2-mcp/

This matches the pattern used by the sister package just-mcp which is correctly located at projects/github.com/promptexecution/just-mcp/ while still referencing github: PromptExecution/just-mcp/tags in the versions field and using PromptExecution in URLs.

Copilot uses AI. Check for mistakes.
elasticdotventures added a commit to PromptExecution/pm2-mcp that referenced this pull request Dec 3, 2025
Add MCP server support to PM2 for process management through MCP-compatible clients.

Features:
- New pm2-mcp binary that exposes PM2 process management via MCP
- 12 MCP tools for process lifecycle, logging, and monitoring:
  - pm2_list_processes, pm2_describe_process
  - pm2_start_process, pm2_restart_process, pm2_reload_process
  - pm2_stop_process, pm2_delete_process
  - pm2_flush_logs, pm2_reload_logs, pm2_tail_logs
  - pm2_dump, pm2_kill_daemon
- 2 MCP resources for real-time process information:
  - pm2://processes (list)
  - pm2://process/{id} (detail)
- Automatic sandbox environment detection and adaptation
- Support for stdio and HTTP (Streamable) transports
- Client notifications for sandbox status and recommendations
- Compatible with Claude Code, Codex, and other MCP clients

Implementation:
- New lib/mcp/server.js with full MCP server implementation
- Uses @modelcontextprotocol/sdk for MCP protocol
- Sandbox detection checks home directory writability and environment
- Auto-selects writable PM2_HOME in sandboxed environments
- No-daemon mode by default for MCP client compatibility
- Comprehensive environment variable configuration

Documentation:
- README with MCP server quickstart and setup commands
- Environment variables table (PM2_MCP_*, PM2_HOME, etc.)
- Sandbox detection explanation
- Tool and resource documentation
- Justfile recipes for easy registration with MCP clients

Related:
- Enables pkgx packaging: pkgxdev/pantry#11219
- Development fork: https://github.com/PromptExecution/pm2-mcp
- MCP Specification: https://modelcontextprotocol.io/

Co-authored-by: Claude <[email protected]>
@elasticdotventures
Copy link
Contributor Author

🔗 Upstream Integration

I've created a PR to integrate the MCP server changes into the upstream PM2 repository:

Upstream PR: Unitech/pm2#6066

Current Status

  • pkgx package points to PromptExecution/pm2-mcp (this PR) - testable now
  • 🔄 Upstream PR submitted to Unitech/pm2 - pending review
  • 📦 Future: Once upstream merges, package can be updated to point to github.com/Unitech/pm2

Why PromptExecution/pm2-mcp for now?

The package currently points to the fork so it can be tested immediately. Once the upstream PR is merged, we can update the package to use the official Unitech/pm2 repository.

Testing

Users can install and test the MCP server right now:

pkgx install github.com/PromptExecution/pm2-mcp
pkgx pm2-mcp --help

Cross-References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant