Menager MCP Server
Provides durable remote terminal sessions by wrapping SSH sessions in tmux, probing for tmux availability, re-attaching to existing tmux windows by session id, and cleaning up remote tmux sessions on close or shutdown.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Menager MCP Server
MCP server: hela-ribosome · Version: 3.1.2 · Canonical tools: 28. Current tool reference.
Part of the HeLa MCP Ecosystem — This server is HeLa Ribosome (
hela-ribosome) — the PTY Harness component of the HeLa cellular architecture. See the ecosystem docs for profiles, workflows, and multi-client setup.

menager is a TypeScript-based Model Context Protocol (MCP) server designed for inter-session terminal orchestration. It enables an AI agent session (or human operator) to act as a master control plane capable of spawning, monitoring, driving, and hooking into child terminal harnesses (CLI tools, secondary AI agents, interactive shells, or polyglot runtimes) via standard POSIX pseudo-terminals (pty).
Table of Contents
Related MCP server: pty-mcp
Features
Polyglot Harness Multiplexing: Drive interactive processes written in any language via standard POSIX pseudo-terminals.
Simulated Human Typing: Inject text, control sequences (
SIGINT, EOF, Ctrl+C), and raw keystrokes seamlessly into childstdin.Predictable Event Interception: Provide non-blocking regex hooks with timeout guarantees and optional immediate auto-responses.
Memory-Bounded Observability: Maintain dedicated circular buffers per session (default 5,000 lines) with real-time ANSI-stripping for token-efficient LLM context consumption.
Rendered Screen Reads: Optionally render each session through a headless terminal emulator, so a full-screen TUI, a redrawing progress bar, or any cursor-addressed output can be read as the frame a human would see instead of a stream of escape sequences.
Durable Remote Sessions: Run a session over SSH and, where the host has tmux, keep the remote work alive across a dropped link — then re-attach to the same window by session id.
Strict Asynchrony & Resource Discipline: Event handling remains purely event-driven using Node.js event emitters and promises; buffer bounds are strictly enforced to prevent memory leaks.
Installation
Manual Installation
# Clone the repository
git clone <your-repo-url>
cd menager
# Install dependencies (requires build-essential/g++ for node-pty native bindings)
npm install
# The rendered screen (session_read mode: "screen") uses @xterm/headless, declared as an
# optional dependency and imported lazily. Installing with --omit=optional is supported:
# screen reads then report rendered:false and fall back to the strip-ansi line buffer.
# Build the project
npm run buildUsage
Starting the Server
The server runs via Stdio transport, intended to be executed directly by MCP clients.
# Start the server (standard mode)
npm start
# Or run the built file directly
node build/index.jsAvailable Tools
Generic PTY
session_spawn
Spawns a new child PTY session, locally or over SSH — or re-attaches to a tracked one.
command(string): Target binary or executable (e.g.,bash,python3). Required for local sessions, ignored whenhostis set.sessionId(string): Use this id instead of a generated one. If the id is already tracked by this server, the call is an idempotent re-attach and every other argument is ignored (see below).persistOnClose(boolean): SSH + tmux only. Leave the remote tmux window running when the session is closed or the server shuts down (defaultfalse).args(string[]): Command line arguments.cwd(string): Working directory path.env(object): Additional environment variables.maxBufferLines(number): Rolling line limit for memory buffers (default 5000).terminalType(string): Terminal emulation type ("dumb"or"xterm-256color", default"xterm-256color").name(string): Optional logical name/label for the session.cols(number): Terminal columns (default 80).rows(number): Terminal rows (default 24).host(string):[user@]hostname. Switches the session to the SSH transport (see below).remoteCommand(string[]): Argv to run on the remote host. Requireshost; omit it for an interactive login shell.
SSH transport
With host set, the session runs the system ssh binary inside the same local PTY, so ~/.ssh/config, ProxyJump, agent forwarding, and hardware keys all apply unchanged. The argv is built, never concatenated into a shell string:
ssh -t -o ServerAliveInterval=15 -o ServerAliveCountMax=3 -o ConnectTimeout=10 <host> [remoteCommand...]hostmust match^[A-Za-z0-9._-]+(@[A-Za-z0-9._-]+)?$and may not begin with-. Anything else — spaces,=,--oProxyCommand=…— is rejected before the PTY is created. Tool input can never add-ooptions.HELA_RIBOSOME_SSH_HOSTSis an optional comma-separated exact-match allowlist on thehostargument as supplied (build-01does not matchuser@build-01). Unset means any validated host is allowed; set-but-empty allows none.session_inforeportstransport: "ssh"andhost. On exit it also reportsexitKind:"transport"for ssh's own failure code 255 (connection, auth, protocol),"remote"for anything the remote shell returned. Local sessions reporttransport: "local"and noexitKind.
Remote durability (tmux)
A bare SSH PTY dies with its transport and takes the remote work with it. When the host has tmux, the remote side is wrapped instead — once per host, the server probes tmux -V over a non-interactive SSH call and caches the answer:
ssh -t … <host> tmux -u set-option -g history-limit <n> \; new-session -A -s hela_<sessionId>-Amakes the attach idempotent: it creates the window or joins the existing one. A dropped link leaves the remote process running inside tmux.Hosts without tmux fall back to a plain login shell, and
session_inforecords it:tmux: { "enabled": false, "name": "hela_…", "reason": "tmux unavailable on <host>: …" }. Such a session is not durable.Re-attach with
session_spawn({ sessionId })on a tracked id. A live session is re-attached in place (same pid); a dead transport is replaced with a fresh one running the same argv, which lands back in the same tmux window. Either way the rendered viewport is reset, the local line buffer (scrollback) is kept, and a[reconnected at <iso>]marker is injected into the stream.session_inforeportsreconnects.session_closesendstmux kill-session -t hela_<sessionId>unlesspersistOnClosewas set, and server shutdown does the same for every live session — so neither leaves a remote session behind.HELA_RIBOSOME_TMUX=offskips the probe and the wrapper entirely;HELA_RIBOSOME_TMUX_HISTORY_LIMIT(default10000) sets the remote scrollback.
All of this is argv. No remote command is ever assembled as a shell string locally.
session_wait
Blocks and waits for a session to exit gracefully, returning its final exit code.
sessionId(string): Target session ID. Required.timeoutMs(number): Optional timeout in milliseconds.
session_write
Injects keystrokes, commands, or escape sequences into the session's standard input.
sessionId(string): Target session ID. Required.payload(string): String or control character sequence. Required.pressEnter(boolean): Append a carriage return (\r, what a terminal's Enter key sends) to the payload (default false - Breaking Change in v4).pressKey(string): Special key injection (Ctrl+C,Ctrl+D,Enter,Tab,Escape,ArrowUp,ArrowDown).
session_read
Reads buffered output from the target session: the line buffer, or the rendered screen.
sessionId(string): Target session ID. Required.mode(string):"lines"(default) or"screen". An unknown value is a typed{"error": …}.tailLines(number): Number of trailing lines to retrieve (default 100).stripAnsi(boolean): Return sanitized text without ANSI codes (default true). (lines mode)clearBuffer(boolean): Flush internal buffers after read (default false). (lines mode)offsetLines(number): Read lines starting from this absolute index offset (replaces tailLines). (lines mode)grepPattern(string): Pre-filter buffer lines via Regex string matching. (lines mode)includeScrollback(boolean): Include rows that have scrolled off the viewport (default false). Screen mode only — passing it withmode: "lines"is a typed error.settleMs(number): Wait up to this long for the output stream to go quiet before snapshotting. Screen mode only. Immediate by default.
Rendered screen (mode: "screen")
mode: "lines" is unchanged and returns plain text. mode: "screen" feeds the same onData stream through a headless terminal emulator (@xterm/headless, an optional dependency imported lazily) and returns JSON:
{
"mode": "screen",
"rendered": true,
"settled": true,
"includeScrollback": false,
"cols": 80, "rows": 24,
"cursor": { "x": 5, "y": 3 },
"scrollbackLines": 142,
"text": "…one line per terminal row, trailing blank rows trimmed…"
}Use it for anything that paints:
htop,vim, an installer's progress bar, a redrawing spinner.abc\rXYis"abc\rXY"tostrip-ansiandXYcon a screen.settled: falsemeans the cap expired while output was still arriving — the frame is a mid-flight snapshot, not a final one.rendered: falsemeans no screen was available (HELA_RIBOSOME_SCREEN=off, or the optional dependency is not installed).reasonsays which, andtextis then exactly the strip-ansi line buffer, so the call never fails over this.The raw buffer is always kept: hooks and exact-byte reads (
stripAnsi: false) are unaffected by the renderer.
session_hook
Awaits a specific regex pattern on the session stream with optional automated reply.
sessionId(string): Target session ID. Required.pattern(string): Regular expression string to observe. Required.timeoutMs(number): Milliseconds before timing out (default 30000).autoResponse(string): Optional string to immediately write on match.triggerPayload(string): Write payload after hook registers (prevents concurrency deadlock).
session_resize
Resizes the target PTY terminal dimensions.
sessionId(string): Target session ID. Required.cols(number): Terminal columns. Required.rows(number): Terminal rows. Required.
session_signal
Sends a POSIX signal to the target session (with recursive process-tree termination).
sessionId(string): Target session ID. Required.signal(string): Signal to deliver (SIGINT,SIGTERM,SIGKILL). Required.
On an SSH session, SIGINT is translated: the server writes \x03 into the PTY so the remote line discipline raises the interrupt. Killing the local ssh client would deliver nothing to the remote process. SIGTERM and SIGKILL still tear down the local transport only — ⚠️ a remote process can survive SIGTERM on the SSH transport. With tmux it deliberately does: the window stays, and session_spawn({sessionId}) re-attaches to it. Use session_close to end the remote session for good. Local sessions are unchanged: every signal goes to the process tree.
session_close
Force kills the interactive PTY session's process tree and deletes memory buffers immediately. On an SSH session backed by tmux it also kills the remote window, and reports that as tmux: {attempted, ok, detail}.
sessionId(string): Target session ID. Required.persistOnClose(boolean): Keep the remote tmux window alive so a latersession_spawn({sessionId})can re-attach to it. Overrides what was set at spawn time.
session_prune
Force deletes sessions to free memory.
status(string): Only delete sessions with this status ("running"or"exited"). Defaults to"exited".
session_info
Returns a single session's live metadata and metrics: sessionId, name, pid, command, args, status, exitCode, createdAt, ttlMs (the resolved and clamped TTL), transport, host/exitKind/tmux {enabled, name, reason}/persistOnClose (SSH only), reconnects, screen {enabled, state, cols, rows}, and meta.
sessionId(string): Target session ID. Required.
session_list
Lists all active and completed interactive PTY sessions managed by the server. No parameters required.
OpenCode Native Orchestration
Native opencode CLI integration (see CLI docs) for agent routing and multi-session orchestration. Each spawned agent lives in its own PTY session with meta.kind: "agent" tracking (agent, model, dir, resolved opencode session id).
Tool | Maps to | Purpose |
|
| Spawn an agent run in a managed PTY; returns |
| PTY write, or | Follow-up message to a live or exited agent. |
|
| Branch a session into a new tracked session. |
| menager tracking + | List routed agents merged with native sessions. |
| session metadata + resolved opencode id + output preview | Inspect one agent. |
| close PTY, optionally | Teardown with |
|
| CLI health, defined agents, tracked counts. |
|
| Define new agents for later |
|
| Model discovery for |
|
| Usage/cost observability. |
|
| Session portability. |
|
| Standalone native delete. |
|
| MCP connection health. |
|
| Provider auth names (read-only, no secrets). |
|
| Direct db inspection. |
|
| Warm server for |
Deliberately excluded: tui (interactive), auth login/logout (interactive secrets), upgrade/uninstall (host-destructive), github/plugin/pr (repo admin — run directly).
Set a custom binary via OPENCODE_BIN env (default opencode). Prompts are capped at 8000 chars; agent/model values are strictly validated (agent alphanumerics, model as provider/model); all subprocesses spawn with shell: false (no shell injection).
HeLa session quotas & run linkage (P0-B4, all opt-in overrides)
Variable | Default | Meaning |
|
| Max live sessions; |
|
| Idle TTL for new sessions |
|
| TTL is clamped to this ceiling |
|
| Session output buffer cap |
| (unset) | Comma-separated exact-match allowlist for |
|
| SSH binary for the remote transport (bare name or absolute path); for pinning a path or a test harness |
| (unset = on) |
|
| (unset = on) |
|
|
| Remote tmux scrollback ( |
|
| How long a per-host tmux capability probe is cached |
|
| Timeout for the |
| (unset) | Comma-separated names of variables a spawned session may inherit from the server. Unset inherits everything (today's behaviour); set-but-empty inherits nothing. Per-session |
| (unset) | Test-only: |
⚠️ HELA_RIBOSOME_ENV_ALLOWLIST is a blunt instrument: a child that needs PATH, HOME or TERM will not find them unless you list them.
Server shutdown (SIGINT/SIGTERM) now awaits PTY termination: every live session gets SIGTERM, then SIGKILL, within a ~2 s bounded deadline before the process exits. Sessions still alive at the deadline are logged by id. SSH sessions backed by tmux have their remote window killed first (unless persistOnClose), so shutdown leaves nothing running on the remote host.
session_spawn/agent_spawn accept optional run_id/step_id linking the session to a Mitosis RunStore run; the ids are also inherited from HELA_RUN_ID/HELA_STEP_ID env and propagated to child processes. linkRun attaches a run id to an existing session.
Configuring with AI Assistants
Configuring with Roo Code or Cline
Open the MCP settings file (usually
cline_mcp_settings.jsonorconfig.json).Add the following configuration for standard stdio mode:
{
"mcpServers": {
"menager-mcp": {
"command": "node",
"args": ["/path/to/menager-mcp/build/index.js"],
"env": {}
}
}
}Configuring with Claude Desktop
Open
claude_desktop_config.json.Add the following configuration:
{
"mcpServers": {
"menager-mcp": {
"command": "node",
"args": ["/path/to/menager-mcp/build/index.js"],
"env": {}
}
}
}Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Hosted runtime for persistent agent teams, durable workflows, memory, schedules, and goals.
Persistent cloud workspaces for AI agents: run commands, edit files, use git and a browser.
Securely control computers you explicitly pair through files, terminals, processes, screenshots, desktop UI/input, clipboard, browser automation, diagnostics, and document tools.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with terminal environments through multiple concurrent PTY sessions. Supports cross-platform terminal operations including command execution, session management, and real-time communication.2MIT
- FlicenseAqualityDmaintenanceEnables AI agents to start and manage pseudo-terminal sessions, run shell commands and interact with REPLs programmatically.7-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to interact with interactive CLI processes via a real PTY, allowing them to send keystrokes, read screen output, and handle interactive prompts.9 npm1MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to drive real interactive terminal sessions—PTYs, TUIs, REPLs, SSH, even another agent's CLI—with a live web view where humans can watch and type in.5 npm2MIT