ShingWong/node-server-orchestrator
If you are the rightful owner of node-server-orchestrator and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Node Server Orchestrator is a powerful MCP server designed to manage and orchestrate Node.js development servers across multiple projects.
Node Server Orchestrator
A CLI tool for orchestrating Node.js development servers across multiple projects. Start, stop, and monitor backend, frontend, database, and other Node.js-based development servers with a unified interface.
š Features
-
Multi-Project Support - Manage servers across different projects
-
Health Monitoring - Real-time status checks with uptime tracking
-
Error Handling - Startup failure detection and clear error messages
-
Extensible - Easy to configure new projects and server types
-
Cross-Platform - Works on Windows, macOS, and Linux
š Available Commands
start <server-id>
- Start a specific project serverstop <server-id>
- Stop a running serverstatus <server-id>
- Get detailed server status with uptimelist
- List all configured serversstart-all
- Start all servers simultaneouslystop-all
- Stop all running servers
š ļø Installation
npm install -g node-server-orchestrator
Or use directly:
npx node-server-orchestrator
āļø Configuration
Create a configuration file at ~/.config/node-server-orchestrator/config.json
:
{
"projects": {
"my-backend": {
"name": "My Backend API",
"type": "backend",
"command": ["npm", "run", "dev"],
"cwd": "/path/to/my-project",
"port": 3000,
"healthPath": "/health",
"startupTimeout": 10000,
"description": "My project backend server"
},
"my-frontend": {
"name": "My Frontend App",
"type": "frontend",
"command": ["npm", "start"],
"cwd": "/path/to/my-project/frontend",
"port": 3001,
"healthPath": "/",
"startupTimeout": 15000,
"description": "My project frontend development server"
}
}
}
š§ Usage
CLI Usage
# List all available servers
node-server-orchestrator list
# Start a specific server
node-server-orchestrator start example-backend
# Stop a specific server
node-server-orchestrator stop example-backend
# Check server status
node-server-orchestrator status example-backend
# Start all servers
node-server-orchestrator start-all
# Stop all servers
node-server-orchestrator stop-all
# Show help
node-server-orchestrator --help
Example Workflow
-
List available servers:
š Available Servers: My Backend API (my-backend) - My project backend server My Frontend App (my-frontend) - My project frontend development server
-
Start a server:
ā My Backend API started successfully š PID: 12345 š Port: 3000 ā° Started: 2:30:45 PM
-
Check status:
š¢ My Backend API is running š PID: 12345 š Port: 3000 ā° Started: 2:30:45 PM ā±ļø Uptime: 5m 23s
šÆ Use Cases
Development Workflows
- Start all project servers with one command
- Monitor server health during development
- Automatically restart servers on changes
CI/CD Integration
- Start test environments programmatically
- Verify server health before deployments
- Manage multiple microservices
š API Reference
Server Configuration
Each server configuration supports:
name
: Human-readable server nametype
: Server type (backend, frontend, database, etc.)command
: Command array to start the servercwd
: Working directory for the serverport
: Port number for health checkshealthPath
: HTTP path for health checksstartupTimeout
: Maximum startup wait time in millisecondsdescription
: Server description
Health Check Protocol
Servers are considered healthy when they respond with HTTP 200/304 on the specified port and health path.
š Security Features
The CLI tool includes comprehensive security measures:
Input Validation
- Server ID Validation: Only alphanumeric characters, hyphens, and underscores allowed
- Command Whitelist: Only pre-approved commands (
npm
,node
,yarn
,pnpm
,bun
) can be executed - Port Validation: Port numbers must be between 1-65535
- Path Validation: Working directories must be absolute paths
- Timeout Limits: Startup timeouts capped at 60 seconds maximum
Command Injection Protection
- Shell Execution: All commands run with
shell: false
to prevent command injection - Command Array: Commands must be provided as arrays, not strings
Path Traversal Prevention
- Config Path Sanitization: Prevents
../
directory traversal in configuration files - Absolute Paths: All working directories must be absolute paths
Error Information Protection
- Error Sanitization: Sensitive paths and IP addresses are redacted from error messages
- Limited Information: Error messages provide only necessary information
šØ Error Handling
The MCP server provides clear error messages for:
- Port conflicts - When a server is already running
- Startup failures - When servers fail to start within timeout
- Process crashes - When managed processes terminate unexpectedly
- Configuration errors - Invalid server configurations
š¤ Contributing
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.
Development Setup
git clone https://github.com/swong-fcsllc/node-server-orchestrator.git
cd node-server-orchestrator
npm install
npm run build
npm test
š License
MIT License - see LICENSE file for details.