DEV Community

Zw-awa
Zw-awa

Posted on • Edited on

I Got Tired of Splitting My Brain Between Local AI and Remote SSH, So I Built ssh-session-mcp

The missing piece between local AI coding and remote SSH work is not another command runner.

It is a shared runtime.

Project site:

https://zw-awa.github.io/ssh-session-mcp

ssh-session-mcp shared terminal demo

Most AI coding workflows already work well on local code. The model can inspect a repository, modify files, explain a failure, and suggest the next step. Then the moment the real environment lives on a board, a Linux box, a test host, or a GPU server, the workflow often collapses back into manual relay: switch to SSH, run the command yourself, inspect the output yourself, and carry the result back to the model.

The usual response is to ask for better remote execution.

I think that is the wrong abstraction.

A remote terminal is stateful. It may be at a prompt, inside less, waiting for a password, sitting in an editor, or still occupied by a long-running command. So the real problem is not just whether the model can send a command. It is whether the model and the user are operating around the same terminal state.

That is the core of ssh-session-mcp.

It keeps one persistent SSH PTY alive, exposes it through MCP tools, and lets the human observe or take over through a browser viewer for that exact same session.

Not a second session.

Not a lookalike shell.

The same PTY.

Once that is the model, the rest follows naturally: lock behavior because humans and models can collide, safer execution modes because not every terminal state should accept blind input, and history plus diagnostics because a shared runtime cannot be a black box.

The main loop stays intentionally simple:

ssh-quick-connect -> ssh-run -> inspect -> ssh-command-status if async -> ssh-run
Enter fullscreen mode Exit fullscreen mode

That is what I wanted: not a bigger SSH abstraction, but a runtime layer that keeps remote work inside the same collaboration loop as local AI coding.

If this direction resonates with you, start with the project site:

https://zw-awa.github.io/ssh-session-mcp

If you find it useful, a free GitHub star helps. And if you try it in a real environment, I would much rather get a concrete issue than a vague compliment, especially if it includes the machine, terminal state, and handoff point where the workflow broke down.

GitHub:

https://github.com/Zw-awa/ssh-session-mcp

Top comments (0)