{"_id":"@bingzi-233/ssh-mcp","_rev":"7-4b3d90e0748c65cae04692f0e5f5dedd","name":"@bingzi-233/ssh-mcp","dist-tags":{"latest":"1.5.1"},"versions":{"1.0.0":{"name":"@bingzi-233/ssh-mcp","version":"1.0.0","keywords":["mcp","model-context-protocol","ssh","sftp","remote","file-transfer","claude"],"author":{"name":"BingZi-233"},"license":"MIT","_id":"@bingzi-233/ssh-mcp@1.0.0","maintainers":[{"name":"bingzi-233","email":"lhby233@outlook.com"}],"homepage":"https://github.com/BingZi-233/ssh-mcp#readme","bugs":{"url":"https://github.com/BingZi-233/ssh-mcp/issues"},"bin":{"ssh-mcp":"dist/index.js"},"dist":{"shasum":"1013c63ea0821ae4f42c41f768e723156b840d8a","tarball":"https://registry.npmjs.org/@bingzi-233/ssh-mcp/-/ssh-mcp-1.0.0.tgz","fileCount":7,"integrity":"sha512-dkHpS21dYtFr7FxmBEXIQCD1ZVQGlYNJjnTx2Rw0NI//Y/XWorU5AgIwqLxK26nCRB3m1PkL1MEjFpnGbNF2vg==","signatures":[{"sig":"MEUCIQCgwUx7oPk8aHwQ4wwlFBP0iLOdx9Th1ty7Ql1F8zTB7gIgQcBjpeyIUGpjOItzTi0b4T5qn7jDwmFPqAE6HT88sPY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bingzi-233%2fssh-mcp@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":29821},"type":"module","engines":{"node":">=18"},"gitHead":"66b02a4ecf777440a8cb28b28847aadb39dd9d81","scripts":{"dev":"tsc --watch","build":"tsc","start":"node dist/index.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"bingzi-233","email":"lhby233@outlook.com"},"repository":{"url":"git+https://github.com/BingZi-233/ssh-mcp.git","type":"git"},"_npmVersion":"10.8.2","description":"通过 SSH/SFTP 让 AI 在多台远程服务器上执行命令并传输大文件（支持断点续传）的 MCP 服务器","directories":{},"_nodeVersion":"20.20.2","dependencies":{"zod":"^3.23.8","ssh2":"^1.16.0","@modelcontextprotocol/sdk":"^1.12.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0","@types/ssh2":"^1.15.0"},"_npmOperationalInternal":{"tmp":"tmp/ssh-mcp_1.0.0_1781231229238_0.7791520693526028","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bingzi-233/ssh-mcp","version":"1.0.1","keywords":["mcp","model-context-protocol","ssh","sftp","remote","file-transfer","claude"],"author":{"name":"BingZi-233"},"license":"MIT","_id":"@bingzi-233/ssh-mcp@1.0.1","maintainers":[{"name":"bingzi-233","email":"lhby233@outlook.com"}],"homepage":"https://github.com/BingZi-233/ssh-mcp#readme","bugs":{"url":"https://github.com/BingZi-233/ssh-mcp/issues"},"bin":{"ssh-mcp":"dist/index.js"},"dist":{"shasum":"fa26b3be8ade7dfa6b03be79f2680aacd624c0b3","tarball":"https://registry.npmjs.org/@bingzi-233/ssh-mcp/-/ssh-mcp-1.0.1.tgz","fileCount":7,"integrity":"sha512-4PBExOH6L8Zh+3DHKtd1itu0pyoRYSwHmGR6r+XmGOSiycOKsFFCj+HQTAkrbDpjiv88eKBZ3i/RgSnJ2qI05g==","signatures":[{"sig":"MEUCIQD26nt9M3/3lU5tSZLFsEupgRGEgxDbdCWEzyHLjSWRHQIgIWXyzLRMV0OXfO8LZNCtCHtTwBjMrjkD2lBhaVxkmWk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bingzi-233%2fssh-mcp@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":29947},"type":"module","engines":{"node":">=18"},"gitHead":"67f988b6df1d3425e92142d2bb583a270c01b468","scripts":{"dev":"tsc --watch","build":"tsc","start":"node dist/index.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"bingzi-233","email":"lhby233@outlook.com"},"repository":{"url":"git+https://github.com/BingZi-233/ssh-mcp.git","type":"git"},"_npmVersion":"10.8.2","description":"通过 SSH/SFTP 让 AI 在多台远程服务器上执行命令并传输大文件（支持断点续传）的 MCP 服务器","directories":{},"_nodeVersion":"20.20.2","dependencies":{"zod":"^3.23.8","ssh2":"^1.16.0","@modelcontextprotocol/sdk":"^1.12.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0","@types/ssh2":"^1.15.0"},"_npmOperationalInternal":{"tmp":"tmp/ssh-mcp_1.0.1_1781231569139_0.1967412802007893","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@bingzi-233/ssh-mcp","version":"1.2.0","keywords":["mcp","model-context-protocol","ssh","sftp","remote","file-transfer","claude"],"author":{"name":"BingZi-233"},"license":"MIT","_id":"@bingzi-233/ssh-mcp@1.2.0","maintainers":[{"name":"bingzi-233","email":"lhby233@outlook.com"}],"homepage":"https://github.com/BingZi-233/ssh-mcp#readme","bugs":{"url":"https://github.com/BingZi-233/ssh-mcp/issues"},"bin":{"ssh-mcp":"dist/index.js"},"dist":{"shasum":"f016da367e126a7e7eacc3f6efccda558cc0e026","tarball":"https://registry.npmjs.org/@bingzi-233/ssh-mcp/-/ssh-mcp-1.2.0.tgz","fileCount":7,"integrity":"sha512-bAdF4orUbT8u1kTw3ixRva1wuShwQ/HB6tK18DYu8wD2TDxmsYGgiMwENLW4TNG75ksnya0xxBqbK2RKRY8JLA==","signatures":[{"sig":"MEQCICTIzn2ciKVqKf6moRtesxStBW9ufz8FAZK12e/TeuJeAiBcIwyX4hbt7GDlI30ezorBU6I4z3TVsgSHCK18fRDbbQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bingzi-233%2fssh-mcp@1.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":37177},"type":"module","engines":{"node":">=18"},"gitHead":"58060b11ba26ed5b79a2c13d9d7659397ffb4527","scripts":{"dev":"tsc --watch","build":"tsc","start":"node dist/index.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"bingzi-233","email":"lhby233@outlook.com"},"repository":{"url":"git+https://github.com/BingZi-233/ssh-mcp.git","type":"git"},"_npmVersion":"10.8.2","description":"通过 SSH/SFTP 让 AI 在多台远程服务器上执行命令并传输大文件（支持断点续传）的 MCP 服务器","directories":{},"_nodeVersion":"20.20.2","dependencies":{"zod":"^3.23.8","ssh2":"^1.16.0","@modelcontextprotocol/sdk":"^1.12.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0","@types/ssh2":"^1.15.0"},"_npmOperationalInternal":{"tmp":"tmp/ssh-mcp_1.2.0_1781251964457_0.48977352094146775","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@bingzi-233/ssh-mcp","version":"1.3.0","keywords":["cli","ssh","sftp","mcp","model-context-protocol","remote","file-transfer"],"author":{"name":"BingZi-233"},"license":"MIT","_id":"@bingzi-233/ssh-mcp@1.3.0","maintainers":[{"name":"bingzi-233","email":"lhby233@outlook.com"}],"homepage":"https://github.com/BingZi-233/ssh-mcp#readme","bugs":{"url":"https://github.com/BingZi-233/ssh-mcp/issues"},"bin":{"ssh-mcp":"dist/index.js"},"dist":{"shasum":"f61b540f8b2efdcee3d86861ed399e1df2a520af","tarball":"https://registry.npmjs.org/@bingzi-233/ssh-mcp/-/ssh-mcp-1.3.0.tgz","fileCount":7,"integrity":"sha512-8GHUOKyKcDZMp5WlHrrjyUh1g+LK0QmKk0n0Uqd/x19My9Q+q1SeMWjigM9MdGGzVpgyr+YwLG7WyLKgiA3i/A==","signatures":[{"sig":"MEUCIQCmcuNaxjJbL4HLwFAnUOR5D9dbtPa7DJogKzXcbhDboAIgPR+nG6UI8B7g7zxCGvn2NvQ2D8Zi/k4WYuyq6EupWb0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bingzi-233%2fssh-mcp@1.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":51958},"type":"module","engines":{"node":">=18"},"gitHead":"0ba9483320810a138f44590891be699b98244382","scripts":{"dev":"tsc --watch","build":"tsc","start":"node dist/index.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"bingzi-233","email":"lhby233@outlook.com"},"repository":{"url":"git+https://github.com/BingZi-233/ssh-mcp.git","type":"git"},"_npmVersion":"10.8.2","description":"纯命令行 SSH/SFTP 工具：在多台远程服务器上执行命令、传输大文件（断点续传）。支持 CLI 模式和 MCP stdio 模式。","directories":{},"_nodeVersion":"20.20.2","dependencies":{"zod":"^3.23.8","ssh2":"^1.16.0","@modelcontextprotocol/sdk":"^1.12.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0","@types/ssh2":"^1.15.0"},"_npmOperationalInternal":{"tmp":"tmp/ssh-mcp_1.3.0_1782351162999_0.5787261847065175","host":"s3://npm-registry-packages-npm-production"}},"1.4.0":{"name":"@bingzi-233/ssh-mcp","version":"1.4.0","keywords":["cli","ssh","sftp","mcp","model-context-protocol","remote","file-transfer"],"author":{"name":"BingZi-233"},"license":"MIT","_id":"@bingzi-233/ssh-mcp@1.4.0","maintainers":[{"name":"bingzi-233","email":"lhby233@outlook.com"}],"homepage":"https://github.com/BingZi-233/ssh-mcp#readme","bugs":{"url":"https://github.com/BingZi-233/ssh-mcp/issues"},"bin":{"ssh-mcp":"dist/index.js"},"dist":{"shasum":"d3527c62cc13a623eb094dc1b67cc5d8be322019","tarball":"https://registry.npmjs.org/@bingzi-233/ssh-mcp/-/ssh-mcp-1.4.0.tgz","fileCount":9,"integrity":"sha512-fjmabbJi0k0y3luPKI3O4R+vwSdV2vxttkNf4QT1feCOxxh3/yapD7B9Bdq1pb7RzlPbPK7yfs2tUVvBx9+DXw==","signatures":[{"sig":"MEUCIQCQgt48Gy86CJnvODqyTtCM7yNbmqbrZs3aQXkPStasAwIgJ2CeYgr+ZyDgxxmrBxUDvTNi+N20MJ/RsSzxmCny6+A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bingzi-233%2fssh-mcp@1.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":83116},"type":"module","engines":{"node":">=18"},"gitHead":"e657d217dbe5c8299e55729ed05d2176dab62771","scripts":{"dev":"tsc --watch","build":"tsc","start":"node dist/index.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"bingzi-233","email":"lhby233@outlook.com"},"repository":{"url":"git+https://github.com/BingZi-233/ssh-mcp.git","type":"git"},"_npmVersion":"10.8.2","description":"纯命令行 SSH/SFTP 工具：在多台远程服务器上执行命令、传输大文件（断点续传）。支持 CLI 模式和 MCP stdio 模式。","directories":{},"_nodeVersion":"20.20.2","dependencies":{"zod":"^3.23.8","ssh2":"^1.16.0","@modelcontextprotocol/sdk":"^1.12.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0","@types/ssh2":"^1.15.0"},"_npmOperationalInternal":{"tmp":"tmp/ssh-mcp_1.4.0_1782351927961_0.6512362602410378","host":"s3://npm-registry-packages-npm-production"}},"1.5.0":{"name":"@bingzi-233/ssh-mcp","version":"1.5.0","keywords":["cli","ssh","sftp","mcp","model-context-protocol","remote","file-transfer"],"author":{"name":"BingZi-233"},"license":"MIT","_id":"@bingzi-233/ssh-mcp@1.5.0","maintainers":[{"name":"bingzi-233","email":"lhby233@outlook.com"}],"homepage":"https://github.com/BingZi-233/ssh-mcp#readme","bugs":{"url":"https://github.com/BingZi-233/ssh-mcp/issues"},"bin":{"ssh-mcp":"dist/index.js"},"dist":{"shasum":"a6e3238c391a723bbb6542559335b9326149653c","tarball":"https://registry.npmjs.org/@bingzi-233/ssh-mcp/-/ssh-mcp-1.5.0.tgz","fileCount":10,"integrity":"sha512-flHlXuP+iJ5/Z1Nc/dQDJjVzgq6Oe4iXVcSEj6eWQlh2W6IF2aLrJgrd7xvbkLrv8ctPuLDlBX6GruQ/2VlrYQ==","signatures":[{"sig":"MEYCIQDMrKt5C+Ke155q3f0tESv/dUh2P1qh/ox2O06En9vElwIhAMYq3nCJGHtGVq0w5zgSSZaQkud6YIhy1qlDuXu3VhLt","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bingzi-233%2fssh-mcp@1.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":137235},"type":"module","engines":{"node":">=18"},"gitHead":"e23d29d9c282eaf2d8d503f37cfd6c434b67681c","scripts":{"dev":"tsc --watch","build":"tsc","start":"node dist/index.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"bingzi-233","email":"lhby233@outlook.com"},"repository":{"url":"git+https://github.com/BingZi-233/ssh-mcp.git","type":"git"},"_npmVersion":"10.8.2","description":"纯命令行 SSH/SFTP 工具：在多台远程服务器上执行命令、传输大文件（断点续传）。支持 CLI 模式和 MCP stdio 模式。","directories":{},"_nodeVersion":"20.20.2","dependencies":{"zod":"^3.23.8","ssh2":"^1.16.0","@modelcontextprotocol/sdk":"^1.12.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0","@types/ssh2":"^1.15.0"},"_npmOperationalInternal":{"tmp":"tmp/ssh-mcp_1.5.0_1782352693854_0.2690768535315813","host":"s3://npm-registry-packages-npm-production"}},"1.5.1":{"name":"@bingzi-233/ssh-mcp","version":"1.5.1","description":"纯命令行 SSH/SFTP 工具：在多台远程服务器上执行命令、传输大文件（断点续传）。支持 CLI 模式和 MCP stdio 模式。","type":"module","bin":{"ssh-mcp":"dist/index.js"},"engines":{"node":">=18"},"scripts":{"build":"tsc","start":"node dist/index.js","dev":"tsc --watch","prepublishOnly":"npm run build"},"keywords":["cli","ssh","sftp","mcp","model-context-protocol","remote","file-transfer"],"author":{"name":"BingZi-233"},"license":"MIT","homepage":"https://github.com/BingZi-233/ssh-mcp#readme","repository":{"type":"git","url":"git+https://github.com/BingZi-233/ssh-mcp.git"},"bugs":{"url":"https://github.com/BingZi-233/ssh-mcp/issues"},"publishConfig":{"access":"public"},"dependencies":{"@modelcontextprotocol/sdk":"^1.12.0","ssh2":"^1.16.0","zod":"^3.23.8"},"devDependencies":{"@types/node":"^22.0.0","@types/ssh2":"^1.15.0","typescript":"^5.6.0"},"_id":"@bingzi-233/ssh-mcp@1.5.1","gitHead":"986462facf83ddf4053147220e52ef6131c3cce5","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-AKFlGYNtnbmlDAsojjC0a/FTfrkMt2Dge5LZjBDSPnAM6WXofzX7i8g5eD6Oi9som8Mh1IOLJyAGopTlXvKfcQ==","shasum":"b22127cba515605123a6acdb30b0a24eed4d085f","tarball":"https://registry.npmjs.org/@bingzi-233/ssh-mcp/-/ssh-mcp-1.5.1.tgz","fileCount":10,"unpackedSize":137235,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bingzi-233%2fssh-mcp@1.5.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCVIM9gca2OY9gIfY2mbvL/ht/+SICDoLm63IYt1HZMvwIgMqbITXB8KvaU/zYp7xPujLAV70WRjnaIdK5CioIrip4="}]},"_npmUser":{"name":"bingzi-233","email":"lhby233@outlook.com"},"directories":{},"maintainers":[{"name":"bingzi-233","email":"lhby233@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ssh-mcp_1.5.1_1782353045616_0.16119185527473978"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-12T02:27:09.142Z","modified":"2026-06-25T02:04:06.058Z","1.0.0":"2026-06-12T02:27:09.413Z","1.0.1":"2026-06-12T02:32:49.301Z","1.2.0":"2026-06-12T08:12:44.658Z","1.3.0":"2026-06-25T01:32:43.146Z","1.4.0":"2026-06-25T01:45:28.110Z","1.5.0":"2026-06-25T01:58:14.010Z","1.5.1":"2026-06-25T02:04:05.779Z"},"bugs":{"url":"https://github.com/BingZi-233/ssh-mcp/issues"},"author":{"name":"BingZi-233"},"license":"MIT","homepage":"https://github.com/BingZi-233/ssh-mcp#readme","keywords":["cli","ssh","sftp","mcp","model-context-protocol","remote","file-transfer"],"repository":{"type":"git","url":"git+https://github.com/BingZi-233/ssh-mcp.git"},"description":"纯命令行 SSH/SFTP 工具：在多台远程服务器上执行命令、传输大文件（断点续传）。支持 CLI 模式和 MCP stdio 模式。","maintainers":[{"name":"bingzi-233","email":"lhby233@outlook.com"}],"readme":"# ssh-mcp\n\n纯命令行 SSH/SFTP 工具：远程执行命令、批量操作、大文件传输（断点续传）、端口转发、健康检查、配置对比、快照打包、tail -f、watch 等 27 个子命令。CLI + MCP 双模式。\n\n[![NPM](https://img.shields.io/npm/v/@bingzi-233/ssh-mcp?color=CB3837&logo=npm)](https://www.npmjs.com/package/@bingzi-233/ssh-mcp)\n[![Node](https://img.shields.io/node/v/@bingzi-233/ssh-mcp?color=339933&logo=nodedotjs)](https://nodejs.org)\n[![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?logo=typescript&logoColor=white)](https://www.typescriptlang.org)\n[![Stars](https://img.shields.io/github/stars/BingZi-233/ssh-mcp?color=EAC54F&logo=github)](https://github.com/BingZi-233/ssh-mcp/stargazers)\n[![License](https://img.shields.io/github/license/BingZi-233/ssh-mcp?color=4A90D9)](https://github.com/BingZi-233/ssh-mcp/blob/master/LICENSE)\n[![LINUX DO](https://img.shields.io/badge/LINUX_DO-社区认可-4A90D9?logo=discourse&logoColor=white)](https://linux.do)\n\n## CLI 快速上手\n\n```bash\nnpm i -g @bingzi-233/ssh-mcp\n\nssh-mcp list-servers                                     # 列出服务器\nssh-mcp run-command -s prod-web -c \"df -h /\"             # 执行命令\nssh-mcp batch --servers web1,web2,web3 -c \"uptime\"       # 批量执行\nssh-mcp upload -s prod-web -l ./dist.tar.gz -r /tmp/     # 上传文件\nssh-mcp health -s prod-web                               # 健康检查\nssh-mcp ls -s prod-web -p /var/log                       # 列出目录\nssh-mcp tail-f -s prod-web -p /var/log/app.log           # 追尾日志\nssh-mcp forward -s prod-web -L 8080:192.168.1.5:80       # 端口转发\n```\n\n## 命令一览\n\n| 子命令 | 用途 |\n|---|---|\n| `list-servers` | 列出所有已配置的服务器 |\n| `run-command` | 在远程服务器上执行命令 |\n| `batch` | 在多台服务器上批量执行同一命令 |\n| `open-session` / `close-session` / `list-sessions` | 长连接会话管理 |\n| `upload` / `download` | 大文件传输（后台任务，断点续传） |\n| `transfer-status` / `cancel-transfer` | 传输进度与取消 |\n| `forward` / `list-forwards` / `close-forward` | SSH 端口转发（本地/远程） |\n| `ls` / `stat` | 列出远程目录、查看文件信息 |\n| `rm` / `mkdir` | 删除远程文件/目录、创建远程目录 |\n| `health` | 一键健康检查（OS/磁盘/内存/负载/CPU） |\n| `cert-info` | 查看 SSL/TLS 证书信息 |\n| `copy-between` | 服务器间直传文件（不经本地中转） |\n| `diff-servers` | 对比两台服务器同一文件差异 |\n| `exec-script` | 上传脚本执行并自动清理 |\n| `snapshot` | 远程目录 tar.gz 打包下载 |\n| `tail-f` / `stop-tail` / `list-tails` | 持续追踪远程文件（SFTP） |\n| `watch` / `stop-watch` / `list-watches` | 定时重复执行命令并高亮差异 |\n| `curl` | 从远程服务器发起 HTTP 请求 |\n| `env` | 收集远程服务器环境信息 |\n\n每个子命令运行 `ssh-mcp <子命令> --help` 查看详细用法。\n\n## 配置 servers.json\n\n默认从运行目录下 `./servers.json` 读取，或设置环境变量 `SSH_MCP_CONFIG`。\n\n```json\n{\n  \"security\": { \"blocked_patterns\": [] },\n  \"servers\": [\n    {\n      \"name\": \"prod-web\",\n      \"description\": \"生产环境\",\n      \"host\": \"192.168.1.10\",\n      \"port\": 22,\n      \"username\": \"deploy\",\n      \"privateKeyPath\": \"~/.ssh/id_rsa\"\n    }\n  ]\n}\n```\n\n鉴权优先级：私钥 → 密码 → ssh-agent。修改配置无需重启。\n\n## 端口转发\n\n```bash\n# 本地转发：本机 8080 → 经 SSH 服务器 → 内网 192.168.1.5:80\nssh-mcp forward -s prod-web -L 8080:192.168.1.5:80\n\n# 远程转发：SSH 服务器 9000 → 回传到本机 localhost:3000\nssh-mcp forward -s prod-web -R 9000:127.0.0.1:3000\n\nssh-mcp list-forwards\nssh-mcp close-forward -i f1\n```\n\n## 批量执行\n\n```bash\nssh-mcp batch --servers prod-web,prod-api,prod-worker -c \"systemctl status nginx\"\n```\n\n## 安全策略\n\n内置拦截高危命令：`rm -rf /`、`dd` 写块设备、`mkfs`、fork 炸弹。在 `servers.json` 的 `security.blocked_patterns` 中追加自定义正则。传 `--force` 跳过检查。\n\n## MCP 模式\n\n以 MCP stdio 服务运行（供 Claude Code 等 AI 客户端调用）：\n\n```bash\nclaude mcp add ssh -- npx -y @bingzi-233/ssh-mcp --mcp\n/plugin marketplace add BingZi-233/ssh-mcp\n/plugin install ssh-mcp@bingzi-plugins\n```\n\n## 社区\n\n本项目由 [LINUX DO](https://linux.do) 社区孵化并认可。\n\n## License\n\nMIT © BingZi-233\n","readmeFilename":"README.md"}