Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Process Serverrun python3 script.py with a 30-second timeout"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP ACS Process Server
A Model Context Protocol (MCP) server that provides process management and monitoring capabilities for AI agents, with strict security boundaries enforced by executable allowlists and resource limits.
🔗 Repository
This package is now maintained in its own repository: https://github.com/Digital-Defiance/mcp-process
This repository is part of the AI Capabilities Suite on GitHub.
Table of Contents
Features
Process Launching: Spawn processes with specified arguments and environment variables
Resource Monitoring: Track CPU, memory, thread count, and I/O usage in real-time
Output Capture: Capture and retrieve stdout and stderr streams separately
Process Termination: Graceful (SIGTERM) and forced (SIGKILL) termination with timeout escalation
Service Management: Long-running services with auto-restart and health checks
Process Groups: Manage related processes and create pipelines
Timeout Management: Automatic process termination after specified duration
I/O Management: Send stdin input and retrieve buffered output
Security: Multi-layer security with executable allowlists, argument validation, and resource limits
Audit Logging: Complete operation tracking for security and compliance
Security
This server implements defense-in-depth security with 6 layers of validation:
Executable Allowlist: Only pre-approved executables can be launched
Argument Validation: Command arguments validated for injection attacks
Environment Sanitization: Dangerous environment variables removed
Resource Limits: CPU, memory, and time limits prevent resource exhaustion
Privilege Prevention: No privilege escalation or setuid executables
Audit Logging: Complete operation tracking
See SECURITY.md for detailed security implementation.
Installation
Docker (Recommended)
See DOCKER.md for detailed Docker usage instructions.
NPM
Yarn
Global Installation
Quick Start
Docker Quick Start
See DOCKER.md for detailed Docker instructions.
NPM Quick Start
1. Create Configuration File
This creates a sample configuration file with secure defaults.
2. Edit Configuration
Edit mcp-process-config.json to add your allowed executables:
3. Start the Server
Or use environment variables:
4. Connect from Your AI Agent
Configure your AI agent (e.g., Kiro, Claude Desktop) to connect to the MCP server via stdio transport.
Configuration
Configuration File Locations
The server looks for configuration in the following order:
--configcommand line argumentMCP_PROCESS_CONFIG_PATHenvironment variableMCP_PROCESS_CONFIGenvironment variable (JSON string)./mcp-process-config.json./config/mcp-process.json
Configuration Options
See SECURITY.md for detailed configuration options and security settings.
Minimal Configuration
MCP Tools
The server exposes 12 MCP tools for process management:
process_start
Launch a new process.
Parameters:
executable(string, required): Path to executableargs(string[], optional): Command-line argumentscwd(string, optional): Working directoryenv(object, optional): Environment variablestimeout(number, optional): Timeout in millisecondscaptureOutput(boolean, optional): Whether to capture stdout/stderrresourceLimits(object, optional): Resource limits
Returns:
pid(number): Process IDstartTime(string): ISO timestamp of process start
process_terminate
Terminate a process.
Parameters:
pid(number, required): Process IDforce(boolean, optional): Use SIGKILL instead of SIGTERMtimeout(number, optional): Timeout for graceful termination (ms)
Returns:
exitCode(number): Process exit codeterminationReason(string): "graceful" or "forced"
process_get_stats
Get process resource usage statistics.
Parameters:
pid(number, required): Process IDincludeHistory(boolean, optional): Include historical data
Returns:
cpuPercent(number): CPU usage percentagememoryMB(number): Memory usage in MBthreadCount(number): Number of threadsioRead(number): Bytes readioWrite(number): Bytes writtenuptime(number): Process uptime in secondshistory(array, optional): Historical statistics
process_send_stdin
Send input to process stdin.
Parameters:
pid(number, required): Process IDdata(string, required): Data to sendencoding(string, optional): Text encoding (default: "utf-8")
Returns:
bytesWritten(number): Number of bytes written
process_get_output
Get captured process output.
Parameters:
pid(number, required): Process IDstream(string, optional): "stdout", "stderr", or "both" (default: "both")encoding(string, optional): Text encoding (default: "utf-8")
Returns:
stdout(string): Captured stdoutstderr(string): Captured stderrstdoutBytes(number): Stdout buffer sizestderrBytes(number): Stderr buffer size
process_list
List all managed processes.
Returns:
Array of process information objects with PID, command, state, and uptime
process_get_status
Get detailed process status.
Parameters:
pid(number, required): Process ID
Returns:
state(string): "running", "stopped", or "crashed"uptime(number): Process uptime in secondsstats(object): Current resource usage statistics
process_create_group
Create a process group.
Parameters:
name(string, required): Group namepipeline(boolean, optional): Whether to create a pipeline
Returns:
groupId(string): Group identifier
process_add_to_group
Add a process to a group.
Parameters:
groupId(string, required): Group identifierpid(number, required): Process ID
process_terminate_group
Terminate all processes in a group.
Parameters:
groupId(string, required): Group identifier
process_start_service
Start a long-running service with auto-restart.
Parameters:
name(string, required): Service nameexecutable(string, required): Path to executableargs(string[], optional): Command-line argumentscwd(string, optional): Working directoryenv(object, optional): Environment variablesrestartPolicy(object, optional): Restart configurationhealthCheck(object, optional): Health check configuration
Returns:
serviceId(string): Service identifierpid(number): Initial process ID
process_stop_service
Stop a service and disable auto-restart.
Parameters:
serviceId(string, required): Service identifier
Usage Examples
Example 1: Run a Simple Command
Example 2: Monitor Resource Usage
Example 3: Interactive Process with Stdin
Example 4: Long-Running Service
Example 5: Process Group Pipeline
Troubleshooting
Issue: "Executable not in allowlist"
Cause: The executable you're trying to launch is not in the allowedExecutables configuration.
Solution: Add the executable to your configuration file:
You can use:
Absolute paths:
/usr/bin/nodeBasenames:
nodeGlob patterns:
/usr/bin/*
Issue: "Shell interpreters are blocked"
Cause: You're trying to launch a shell (bash, sh, cmd.exe, etc.) and blockShellInterpreters is enabled.
Solution: Either:
Set
blockShellInterpreters: falsein your configuration (not recommended)Launch the actual executable directly instead of through a shell
Issue: "Process not found"
Cause: The process has already terminated or the PID is invalid.
Solution: Check if the process is still running using process_list or process_get_status.
Issue: "CPU limit exceeded" or "Memory limit exceeded"
Cause: The process exceeded configured resource limits.
Solution: Increase resource limits in your configuration or when launching the process:
Issue: "Maximum concurrent processes reached"
Cause: You've reached the maxConcurrentProcesses limit.
Solution:
Terminate some running processes
Increase
maxConcurrentProcessesin your configurationWait for processes to complete
Issue: "Process stdin not available"
Cause: The process stdin is closed or the process doesn't support stdin input.
Solution: Ensure the process is still running and was started with stdin enabled.
Issue: Configuration file not found
Cause: The server can't find your configuration file.
Solution:
Use
--configflag:mcp-process --config /path/to/config.jsonSet environment variable:
export MCP_PROCESS_CONFIG_PATH=/path/to/config.jsonPlace config at
./mcp-process-config.json
Debugging
Enable debug logging by setting the audit log level:
Check the audit log for detailed information about process operations and security violations.
Development
Prerequisites
Node.js >= 18.0.0
npm >= 8.0.0
Setup
Testing
End-to-End (E2E) Testing
The MCP ACS Process Server includes comprehensive e2e tests that validate the complete system behavior by spawning the server as a child process and communicating via stdio using JSON-RPC protocol. These tests ensure the server works correctly in real-world usage scenarios.
E2E Test Structure:
server.e2e.spec.ts- Comprehensive e2e tests covering all MCP tools and protocol featuresserver.minimal.e2e.spec.ts- Quick smoke tests for basic functionality validation (< 30 seconds)
Running E2E Tests:
What E2E Tests Validate:
MCP protocol initialization and handshake
Tool discovery via tools/list
Process launch operations with security enforcement
Process monitoring and resource statistics
Process termination (graceful and forced)
Output capture (stdout/stderr)
Service management with auto-restart
Error handling and validation
Security policy enforcement
Resource limit enforcement
Timeout handling
JSON-RPC protocol compliance
E2E Test Requirements:
The server must be built before running e2e tests:
npm run buildTests spawn the server from
dist/cli.jsTests communicate via stdio using JSON-RPC 2.0 protocol
All spawned processes are cleaned up after tests complete
Debugging E2E Test Failures:
If e2e tests fail, follow these steps:
Ensure the server is built:
npm run buildCheck if the CLI exists:
ls -la dist/cli.jsRun tests with verbose output:
npm test -- --testPathPattern=e2e.spec.ts --verboseCheck for server startup errors:
E2E tests capture server stderr output
Look for error messages in test output
Common issues: missing dependencies, permission errors, port conflicts
Verify server can start manually:
node dist/cli.js --helpRun minimal tests first:
npm run test:e2e:minimalIf minimal tests pass but comprehensive tests fail, the issue is likely with specific functionality rather than basic server operation.
Check process cleanup:
# List any orphaned node processes ps aux | grep nodeEnable debug logging: Set
DEBUG=*environment variable to see detailed logs:DEBUG=* npm test -- --testPathPattern=e2e.spec.ts
Common E2E Test Issues:
Issue | Cause | Solution |
"Server executable not found" | Server not built or wrong path | Run |
"Server failed to start" | Server crash on startup | Check stderr output in test logs |
"Request timeout" | Server not responding | Increase timeout or check server logs |
"Process not cleaned up" | Test cleanup failure | Run |
"Port already in use" | Previous test didn't clean up | Kill orphaned processes |
"Permission denied" | Insufficient permissions | Check file permissions on dist/cli.js |
CI Environment Considerations:
E2E tests are designed to run in CI environments with the following considerations:
Headless operation: No display server required
Timeout adjustments: CI environments get 50% longer timeouts
Process cleanup: All processes cleaned up even on test failure
No interactive input: Tests run fully automated
Resource constraints: Tests handle slower CI environments gracefully
CI Configuration Example:
Property-Based Testing:
E2E tests include property-based tests using fast-check to validate universal properties:
JSON-RPC request/response ID matching
Concurrent request handling
Process launch with random allowed executables
Security rejection for blocked executables
These tests run multiple iterations with randomly generated inputs to ensure correctness across a wide range of scenarios.
Linting
Building
Publishing
Architecture
The MCP ACS Process Server consists of several core components:
MCPServer: Main server implementing MCP protocol
SecurityManager: Multi-layer security validation
ProcessLauncher: Process spawning and configuration
ProcessManager: Process lifecycle management
ResourceMonitor: CPU, memory, and I/O monitoring
IOManager: Stdin/stdout/stderr handling
ProcessTerminator: Graceful and forced termination
ServiceManager: Long-running service management
TimeoutManager: Process timeout enforcement
ProcessGroup: Process group and pipeline management
ConfigLoader: Configuration file loading and validation
Contributing
Contributions are welcome! Please see the main repository for contribution guidelines: https://github.com/digital-defiance/ai-capabilities-suite
License
MIT License - see LICENSE file for details.
Support
GitHub Issues: https://github.com/digital-defiance/ai-capabilities-suite/issues
Email: info@digitaldefiance.org
Related Projects
MCP Filesystem - Filesystem operations for AI agents
MCP Recording - Session recording and playback
MCP ACS Debugger - MCP protocol debugging tools
Acknowledgments
Built with:
@modelcontextprotocol/sdk - MCP protocol implementation
pidusage - Process resource monitoring
which - Executable path resolution
minimatch - Glob pattern matching