dsh-ssh-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
dsh-ssh-mcp
Persistent SSH sessions for DeepSeek Harness, exposed as MCP tools. The agent opens one connection per host and keeps using it, instead of authenticating again for every command.
SSH automation usually fails in three places, and this plugin is built around them:
Re-authentication on every command. Opening a fresh
sshper command is slow and noisy.openstarts one persistent session;execreuses it, keeping the working directory and exported environment.fail2ban. A retry loop against a protected host gets the address banned for hours. The plugin counts failed connection attempts per
host:portand stops after one retry.sudo under root. Many minimal images have no sudo at all, and for a root login it fails otherwise valid commands. The plugin detects
uid 0and refuses to use sudo in a root session.
Features
One persistent
ssh -Tsession per host, with per-command exit codes and output framing.Credential profiles in a JSON file: host, non-standard port, user, key file, fail2ban policy.
Agent-based or explicit key authentication; password authentication is deliberately unsupported (no TTY, no one to answer the prompt).
Root detection:
is_rootcomes back fromopen, andsudois rejected in a root session.Confirmation gate for
sudoand for destructive commands (rm -rf /,mkfs,dd of=/dev/...,reboot, package removal,DROP DATABASE, …).Error classification with an actionable hint:
auth_failed,connection_refused,network_unreachable,dns_failed,host_key_rejected,connect_halted, pluslocal_path_missing,path_missing,spawn_failedandtransfer_timeout.put/getfor file transfer over scp, with local paths resolved against the workspace.Server instructions carry the safety rules into the system prompt; an optional skill adds the full playbook.
Related MCP server: fast-mcp-ssh
Requirements
DeepSeek Harness with MCP client support (
@deepseek-ai/dsh-mcp-client).OpenSSH client (
ssh,scp) available onPATH. Windows 10/11 ships it;Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0enables it.A remote host with a POSIX
sh. Windows remotes are not supported.No system Node.js install is needed: the MCP server runs on the same binary as the Harness, switched into Node mode.
Install
Plugin Manager (Desktop)
Settings → Plugins → install from a package spec, and enter:
github:extreme-russian-dsh-fandom/dsh-ssh-mcpCommand line
dsh plugin --profile <profile> add github:extreme-russian-dsh-fandom/dsh-ssh-mcpPin a revision when you need reproducibility:
dsh plugin --profile <profile> add github:extreme-russian-dsh-fandom/dsh-ssh-mcp#v1.1.0github: is pnpm's GitHub shorthand, not a DSH-specific scheme: dsh plugin
forwards the argument to pnpm, and the Plugin Manager checks the repository with
git ls-remote before running pnpm add.
After activation the tools appear as mcp__ssh__<tool>.
Tools
Tool | What it does |
| Lists credential profiles with host, port, user, auth mode, fail2ban policy. Never returns secrets. Call this first. |
| Opens one persistent session. Returns |
| Runs a command in the session; returns exit code, stdout and stderr. Optional |
| Lists open sessions with profile, user, root status and age. |
| Closes a session and releases the connection. |
| Copies a local file or directory to the host with scp. |
| Copies a remote file or directory into the workspace with scp. |
put and get resolve a relative local_path against the server's working
directory (the workspace at launch), not against the remote session's working
directory. The parent directory of the destination must already exist, and scp
expands neither ~ nor shell variables; pass absolute paths when in doubt.
Both tools overwrite an existing destination file, so check the destination
path before copying.
Tool annotations
Every tool declares a human-readable title and all four MCP annotations with
explicit boolean values:
Tool |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exec is destructive because it runs an arbitrary command, not because every
command it runs is destructive. put and get are destructive because scp
overwrites the destination without a prompt. The hints let hosts warn the user
before a call; the safety model still enforces confirmations on
its own.
Credentials
The server reads ~/.dsh/ssh-credentials.json (override with --credentials,
SSH_MCP_CREDENTIALS, or a ssh-credentials.json in the working directory).
The file is created by the user; the plugin never writes it.
{
"defaults": {
"port": 22,
"user": "root",
"fail2ban": "unknown",
"strictHostKey": "accept-new",
"connectTimeoutMs": 15000
},
"hosts": {
"prod-web": {
"host": "203.0.113.10",
"port": 22222,
"user": "deploy",
"auth": "agent",
"fail2ban": "present",
"description": "sshd on a non-standard port; the agent holds the key"
},
"prod-db": {
"host": "db.internal.example",
"port": 4242,
"user": "root",
"auth": "key",
"identityFile": "C:\\Users\\me\\.ssh\\id_ed25519",
"fail2ban": "present",
"sudo": "none"
}
}
}A complete example lives in
examples/ssh-credentials.example.json.
Field | Values | Meaning |
| string | Address or DNS name. Required. |
| 1–65535 | sshd port; high ports are normal for hardened hosts. |
| string | Login user. Defaults to the |
|
|
|
| path | Private key for |
|
| Attempt budget: 2 by default, 3 only when explicitly |
|
| Whether passwordless sudo is expected on this host. |
|
|
|
| 1000–120000 | TCP/auth timeout for one attempt. |
Keep the file private (chmod 600 on POSIX). It must never be committed; the
repository .gitignore already excludes it.
Password authentication is not supported: the MCP server has no terminal, so
ssh cannot answer a password prompt. Install the public key on the remote host
or use an ssh-agent. A profile that declares passwordFile fails with
password_auth_unsupported on purpose.
Safety model
Rule | Behaviour |
fail2ban awareness | Failed connections are counted per |
Root sessions |
|
Confirmations |
|
Secrets | The credentials file path is the only thing the model sees; it never receives key material or passwords. |
Server instructions embed these rules in the system prompt, so they apply even without the skill.
Optional skill
The plugin ships a ready playbook at
skill/remote-ssh/SKILL.md. Copy it to your skills
directory for the full troubleshooting guide:
mkdir -p ~/.dsh/skills/remote-ssh
cp skill/remote-ssh/SKILL.md ~/.dsh/skills/remote-ssh/Configuration
Variable | Purpose |
| Absolute path to |
| Binary used to run the server. Defaults to the running Harness binary. |
| Per-call timeout for MCP tools. Defaults to 600000. |
| Alternative credentials file path. |
Troubleshooting
Symptom | Cause and fix |
No | The MCP server failed to start. Check that |
| Create |
| The remote host does not accept the key. Add the public key to |
| The attempt budget for this host is spent. Fix connectivity, then restart the harness process. The hint names the failure code that consumed it. |
| One side of a |
|
|
| Passwordless sudo is not configured. Add a |
| The host key changed. Verify the host and update |
Uninstall
dsh plugin --profile <profile> remove dsh-ssh-mcpDevelopment
The package has no runtime or development dependencies. The suite uses
--test-isolation=none, so it needs Node.js 22.8 or newer:
npm testserver/test/tools.test.mjs covers each of the seven tools,
tools.metadata.test.mjs guards the annotations, rpc.test.mjs covers the
JSON-RPC envelope, and index.test.mjs performs a real stdio handshake when the
environment allows spawning a child process. CI runs the suite on Node.js 22 and
24.
License
MIT. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Scoped, audited SSH exec, sessions, and SFTP on your saved servers without exposing credentials
Manage remote servers, SSH terminals, files, databases and proxies with scoped access and approvals.
Work on your own computers from Claude or ChatGPT: run commands, edit and search files.
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to execute SSH commands, read files, and list directories on remote hosts with a configurable command-safety policy.5MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to securely execute commands on remote hosts via SSH and SFTP, with persistent shells, file transfers, screenshots, and an audit log.5MIT
- AlicenseAqualityCmaintenanceEnables AI agents to establish and manage persistent SSH sessions, supporting smart command execution, async tasks, multi-host, sudo, and file operations through SFTP.1565 PyPIMIT
- FlicenseNot gradedqualityCmaintenanceEnables executing shell commands and transferring files on remote machines over SSH/SFTP, including persistent interactive sessions that can handle prompts such as sudo and package manager confirmations.-