ssh ssh-session-mcp
v2.8.0
FAQ问答

Questions users actually ask before they install or trust the runtime.这是用户在安装前、接入前、信任运行时前,真正会问的问题。

The homepage keeps a short summary, but this page gathers the common questions in one place so you can skim them quickly.首页只放了简短摘要,这一页把常见问题集中在一起,方便你快速扫一遍。

Focus聚焦
Install questions, shared PTY behavior, viewer value, input lock, async jobs, and environment choices.安装问题、共享 PTY 行为、viewer 价值、输入锁、异步任务和环境选择。
Best For适合
Getting direct answers before or after setup.无论是在安装前还是安装后,想快速拿到直接答案。
Read Next接着看
Pair this page with install for setup and use cases for workflow context.接下来可以配合安装页看接入步骤,或配合场景页看工作流背景。
ssh session mcp faq shared pty faq browser ssh terminal faq input lock faq
Questions问题

Search-friendly answers, one topic per card.可搜索、可扫描,一卡一个问题。

This page keeps the answers short and direct so you can get unstuck quickly, then keep going if needed.这里的答案都会尽量短而直接,方便你先把问题解决,再决定下一步往哪看。

What is the difference between SSH Session MCP and a normal SSH wrapper?SSH Session MCP 和普通 SSH 包装层有什么区别?

A normal wrapper executes one command at a time. SSH Session MCP preserves a shared PTY, so the user and AI agent see the same terminal state, prompts, history, and long-running process lifecycle.普通包装层通常一次执行一条命令。SSH Session MCP 会保留共享 PTY,让用户和 AI Agent 看到同一份终端状态、提示符、历史和长任务生命周期。

How do I install SSH Session MCP for Codex, Claude Code, Cline, or OpenCode?如何给 Codex、Claude Code、Cline 或 OpenCode 安装 SSH Session MCP?

Use `npx -y ssh-session-mcp --viewerPort=auto` as the default install path, then register that command in the MCP client. Client-specific examples are collected in the install guide and `llms-install.md`.默认安装路径是 `npx -y ssh-session-mcp --viewerPort=auto`,然后把这条命令注册到对应的 MCP client。客户端示例可以在安装指南和 `llms-install.md` 里找到。

Why does a browser terminal viewer matter?为什么浏览器 terminal viewer 值得要?

Because the human can inspect prompts, manually intervene, and confirm what the AI is doing on the same terminal instead of guessing from disconnected command outputs.因为人可以直接看到提示符、手工介入、确认 AI 在做什么,而不是只能从断开的命令输出里猜测。

What does input lock solve?输入锁解决了什么问题?

It prevents the AI and the human from typing over each other in the same terminal. That is important when a shell becomes interactive, risky, or stateful.它防止 AI 和人同时往同一个终端里乱打字。这在 shell 进入交互态、高风险态或强状态依赖时尤其重要。

When should I use Docker instead of npx?什么时候该用 Docker 而不是 npx?

Use Docker when you need a pinned runtime, image-based distribution, or a fixed mapped viewer port. For normal desktop setup, `npx -y ssh-session-mcp --viewerPort=auto` is still the lower-friction default.当你需要固定运行时、镜像分发或稳定的 viewer 映射端口时,用 Docker。对普通桌面端接入来说,`npx -y ssh-session-mcp --viewerPort=auto` 仍是摩擦更小的默认方案。

What should Windows users do if stdio launch fails?如果 Windows 上的 stdio 启动失败该怎么办?

Use `cmd /c npx -y ssh-session-mcp --viewerPort=auto` as the fallback. Some MCP clients spawn stdio commands differently on native Windows.用 `cmd /c npx -y ssh-session-mcp --viewerPort=auto` 作为回退方案。部分 MCP client 在原生 Windows 上拉起 stdio 命令的方式并不一样。

More Questions更多问题

A few more things people often wonder about.再补几件大家经常会追问的事。

These usually show up after the basic setup is already clear.这些问题通常会出现在你已经弄清基本接入方式之后。

Why would I want a shared PTY instead of isolated command calls?为什么我要共享 PTY,而不是隔离的单次命令调用?

Because remote shell state, prompts, editors, pagers, and long-running commands often matter across steps. A shared PTY preserves that context instead of forcing every turn to pretend it starts from zero.因为远程 shell 状态、提示符、编辑器、分页器和长任务经常会跨步骤持续存在。共享 PTY 能保住这些上下文,而不是让每一步都假装从零开始。

Why not just keep sending `ssh-run` when a terminal blocks?当终端阻塞时,为什么不能一直继续发 `ssh-run`?

Because the terminal may be inside a pager, editor, or password prompt. In those states, diagnostics, history, or control inputs are safer than blindly sending another command string.因为终端可能已经进了分页器、编辑器或密码提示。在这些状态里,诊断、历史查看或控制输入会比盲发下一条命令更安全。

Why does input lock matter for AI-assisted SSH work?为什么 AI 辅助 SSH 工作需要输入锁?

It stops the AI from typing over the human during interactive or risky shell moments, which is a common failure mode when both sides share one remote terminal.它能阻止 AI 在交互态或高风险时刻覆盖人的输入,而这正是共享同一远程终端时最常见的失败模式之一。

Why does the viewer matter if I already have terminal output?如果我已经能拿到终端输出,为什么还需要 viewer?

Because terminal output alone does not give the human a live, interruptible window into prompts, shell state, or operator takeover. The browser viewer does.因为单纯的终端输出并不能给人一个可实时旁观、可中断、可接管的窗口去看提示符和 shell 状态,而浏览器 viewer 可以。

Next下一步

If one answer leads to the next question, start here.如果一个答案又引出了下一个问题,从这里继续。

Install keeps the commands together, resources keeps the links together, and use cases adds context.安装页集中命令,资源页集中链接,场景页补背景。