mcp-console-automation is a server based on the Model Context Protocol (MCP) that lets AI drive local console applications and remote SSH sessions in a controlled manner, and monitor them. It positions itself as "Playwright for terminal applications," emphasizing automation, testing, monitoring, and background job capabilities.
Purpose and Capabilities
- Full terminal control: can create and manage up to 50 concurrent console sessions, supporting local shells (cmd, PowerShell, pwsh, bash, zsh, sh) and remote SSH connections.
- Interactive input: supports sending text input and special key sequences (Enter, Tab, Ctrl+C, etc.).
- Real-time output monitoring: can capture, filter, and analyze console output, supporting advanced search and streaming output, suitable for long-running processes and pattern matching.
- Automatic error detection: built-in cross-language error patterns that can recognize errors, exceptions, stack traces, and more.
- Cross-platform: runs on Windows, macOS, and Linux with no native dependencies.
SSH and Remote Connections
- Full SSH support: password and key-based authentication, with passphrase support.
- SSH options: custom port, connection timeout, keep-alive settings.
- Connection profiles: save reusable SSH metadata and environment variable credential references.
- Cloud platform support: connect to Azure, AWS, GCP, Kubernetes via saved profiles.
- Container support: integrates Docker and WSL, adapting to containerized workflows.
Test Automation Framework
- Automated test cases: built-in assertion tools for console output verification.
- Output assertions: verify that output contains content, matches a regex, or equals an expected value.
- Exit code verification: assert command exit codes to determine success/failure.
- No-error verification: automatically check whether errors appear in command output.
- State snapshots: save and compare session state before and after operations.
- Test workflows: assertions can be chained together to cover complete test scenarios.
Background Job Execution
- Asynchronous command execution: run long commands in the background with full output capture.
- Priority queue: set job priority from 1-10 to optimize resource utilization.
- Job monitoring: track the status, progress, and completion of background jobs.
- Job control: can cancel, pause, or resume background operations.
- Result retrieval: retrieve theComplete output and exit codes.
- Resource management: automatically clean up completed jobs, with configurable retention policies.
Enterprise-grade monitoring and alerting
- System-level metrics: track CPU, memory, disk, and network usage.
- Session metrics: monitor performance and resource consumption per session.
- Real-time dashboard: provides real-time monitoring data with customizable views.
- Alerting system: supports performance, error, security, and anomaly alerts, with severity levels.
- Custom monitoring: configure monitoring intervals, metrics, and thresholds per session.
- Diagnostics: built-in error analysis and session health checks.
Profile management
- Connection profiles: save SSH, Docker, WSL, and cloud platform connections.
- Application profiles: store commonly used command configurations (Node.js, Python, .NET, Java, Go, Rust).
- Quick connect: instantly connect using saved profiles, with support for overriding parameters.
- Environment variables: store environment configurations per profile.
- Working directory management: set a default directory for each profile.
Advanced output processing
- Regex filtering: supports case-sensitive regex searches of output.
- Multi-pattern search: combine multiple patterns with AND/OR logic.
- Pagination: retrieve a specified line range, head, or tail of output.
- Time-based filtering: filter by timestamp (absolute time or relative time such as '5m', '1h', '2d').
- Output streaming: real-time output capture for long-running processes.
- Buffer management: clear output buffers to reduce memory usage.
Installation and usage The project description mentions that installation can be done via an installation script. Codex stores MCP configuration in ~/.codex/config.toml; the installer uses codex mcp add and safely replaces an existing console-automation registration; after installation, Codex must be restarted, and the connection verified using /mcp. For other MCP clients, a new JSON configuration can be generated without overwriting existing files. The npm package has not yet been published, so npx console-automation-mcp and @mcp/console-automation are not valid installation paths.
Security considerations This server can execute arbitrary commands and open remote SSH sessions, and should be treated as a privileged terminal rather than a low-risk documentation connector: keep MCP tool approval enabled for command/session changes; prefer SSH keys or environment variable credential references over inline secrets; use a restricted deployment account together with a separate production approval step;Unless diagnostics are explicitly needed, keep MCP_DEBUG_LOG and MCP_LOG_DIR unset; unless metadata recovery is explicitly needed, keep session persistence disabled; install cloud, container, and serial integrations only when needed. console_save_profile rejects inline passwords, private key material, and passphrases; instead use passwordEnvVar, privateKeyEnvVar or privateKeyPath, and passphraseEnvVar. Profile listing responses do not return credential values, and configuration files are created with owner-only permissions on operating systems that support POSIX modes. Session persistence is disabled by default because recovery data may contain commands, paths, and environment values; to enable it, set MCP_SESSION_PERSISTENCE=true, with the default file being ~/.console-automation-mcp/sessions.json, which can be overridden via MCP_SESSION_PERSISTENCE_PATH; persisted command/environment recovery data remains disabled unless enabled through programmatic SessionManager configuration. The production installer removes development and optional protocol packages, while local console and SSH remain available; install the corresponding peer packages only when optional adapters such as Docker, cloud, Kubernetes, or serial are needed.
Available tools (40 total) Divided into 6 categories, including: session and input/output category (console_create_session, console_send_input, console_send_key, console_get_output, console_get_stream, console_wait_for_output, console_stop_session, console_list_sessions, console_cleanup_sessions, console_execute_command, console_detect_errors, console_get_resource_usage, console_clear_output, console_get_session_state, console_get_command_history); monitoring category (console_get_system_metrics, console_get_session_metrics, console_get_alerts, console_get_monitoring_dashboard, console_start_monitoring, console_stop_monitoring); profile category (console_save_profile, console_list_profiles, console_remove_profile, console_use_profile); background job category (console_execute_async, console_get_job_status, console_get_job_output, console_cancel_job, console_list_jobs, console_get_job_progress, console_get_job_result, console_get_job_metrics, console_cleanup_jobs); assertion and snapshot category (console_assert_output, console_assert_exit_code, console_assert_no_errors, console_save_snapshot, console_compare_snapshots, console_assert_state).
Error detection modes Built-in detection of common error types: general errors (error:, ERROR:, Error:), exceptions (Exception:, exception), warnings (Warning:, WARNING:), failed operations, permission/access denied, stack traces (Python, Java, Node.js), compilation errors, connection errors.
Technology stack and runtime requirements Uses Node.js child processes and ssh2 to implement local command execution and SSH sessions, @modelcontextprotocol/sdk to implement the MCP protocol, TypeScript to provide type safety, and Winston for structured logging. Core components include ConsoleManager, ErrorDetector, MCP Server and session management. Requires Node.js >= 18.0.0, supports Windows, macOS, Linux; optional serial port integration may require platform build tools.
Use cases Suitable for scenarios such as automated console operations driven by AI, automation of executing interactive CLI tools, testing that verifies command output and exit codes, running long-running background commands and monitoring them, and operations monitoring across local and remote SSH.
Limitations and notes
- This server has the ability to execute arbitrary commands, carries high security risks, and requires strict approval and credential management.
- Some applications may write directly to the terminal and bypass stdout, causing output not to be captured; some commands require TTY interaction.
- You need to ensure the server has permission to start child processes, otherwise you may encounter permission denied errors.
- Regarding the specific installation script names, more runtime details, and examples, the materials do not provide them completely; you can refer to the project documentation directory.
- The project uses the MIT license.