# mcp-console-automation

Lets an agent drive local consoles and SSH sessions: run commands, send input, read output, spot errors. Useful when terminal work needs automating.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 53
- Author: ooples
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ooples/mcp-console-automation
- Updated: 2026-10-21
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-console-automation

## What it does

The server opens up to 50 console sessions at once, covering local shells such as `bash`, `zsh` and `pwsh` plus remote SSH connections. An agent can type text and special keys (Enter, Tab, Ctrl+C), watch output as it arrives, filter it with regex, or search several patterns together. Long jobs run in the background through a priority queue and can be cancelled or paused.

Test tooling is built in: assertions that output contains a value, matches a regex or equals an expected string, exit-code checks, and session snapshots taken before and after an operation. There is also monitoring for CPU, memory, disk and network, alerts for errors and anomalies, and saved profiles for SSH, Docker, WSL and cloud platforms.

Treat this as a privileged terminal rather than a safe documentation connector, because it runs arbitrary commands and opens remote sessions. Keep MCP tool approvals on, use SSH keys or environment-variable references instead of inline secrets, and leave `MCP_DEBUG_LOG` and `MCP_LOG_DIR` unset unless you actually need diagnostics. Session persistence ships disabled, since recovery data can hold commands, paths and environment values. `console_save_profile` refuses inline passwords, private-key material and passphrases — pass `passwordEnvVar`, `privateKeyEnvVar`, `privateKeyPath` or `passphraseEnvVar` instead.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `LOG_LEVEL` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env LOG_LEVEL=<LOG_LEVEL> --transport stdio mcp-console-automation -- npx -y mcp-console-automation
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add mcp-console-automation --env LOG_LEVEL=<LOG_LEVEL> -- npx -y mcp-console-automation
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp-console-automation": {
            "command": "npx",
            "args": [
                "-y",
                "mcp-console-automation"
            ],
            "env": {
                "LOG_LEVEL": "<LOG_LEVEL>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp-console-automation": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "mcp-console-automation"
            ],
            "env": {
                "LOG_LEVEL": "<LOG_LEVEL>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e LOG_LEVEL=<LOG_LEVEL> mcp-console-automation npx -y mcp-console-automation
```
Replace <…> with your own values

## When to use it
- run a command in a local shell and pull its output
- reach a remote host over SSH and execute commands there
- catch an error or stack trace in a long-running process
- assert on exit codes and output content in a test
- read CPU and memory metrics for one session

## Example prompts
- Run `npm run build` in a new console session and show me the last 50 lines
- Connect with the `prod-web` profile and check that `nginx` is still running
- Start the migrations in the background and watch the output until `done` appears

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
