SSH Session MCP logo

SSH Session MCP

Shared SSH PTY sessions for AI and human operators, with terminal viewing, command tracking, policies, and session controls.

Install SSH Session MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "ssh-session-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "ssh-session-mcp"
      ],
      "env": {
        "SSH_HOST": "YOUR_VALUE_HERE",
        "SSH_PORT": "YOUR_VALUE_HERE",
        "SSH_USER": "YOUR_VALUE_HERE",
        "SSH_PASSWORD": "YOUR_VALUE_HERE",
        "SSH_KEY": "YOUR_VALUE_HERE",
        "VIEWER_PORT": "YOUR_VALUE_HERE",
        "AUTO_OPEN_TERMINAL": "YOUR_VALUE_HERE",
        "SSH_MCP_MODE": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y ssh-session-mcp

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

SSH Session MCP MCP server provides a persistent shared SSH PTY runtime for MCP clients, allowing an AI agent and a human operator to use the same terminal session. It exposes tools for connecting to devices, running and monitoring commands, reading terminal history, sending input, resizing PTYs, and managing session policies. A local browser viewer, input locking, asynchronous command tracking, and safe or full execution modes support collaborative remote work. Reach for it when stateless SSH command execution is insufficient, especially for long-running development, embedded, ROS, training, or deployment tasks.

Use cases

  • Operate remote Linux development hosts with an AI assistant
  • Monitor long-running deployment or build commands
  • Share an SSH terminal between a human and an AI agent
  • Inspect and control embedded or ROS devices
  • Test agent terminal workflows in local mode

Key features

  • Persistent shared SSH PTY sessions
  • Browser terminal viewer with input locking
  • Asynchronous command tracking and retries
  • Multi-device profiles and active-session management
  • Session-level execution policy rules
  • Terminal output, history, control, and resize tools

Tools23

What SSH Session MCP lets your agent do. Expand a tool for its parameters.

Self-reported~334 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

24/28 checks healthy over the last 111d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 11d ago via OSV.dev · ssh-session-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars4Stargazers on the source repository.
npm downloads317Package downloads in the last 30 days.
Last commit5mo agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Tools exposed23Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How SSH Session MCP works

What SSH Session MCP MCP server does

SSH Session MCP MCP server manages persistent terminal sessions over SSH rather than treating every command as an isolated request. An MCP client can connect to a configured device, reuse the active target, execute commands, inspect their progress, and interact with the remote PTY. The human operator can view the same session through a local browser terminal and intervene when needed.

The runtime supports a default target as well as named device profiles. It can also start in local mode, which provides a local shell for demonstrations, offline testing, and prompt development without connecting to an SSH host.

How it works

The server maintains tracked SSH sessions and buffers terminal output for later reading. Commands can be run with completion detection and exit-code capture, while asynchronous operations can be polled or watched for output and dashboard changes. Retry support adds backoff for commands that fail intermittently.

Human and agent input share the PTY. An input lock is available to prevent the agent from typing over a person, and diagnostic tools expose lock state, warnings, command status, and viewer health. Session controls cover raw input, control keys such as ctrl_c, terminal resizing, active-session selection, clean closure, and line-numbered history.

The SSH Session MCP MCP server also applies execution policy. It can inherit configured defaults, add or update rules for an individual session, remove custom rules, or reset a session to inherited defaults. Safe and full operation modes are part of the runtime configuration.

Setup and configuration

For MCP clients, the documented installation path is npx -y ssh-session-mcp --viewerPort=auto. A global npm installation is also supported with npm install -g ssh-session-mcp. The server communicates through stdio; Claude Code and Codex examples are provided in the project documentation.

A simple target can be configured with environment variables such as SSH_HOST, SSH_PORT, SSH_USER, SSH_PASSWORD, or SSH_KEY. The viewer can be configured with VIEWER_PORT, and SSH_MCP_MODE selects the operation mode. For several devices, use ssh-session-mcp.config.json with a default device, device IDs, connection details, authentication references, terminal dimensions, and viewer defaults.

Configuration discovery checks an explicitly supplied path, the workspace configuration, a user-global configuration, and then the legacy .env fallback. Passwords should be supplied through an environment variable or a key path rather than stored directly in tracked JSON. Docker images and Compose examples are also documented for pinned or container-based deployments.

Tools and capabilities

The exposed tools cover:

  • Connecting, opening, listing, selecting, inspecting, and closing SSH sessions.
  • Running commands, checking asynchronous progress, retrying commands, and reading buffered output.
  • Watching output changes, reading mixed terminal history, sending PTY input, control keys, and resize events.
  • Listing configured devices and viewer processes, then opening or reusing the local viewer.
  • Inspecting, adding, removing, and resetting session-level policy rules.
  • Diagnosing locks, warnings, running commands, and viewer health.

Limitations and notes

The project requires Node.js 18 or newer. Configuration lookup depends on the MCP process working directory, so a configuration file may not be found if the client launches the process elsewhere. The server is designed around SSH targets and terminal sessions; local mode is provided as a separate testing and demonstration path.

Authentication secrets should remain in the parent environment or .env files rather than repository-tracked configuration. Docker deployments that expose the viewer need corresponding port and host configuration. The SSH Session MCP MCP server includes client setup examples for Claude Code and Codex, while other MCP clients require their own stdio registration format.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about SSH Session MCP

SSH Session MCP is an MCP server that connects AI clients to persistent SSH or local PTY sessions. Its main tools open and manage sessions, run commands, track asynchronous progress, read terminal output and history, send input and control keys, resize terminals, apply session policies, and expose a browser viewer for shared human-agent work.

Install it with `npx -y ssh-session-mcp --viewerPort=auto` in the MCP client command. You can also run `npm install -g ssh-session-mcp` and register `ssh-session-mcp --viewerPort=auto` as a stdio server. The documentation includes setup commands for Claude Code and Codex.

Configure a target with environment variables such as `SSH_HOST`, `SSH_PORT`, `SSH_USER`, `SSH_PASSWORD`, or `SSH_KEY`, then launch the server. For multiple devices, create `ssh-session-mcp.config.json` with device profiles and authentication references. Keep secrets in the environment or `.env`, not tracked JSON.

Yes. `ssh-run` detects completion and captures exit codes, while `ssh-command-status` polls asynchronous progress and `ssh-session-watch` waits for output or dashboard changes. `ssh-retry` can rerun flaky commands with backoff.

Yes. `ssh-viewer-ensure` opens or reuses the local browser viewer, and `ssh-viewer-list` reports tracked viewer processes. The viewer shows the shared PTY so a human can inspect or intervene while the AI uses the same session.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewSSH Session MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/ssh-session-mcp?style=directory)](https://allmcps.com/mcp/ssh-session-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/ssh-session-mcp"><img src="https://allmcps.com/api/badge/ssh-session-mcp?style=directory" alt="SSH Session MCP on AllMCPs" /></a>