presence-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@presence-mcpgrep for TODO in /srv/app on server and show me the matches"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Presence
Your SSH hosts, as local tabs.
Persistent remote workspaces, native file editing, search, exec, terminals and port forwards for coding agents — with nothing installed on the remote host.
English · 简体中文 · Releases · MCP server

Why
Running an agent on every remote machine means installing it N times, upgrading it N
times and configuring proxies per host. Running ssh host '<command>' from the local
agent means a new handshake per command, no native file tools and no continuity.
Presence keeps the agent local and extends its reach through one persistent SSH
connection per host. The remote side is still plain sshd: SFTP, exec and a PTY.
Approach | Cost |
Install the agent on every host | N installs, N upgrades, per-host proxying |
| Handshake per command, no file tools, no sessions |
Presence | One connection per host, native tools, nothing installed remotely |
Related MCP server: 2native-ssh-mcp
Features
Remote zero-install — uses only
sshdbuilt-ins: the SFTP subsystem, exec channels and a PTY.One handshake — a pool keeps one connection per host; every later call is a request on it.
Native remote tools —
rg/grepruns on the target, commands run in the target shell; path, permission and encoding semantics are the remote ones.Local-like edits — atomic writes, mode preservation, ambiguity refusal, read-before-write guard,
presence_editwith dry-run diffs.Real workspaces — a remote directory becomes a normal DSH workspace with a file tree and terminals that open on the remote machine.
Recoverable deletes — destructive shell commands dry-run first;
presence_trashmoves paths to a remote trash with restore.Two shells, one kernel — the DSH plugin and a standalone MCP server (
presence-mcp, 20 tools) share the same kernel.
Quick start
1. Install the DSH plugin
dsh plugin add @rjfan/dsh-presence@0.17.6From a source checkout:
dsh plugin add /path/to/dsh-presence2. Pick a host and open a workspace
Open Settings → Presence → New, choose a host from ~/.ssh/config (or paste a
manual ssh command), then pick a remote folder. It appears as a workspace; the
left sidebar, file tree, terminal and agent tools all use that remote directory.
3. Work
You: 把远程 8000 端口转发到本地,然后打开看看
Agent: presence_forward { remotePort: 8000 }
→ http://127.0.0.1:8000MCP server
The same kernel is available to agents that cannot install DSH plugins (Codex CLI, Claude Code, OpenCode, Cursor, …).
npx -y presence-mcp # 20 tools over stdio// Claude Desktop / OpenCode style
{
"mcpServers": {
"presence": {
"command": "npx",
"args": ["-y", "presence-mcp"],
"env": {
"PRESENCE_HOST": "server",
"PRESENCE_WORKSPACE": "server:/srv/app"
}
}
}
}See mcp/README.md for Codex TOML, Claude Code, OpenCode and Cursor/Windsurf examples.
How it works
┌───────────────────────────────┐
│ DSH plugin / MCP server │ two shells, one kernel
└──────────────┬────────────────┘
│
Presence kernel
├── ssh-config hosts, ports, users, keys, jumps from ~/.ssh/config
├── connection one persistent connection: SFTP / exec / PTY + pool + cancel
└── host pool one connection per host, created on demand, idle-collected
│
SSH (your existing keys, known_hosts, jumps, proxies)
│
target: Linux / macOS, stock sshdAgent operation | Channel | Remote dependency |
read / write / edit / list / stat | SFTP subsystem |
|
exec, search ( | exec channel | commands already on the host |
interactive terminal | shell channel + PTY | the host's login shell |
Measured on a Linux host:
Operation | Latency |
| 520–540 ms |
Presence connect (one handshake, key auth) | 145 ms |
Presence | p50 0.6 ms / p95 0.9 ms |
Presence | p50 7.6 ms |
8 concurrent exec channels | 15 ms total |
Keep TCP_NODELAY on: without it, request/response hits delayed ACK and p95 goes from 0.9 ms to 48 ms.
Tools
The DSH plugin exposes 18 tools. Relative paths resolve against the active remote
workspace; host is optional inside a workspace.
Tool | What it does |
| List SSH hosts, connection state and default host ( |
| Open/reuse a host connection and report the remote identity. |
| Run a remote command; |
| Manage background jobs: |
| Read a remote file with line numbers, |
| Read 1–50 remote files in one call, with per-file byte/line caps. |
| Atomic write; preserves mode; returns real mode, size and full sha256; |
| Exact-text replacement or line-range replacement, with compact diff, |
| List a directory; |
| Batch |
| Remote |
| Find remote files by glob with size/mtime. |
| Local → remote binary-safe upload with mode and sha256. |
| Remote → local real file (content-addressed), for preview or native apps. |
| Forward a remote port to |
| Check listeners and TCP reachability for up to 20 ports; `expect:open |
| Wait for port → forward → local HTTP assertions → close → verify the local port was released. |
| Persistent PTY: |
| Recoverable delete: move to remote trash, list/restore; batch |
Safety and recovery
Destructive commands never run unconfirmed.
rm -r/-f,git clean -fdx,find -delete,shred,truncateanddd of=are first replayed with no-op shims to expand their real targets; unset variables and protected paths (workspace root, home,/,.git) are refused. A second call withconfirm:trueis required to execute.Prefer
presence_trashfor anything under a workspace: it moves the path to~/.dsh/presence-trash/<timestamp>/and returns a restore hint.Writes are atomic and keep the original file mode;
presence_editrefuses ambiguous anchors instead of guessing.Read before write: built-in
read/write/editshare a read-before-write guard;presence_writerecords the observation so both APIs can be mixed.
Configuration
The plugin reads these environment variables on the host process:
Variable | Default | Meaning |
| — | Default SSH host (alias from |
| — |
|
| — | Password for a host; |
| 8 | Concurrent channels per connection. |
| 25000 | Connection attempt timeout. |
| 900000 | Idle connection timeout (connections with terminals are kept). |
| false | Refuse writes/edits; reads, search and exec still work. |
Full configuration and the path/permission matrix are in docs/VERIFICATION.md and docs/HANDOFF.md.
Development
npm install
npm install --prefix .dev --ignore-scripts rollup @rollup/plugin-node-resolve \
@rollup/plugin-commonjs @rollup/plugin-terser codemirror @codemirror/language-data \
@codemirror/theme-one-dark
node scripts/build-client.mjs
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/package.ps1 -Version 0.17.6
# → dist/presence-plugin-0.17.6.zipTests require one SSH-reachable host:
node scripts/regression.mjs server # transport, symlinks, timeouts, binary
node scripts/job-probe.mjs server # jobs + port forwarding
node scripts/feature-probe.mjs server # wait, sessions, pgid, readiness, search
node scripts/import-probe.mjs server # local→remote binary, mode, sha256
node scripts/safety-probe.mjs server # destructive guard + observation storeKnown limits
The mount path (
~/.dsh/presence/mounts/...) is virtual: it works throughctx.fs/ agent tools, but native apps (Explorer, Office, host Python) cannot see it — usepresence_exportfirst.SSH
MaxSessions(default 10) bounds concurrent channels; the pool uses at most 8.PTY terminals follow the connection; cross-reconnect shells need
tmuxon the target (used automatically bypresence_terminal { session }).ProxyJump/ProxyCommand are parsed and warned about, but not used for dialing yet.
Contributing
Issues and PRs are welcome. For a feature, open an issue describing the remote
workflow you want; for a fix, keep the diff focused and add a probe under
scripts/ when behavior changes.
License
Star History

This server cannot be deployed
Maintenance
Related MCP Connectors
Work on your own computers from Claude or ChatGPT: run commands, edit and search files.
Remote shell and detached long-running jobs on your own machines — no SSH, open ports or VPN.
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 agent-style remote development over SSH with file operations and command execution, exposing native tools for searching, editing, and transferring files on remote machines.2MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to remotely execute shell commands and transfer files on SSH hosts, including jump-host tunneling, background tasks, resumable transfers, and optional approval of destructive commands, while SSH credentials remain in the local process. It runs over stdio or a streamable HTTP daemon and supports auditing, allow/deny lists, and multiple authentication methods.ISC
- AlicenseAqualityBmaintenanceEnables AI assistants to run shell commands, read, write, edit, search, and stream files on remote SSH servers and Docker containers, including nested multi-layer chains, without installing any runtime on the target hosts. It auto-injects a self-contained Go helper with adaptive zstd compression for fast transfers and process control.9MIT
- AlicenseAqualityCmaintenanceEnables AI coding tools to read, write, search, and list files on remote machines and run commands there, including background long-running jobs and TTY-based interaction, all through a single persistent SSH connection. Bypasses the cost of establishing a new SSH session on every call, cutting typical multi-step remote operations from seconds to milliseconds.12MIT