Skip to content

Commit dcaa050

Browse files
elasticdotventuresclaudeCopilotCopilot
authored
Add semantic state and log analysis tools to MCP server (#6)
* feat: add Model Context Protocol (MCP) server 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 <noreply@anthropic.com> * Add semantic state and log analysis tools to MCP server * Update README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update lib/mcp/server.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update lib/mcp/server.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update lib/mcp/server.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Brian Horakh <35611074+elasticdotventures@users.noreply.github.com> * Update lib/mcp/server.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Brian Horakh <35611074+elasticdotventures@users.noreply.github.com> * Update lib/mcp/server.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Brian Horakh <35611074+elasticdotventures@users.noreply.github.com> * Initial plan (#8) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> * [WIP] Update semantic state and log analysis tools for MCP server (#7) * Initial plan * Add explanation of Codex CLI tool in README Co-authored-by: elasticdotventures <35611074+elasticdotventures@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: elasticdotventures <35611074+elasticdotventures@users.noreply.github.com> --------- Signed-off-by: Brian Horakh <35611074+elasticdotventures@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
1 parent 2796bc5 commit dcaa050

File tree

2 files changed

+359
-20
lines changed

2 files changed

+359
-20
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PM2 is constantly assailed by [more than 1800 tests](https://github.com/Unitech/
3838

3939
Official website: [https://pm2.keymetrics.io/](https://pm2.keymetrics.io/)
4040

41-
Works on Linux (stable) & macOS (stable) & Windows (stable). All Node.js versions are supported starting Node.js 22.0.0 and Bun since v1
41+
Works on Linux (stable) & macOS (stable) & Windows (stable). Node.js 22.0.0 and later are supported, and Bun since v1
4242

4343

4444
## Installing PM2
@@ -241,6 +241,8 @@ claude mcp get pm2-mcp
241241
```
242242

243243
#### Codex (stdio)
244+
[Codex](https://developers.openai.com/codex/mcp) is OpenAI's CLI tool for AI-assisted development with MCP support.
245+
244246
```bash
245247
# Add pm2-mcp to Codex
246248
codex mcp add pm2-mcp -- pm2-mcp

0 commit comments

Comments
 (0)