SuperAPIAI Directory

ssh-mcp-server

github.com · AI developer platforms

Remote server work via the local OpenSSH client: run commands, transfer files with checksums, search logs and audit hosts, with destructive commands blocked.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux · API

About this tool

ssh-mcp-server is an SSH MCP server that provides AI agents with remote server operation tools, and the author uses OpenSSH to accomplish remote command execution, file transfer, log searching, and server auditing. Its positioning is to save time and tokens in debugging, development, and server maintenance.

Main capabilities and features:

  • Reuses the local OpenSSH client: uses the keys you already have, ~/.ssh/config, jump hosts, and agent forwarding, without bundling an SSH implementation, without compilation, and without native bindings; when supported, each target shares a multiplexed connection, authenticating once rather than once per command.
  • Compatible with modern and legacy devices: modern servers, older routers, NAS, and more can all be used. Automatically falls back for old protocols (for example, when modern scp is rejected, it switches to the old protocol and remembers that machine); when modern features are missing, it takes the legacy path.
  • Oriented toward the MCP ecosystem: based on the official MCP SDK, fully in TypeScript, with 2500+ unit tests and an actual environment test suite running against real containers. Compatible with MCP clients such as Claude Code, Codex CLI, Cline, opencode, Gemini CLI, Qwen Code, Hermes, and others.
  • Differences from bare SSH: a raw shell gives the agent a large amount of noisy output (repeated commands, ASCII tables, log dumps), consuming tokens; dedicated tools batch routine checks, limit noisy output, and return the key parts, reducing token costs, reducing agent guesswork and hallucinations, and improving repair accuracy. In an example, a real troubleshooting session reduced 49 separate command calls to 4 MCP calls; ssh_audit_baseline can batch-check the system, disk, memory, ports, sshd, failed units, Docker, firewall, and updates at once, with results marked as CRITICAL / WARNING / OK, and parts that were not measured are clearly stated rather than defaulted to zero.

Usage and installation:

  • No global installation is required; npx downloads the package on first use. Add it to an MCP client (such as Claude Code), and it can be configured per project; you can also write the configuration by hand, and most clients share the same server configuration shape.
  • You need to create ~/.claude/ssh-profiles.json, containing at least one machine to connect. Codex, opencFor client configurations such as ode and Qwen Code, see the project documentation.
  • It can also be installed as a plugin: some clients (such as Claude Code) can use it entirely as a plugin, and the plugin reads ~/.claude/ssh-profiles.json (unless SSH_PROFILES_FILE specifies another file), so this file must be created first.
  • Runtime requirements: Node.js 18+, with the system ssh client in PATH. On Windows, use key-based configuration; password and passphrase configuration are currently not supported.
  • If you need a pinned version, want to work offline, or want to reduce registry checks on every startup, you can run npm install -g @hypnosis/ssh-mcp-server, then use ssh-mcp-server as the command instead of npx.

Main tools (18 SSH MCP tools in total; see docs/tools.md for full parameters):

  • Run SSH commands and manage remote files: commands, file reads and writes, directory listings, with each result parsed.
  • Monitor long-running SSH tasks: slow tasks are detached and tracked, and each check reports progress; task status is stored on the remote disk, can distinguish running / finished / lost, supports continuing to read output from the last byte offset, and can send signals to the entire process group.
  • Search logs and check server health: supports file and container log searches, obtaining a full machine overview in one pass; output is limited to avoid the log tail filling up the context.
  • Upload and download files via SSH: binary-safe transfer and integrity verification; binaries and large files should use ssh_upload / ssh_download, while base64 chunking and heredoc are not binary-safe or atomic.
  • Secure editing of remote configurations: with a verified result, which may be verified, unavailable (the server has no hashing tool), or skipped (verification was not requested); reads can use ssh_file_read to accept a path list, and ssh_file_list supports wildcards, recursion, size, and permissions.
  • Batch commands with sudo: each command has independent stdout and stderr; if it runs but produces no output, it is an empty string, and if it does not run, that field is absent; when a single command's output exceeds 128 KB, the head and tail are kept and the truncation position and clippe are marked in the middle.d_bytes, split on byte boundaries and fall back to character boundaries to avoid replacement characters. The sudo password is passed via standard input, from the configured sudoPassword or password; commands that read their own standard input will not receive the password.
  • Destructive command protection: the guard runs locally, before the command reaches SSH, distinguishes recoverable operations from operations that destroy data containers, and checks the order in chained and batch commands. Wrong order (such as deleting a directory before backing it up) will be intercepted; docker compose down -v, recursive deletion of the filesystem root/home/system directories (including where symlinks point), and unresolved targets (such as rm -rf "$DIR"/*) are all rejected; cases where the command line is matched by pattern will be rewritten or executed by number. Three outcomes remain distinct: target found, expansion with no result, and unable to ask; the latter two are also rejections. Reviewed commands can be allowed through with # CONFIRMED-DESTRUCTIVE; if one item in a batch is rejected, the whole batch stops. This guard only works within a single invocation, cannot correlate deletion and reading across invocations, and does not understand unknown tools; it is a seatbelt, not a policy engine. For path restrictions and quoting rules, see docs/security.md.

MCP tool safety annotations: standard MCP annotations tell clients whether a tool is read-only, destructive, idempotent, or open-world; see the documentation for the full table.

Who it is for: DevOps and SREs who want faster auditing, incident inspection, and daily server operations; independent developers who use AI assistants for development and run on their own servers; system administrators and platform engineers who want structured tools rather than an unrestricted bare shell; developers and small teams without a dedicated operations team who run their own VPS; users with still-usable older hardware (homelab, NAS, routers).

Limitations and notes: requires Node.js 18+ and a system ssh client; Windows only supports key-based configuration; the destructive command guard does not span invocations and does not recognize unknown tools; some older devices lacking hashing tools will return unavailable rather than passing verification; the material does not provide specific fees, prices, or platform information.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools