ssh ssh-session-mcp
v2.8.0
Install Guide安装指南

Install SSH Session MCP for the MCP client you already use.给你已经在用的 MCP client 安装 SSH Session MCP。

This page puts setup first: Cline, Claude Code, Codex, OpenCode, `npx -y ssh-session-mcp`, Docker, and Windows notes all live here.这个页面把安装放在第一位:Cline、Claude Code、Codex、OpenCode、`npx -y ssh-session-mcp`、Docker 和 Windows 注意事项都集中在这里。

Primary Command主命令
npx -y ssh-session-mcp --viewerPort=autonpx -y ssh-session-mcp --viewerPort=auto
Windows VariantWindows 变体
cmd /c npx -y ssh-session-mcp --viewerPort=autocmd /c npx -y ssh-session-mcp --viewerPort=auto
Docker PathDocker 路径
For pinned runtime, fixed port publishing, or image-first distribution.适合固定运行时、固定端口发布或镜像优先分发。
mcp ssh install codex ssh mcp claude code ssh mcp shared ssh mcp npx ssh-session-mcp docker ssh mcp
Client-Specific Setup按客户端安装

Use the command shape that matches the MCP client.按 MCP client 使用对应的命令形状。

Use the command shape that matches the client you already have open.直接选和你当前 MCP client 对应的那条命令就行。

Cline / Roo JSON configCline / Roo JSON 配置
{
  "mcpServers": {
    "ssh-session-mcp": {
      "command": "npx",
      "args": ["-y", "ssh-session-mcp", "--viewerPort=auto"],
      "disabled": false,
      "autoApprove": []
    }
  }
}
Claude CodeClaude Code
claude mcp add --transport stdio ssh-session-mcp -- npx -y ssh-session-mcp --viewerPort=auto
Codex CLICodex CLI
codex mcp add ssh-session-mcp -- npx -y ssh-session-mcp --viewerPort=auto
OpenCode local commandOpenCode 本地命令
npx -y ssh-session-mcp --viewerPort=auto
Install Paths安装路径

Pick the lightest path that matches the operator and environment.按操作者和环境选择最轻的路径。

This page keeps the setup paths explicit so you can copy the right one quickly.这里把安装路径写得很直接,方便你快速复制正确的那一条。

npx installnpx 安装
npx -y ssh-session-mcp --viewerPort=auto
Global npm install全局 npm 安装
npm install -g ssh-session-mcp
ssh-session-mcp --viewerPort=auto
Docker installDocker 安装
docker run --rm -i -p 8793:8793 -e VIEWER_PORT=8793 -e VIEWER_HOST=0.0.0.0 docker.io/zwawa/ssh-session-mcp:latest
Use `--viewerPort=auto` for local installs so the browser viewer is available without hand-picking a port. Use a fixed published port in Docker when you need predictable host mapping.本地安装优先使用 `--viewerPort=auto`,这样浏览器 viewer 不需要手工选端口。Docker 场景如果需要稳定宿主机映射,就用固定端口。
Windows And Runtime NotesWindows 与运行时说明

On Windows, `cmd /c npx` is the safe fallback for stdio launchers.在 Windows 上,`cmd /c npx` 是更稳妥的 stdio 回退方案。

If Windows stdio launch feels flaky, keep the `cmd /c` fallback in mind.如果 Windows 上的 stdio 拉起不稳定,记住 `cmd /c` 这个回退方案就够了。

Windows fallbackWindows 回退命令

Use this when a client fails to spawn `npx` directly as a stdio command.当客户端不能直接把 `npx` 作为 stdio 命令拉起时,用这个回退。

cmd /c npx -y ssh-session-mcp --viewerPort=auto

Runtime config运行时配置

Use `.env` for one target and `ssh-session-mcp.config.json` for multi-device setups. Keep secrets in environment variables.单目标用 `.env`,多设备用 `ssh-session-mcp.config.json`,secret 保持在环境变量里。

SSH_MCP_CONFIG=/path/to/ssh-session-mcp.config.json
Setup Questions安装问题

Short answers for the setup details people ask most.把大家最常问的安装细节快速答清楚。

Use these when you already know you want the project and just need the exact setup path.如果你已经确定要用它,只差一条准确的安装路径,就从这里看。

How do I add SSH Session MCP to Codex CLI?怎么把 SSH Session MCP 加到 Codex CLI?

Use `codex mcp add ssh-session-mcp -- npx -y ssh-session-mcp --viewerPort=auto` if you want the lowest-friction install path.如果你要最低摩擦的接入路径,就用 `codex mcp add ssh-session-mcp -- npx -y ssh-session-mcp --viewerPort=auto`。

How do I install it for Claude Code on Windows?怎么在 Windows 上给 Claude Code 安装?

Use `claude mcp add --transport stdio ssh-session-mcp -- cmd /c npx -y ssh-session-mcp --viewerPort=auto` when native Windows stdio launch needs the `cmd /c` fallback.当原生 Windows 的 stdio 拉起需要 `cmd /c` 回退时,使用 `claude mcp add --transport stdio ssh-session-mcp -- cmd /c npx -y ssh-session-mcp --viewerPort=auto`。

Should I use Docker or npx for SSH Session MCP?SSH Session MCP 应该用 Docker 还是 npx?

Use `npx -y ssh-session-mcp --viewerPort=auto` by default. Switch to Docker only when you need a pinned runtime, image-based distribution, or a fixed published viewer port.默认优先用 `npx -y ssh-session-mcp --viewerPort=auto`。只有在你需要固定运行时、镜像分发或固定的 viewer 映射端口时,再切到 Docker。

What is the fastest no-SSH demo path?最快的无 SSH 演示路径是什么?

Use `ssh-session-mcp-ctl launch --local --viewerPort=auto` to demo the browser viewer and shared runtime model without touching a real SSH target.用 `ssh-session-mcp-ctl launch --local --viewerPort=auto`,在不接触真实 SSH 目标的情况下演示浏览器 viewer 和共享运行时模型。

Next下一步

After setup, you will probably want one of these.装好以后,下一步大多会看这几页。

From here, the next step is usually links, answers, or examples.从这里继续,下一步通常就是去看链接、答案或例子。