
SSH MCP Server (classfang): Setup for Claude Code, Cursor and Other Apps
Lets Claude, Cursor and other assistants run commands and transfer files on your servers over SSH.
SSH MCP Server lets your assistant log in to your own servers and run shell commands, read and write files, and move files in both directions. It runs on your computer and keeps your SSH password or key there, so the assistant never sees it. It is a community server by classfang. Without a command whitelist it can run anything the SSH account can, so limit both the commands and the account.
Good for
- Developers who want an assistant to check logs, disks and services on a server
- Ops teams who deploy or restart things on remote machines
- People who reach servers through a jump host or SOCKS proxy
Works in
12 should work
Tap an app to see how to set it up and any known problems.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Client does not support this transport.
Client does not support this transport.
Install SSH MCP
Claude Code
- 1
Copy this prompt.
Add the SSH MCP server to Claude Code. Run this command: claude mcp add ssh -- npx -y @fangjunjie/ssh-mcp-server --host 192.168.1.1 --port 22 --username alice --privateKey '~/.ssh/id_rsa' Then check that it loaded and tell me if I need to sign in or restart.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js, An SSH server you can reach.
Read-only mode: Not built in. Use --whitelist with read-only commands such as ls, cat and df; this stops chained commands, but upload, download, read-file and write-file still reach the server unless you also set --allowed-remote-paths.
Replace the host, username and credentials with your own. Passwords in this config sit in plain text, so prefer --privateKey with a key file (the README also shows --agent and reading hosts from ~/.ssh/config). Add --whitelist with regular expressions to limit which commands run, and --allowed-remote-paths to limit which remote folders upload and download can touch (the README strongly recommends both). Each argument and its value must be separate list items. Adapted from the mcp.json example in the project README; the README covers password, key, SSH agent, SOCKS proxy, jump host and multi-server setups.
Built from the package data we hold. Not yet tested by us.
Tools
Runs a shell command on your SSH server
Runs the command you give it on the remote server and returns the output. A non-zero exit code comes back as text after the output, not as an error. Without a whitelist, any command is allowed.
Try: “Run df -h on the dev server and tell me which disk is fullest.”
Delete ·
execute-commandCopies a local file or folder to the server
Sends a local file, or a whole folder (up to 2000 files, symlinks skipped), to a path on the remote server. Existing files there can be replaced.
Try: “Upload ./dist to /var/www/app on the staging server.”
Write ·
uploadCopies a file or folder from the server to your machine
Pulls a remote file or folder (up to 2000 files, symlinks skipped) down to a local path you name.
Try: “Download /var/log/app.log from prod to ./logs.”
Files ·
downloadReads a text file on the server
Reads a remote text file over SFTP in chunks of 64 KB by default and names the next offset so long files can be paged. It refuses binary files.
Try: “Show me the first part of /etc/nginx/nginx.conf on the web server.”
Network ·
read-fileWrites text to a file on the server
Writes text to a remote file over SFTP, replacing it or appending to it. It avoids shell quoting problems for multi-line content.
Try: “Create /etc/myapp/config.yml on the dev server with these settings.”
Write ·
write-fileLists the SSH servers you configured
Shows the SSH connection names set up for this server, so the assistant can pick one with the connection name.
Try: “Which servers can you connect to?”
Read ·
list-serversStarts a long command in the background
Starts a command on the remote server in the background and returns a job id right away. It goes through the same whitelist and blacklist as execute-command.
Try: “Start the build script on the build server and keep going.”
Delete ·
job-startChecks a background job
Reads the output and exit code of a job started with job-start.
Try: “What is the status of that build job?”
Network ·
job-statusStops a background job
Stops a running job (SIGTERM, then SIGKILL after 5 seconds), including its child processes.
Try: “Stop the build job, it is stuck.”
Runs code ·
job-killLists recent background jobs
Lists recent jobs on the server with their state. Finished jobs are pruned after 7 days.
Try: “List the jobs I have running on the build server.”
Network ·
job-list
Read from the source code
Permissions
high risk · 5 things to watch
High risk
It can run any command and overwrite any file that the SSH account can, and it has no read-only mode. Use a low-privilege account, a command whitelist and an allowed-paths list, and keep it away from production.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It can run any command on your server
execute-command and job-start run whatever the assistant sends, with the rights of the SSH account. That includes deleting files and stopping services. Use a low-privilege account and a --whitelist. github.com
It can overwrite files on the server
write-file replaces or appends to any file the account can write, and upload can replace existing files. Without --allowed-remote-paths the server accepts any remote path and prints a startup warning. github.com
Passwords sit in plain text in your config
The password option puts your SSH password in the MCP config file. Use a private key or the SSH agent instead. github.com
Whitelists block chaining but are easy to get wrong
With a whitelist on, commands with ;, &, |, redirects or substitutions are rejected, and patterns must match the whole command. A loose pattern still allows too much, so test it. github.com
Pages or files can steer the assistant into SSH
The README warns that prompt injection can drive reads or writes of files such as authorized_keys. Do not point the assistant at untrusted content while connected to production. github.com
Security advisories
No published security advisories as of Nov 1, 2026.
Technical details
| Turning on read-only | No read-only switch. --whitelist limits commands to regular-expression patterns you choose; --allowed-remote-paths limits upload, download, read-file and write-file folders. |
|---|---|
| Talks to | The SSH servers you configure (and a SOCKS or HTTP proxy if you set one) |
| Sign-in and keys | SSH password, private key path or agent socket are passed as command-line arguments in your MCP config or read from an SSH config file. They stay on your computer. |
Questions
Is the SSH MCP server by classfang official?
No. It is a community project by classfang, not made by the SSH or OpenSSH projects. It is published on npm as @fangjunjie/ssh-mcp-server.
Does the assistant see my SSH password?
The README says the credentials are managed locally and are not exposed to the AI model. They are still stored as plain text in your MCP config if you use a password, so a key or the SSH agent is safer.
Can I make it read-only?
Not with a switch. You can set a command whitelist (for example only ls, cat and df) and a list of allowed remote paths. For the file tools (read-file, write-file, upload, download), the README points to the allowed-remote-paths option.
Can it connect through a jump host or proxy?
Yes. The README documents a SOCKS proxy option, a shell transport mode for bastion hosts, and several named connections chosen at call time.
Does it run commands for a long time?
Yes, through background jobs. job-start returns a job id, job-status shows output and exit code, and job-kill stops the job.
Is it free?
Yes. It is open source under the ISC license on npm and runs on your machine.
How do I add it to Claude?
Use the Claude Code or Claude Desktop tab in the install box above and fill in your own host and key path before running it.
Information
updated Nov 2, 2026
- Publisher
- Community
- Package
@fangjunjie/ssh-mcp-server- Registry
- npm
- Transport
- stdio
- Version
- 1.10.0
- License
- ISC
- Last commit
- Oct 15, 2026
- Open issues
- 7
Sources
Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.
Show all 6Hide
- github.com · github.com
- www.npmjs.com · npmjs.com
- github.com · github.com
- github.com · github.com
- github.com · github.com
- github.com · github.com