Skip to content
Skillpedia
● Free and open sourceπŸ’» LocalπŸ”“ No API keyCloud and servers

SSH MCP Server

Lets your AI agent run commands and transfer files on remote servers over SSH, with policy checks, approvals and an audit log.

856 stars on GitHubby tufantuncLicense MITUpdated 18 days ago

How to install

This MCP is local: it runs on your computer.

It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Code…). Choose your app:

Paste in the terminal:

claude mcp add ssh -- npx -y ssh-mcp

What to fill in

NameWhat it isRequired
SSH_MCP_PASSWORDPassword for the configured profile; a per-profile SSH_MCP_<PROFILE>_PASSWORD takes precedence. Credentials are never accepted as CLI arguments.No
SSH_MCP_KEYPath to the private key file to authenticate with β€” the path, not the key material. A per-profile SSH_MCP_<PROFILE>_KEY takes precedence.No
SSH_MCP_PASSPHRASEPassphrase for an encrypted private key.No
SSH_MCP_SUDO_PASSWORDPassword the sudo tool escalates with, when the policy in force allows the privileged class.No

Ready! Now test it

Restart the app and paste one of these requests in the chat:

Check the disk usage on the dev server.
Tail the application log on the deploy host and tell me about errors.

What it is

SSH MCP gives an AI agent controlled SSH access to remote hosts. Before running a command it classifies it, checks it against a role and host policy, asks a human to approve risky work and records the decision in an audit log. The readme warns that this reduces but does not remove the risk of giving an AI shell access.

What it can do

  • list-connections: see available hosts and status
  • read-command: run allowlisted read-only commands
  • run-command: run commands, with approval for destructive ones
  • privileged-command: run with sudo, after approval
  • open-session and read-session-output: stateful or background sessions
  • sftp-upload, sftp-download, sftp-list: move files with SFTP
  • sftp-upload-file and sftp-download-file: stream large files without passing them through the model
  • signal-process: send INT, TERM or KILL to a process

When to use

  • β€ΊWhen you want your agent to check logs or disk space on a Linux server
  • β€ΊWhen you want a human to approve destructive commands before they run
  • β€ΊWhen you want an audit record of everything the agent did on a host

What you need

Node.js to install (npm install -g ssh-mcp) and a config.toml listing your hosts and profiles. Use a key or SSH agent, and set passwords by environment variable, never as command arguments.

Skills that pair well

⭐ Skillpedia MCP Β· freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free β†’

Frequently asked questions

Is it free and open source?

Yes. It has a license badge and is published on npm.

Is it safe?

It is built to be careful, but the readme says prompt injection has no general fix. Never point it at a root account and never use auto approval on a production profile.

What happens without a config?

The server starts but refuses every tool call until you write config.toml, except reload-config.

Does it work on Windows?

It can target Windows hosts and runs on Windows with config checks, but the file-streaming transfer tools are not available there.

Where is the config file?

On Linux at ~/.config/ssh-mcp/config.toml, on macOS in ~/Library/Application Support/ssh-mcp, on Windows in %APPDATA%\ssh-mcp.

Can the agent upload big files?

Yes with sftp-upload-file, but only after you set defaults.transferRoot, which turns the transfer tools on.

If it does not work

  • β€ΊIf every tool call is refused, create the config.toml at the path for your platform and call reload-config or restart.
  • β€ΊOn Linux and macOS run chmod 700 on the config folder and chmod 600 on the file, or the server will not start.
  • β€ΊUse an SSH agent or key rather than passing passwords on the command line.

5 new skills a week. 1 minute to read.