npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ssh-mcp-devops

v2.0.3

Published

SSH MCP Server for AI-powered DevOps with Docker and System Monitoring

Readme

SSH-MCP Server - AI 运维工具

基于 Node.js 实现的 SSH MCP 服务器,支持 AI 自动化运维操作。

功能特性

✅ SSH 远程连接管理
✅ 命令执行(带安全检查)
✅ 危险操作二次确认
✅ 文件上传/下载
✅ 自动化项目部署
✅ 操作审计日志

快速开始

自动配置(推荐)

运行配置向导:

Windows:

setup.bat

Linux/Mac:

chmod +x setup.sh
./setup.sh

手动配置

详细步骤请查看 QUICKSTART.mdSETUP.md

1. 安装依赖

npm install

2. 配置 MCP

在 Kiro 中配置 MCP 服务器,编辑 .kiro/settings/mcp.json

{
  "mcpServers": {
    "ssh-mcp": {
      "command": "node",
      "args": ["index.js"],
      "disabled": false,
      "autoApprove": ["ssh_audit_log"],
      "env": {
        "SSH_HOST": "192.168.1.100",
        "SSH_PORT": "22",
        "SSH_USERNAME": "ubuntu",
        "SSH_PASSWORD": "your-password",
        "SSH_PRIVATE_KEY_PATH": ""
      }
    }
  }
}

配置说明:

  • SSH_HOST: SSH 服务器地址(必填)
  • SSH_PORT: SSH 端口(默认 22)
  • SSH_USERNAME: 登录用户名(必填)
  • SSH_PASSWORD: 登录密码(密码认证时使用)
  • SSH_PRIVATE_KEY_PATH: 私钥文件路径(密钥认证时使用,如 ~/.ssh/id_rsa

认证方式:

  • 密码认证:填写 SSH_PASSWORD
  • 密钥认证:填写 SSH_PRIVATE_KEY_PATH(推荐,更安全)

配置完成后,MCP 服务器启动时会自动连接到指定的 SSH 服务器。

3. 使用示例

连接到服务器

请连接到我的服务器:
- 主机: 192.168.1.100
- 用户名: ubuntu
- 密码: mypassword

执行命令

在服务器上执行: ls -la /var/www

部署项目

帮我部署项目:
- 本地路径: ./my-app
- 远程路径: /var/www/my-app
- 部署脚本: npm install && npm run build && pm2 restart my-app

工具列表

ssh_connect

连接到远程 SSH 服务器

参数:

  • host: 服务器地址
  • port: SSH 端口(默认 22)
  • username: 用户名
  • password: 密码(可选)
  • privateKey: 私钥路径(可选)

ssh_exec

执行远程命令(危险命令需要确认)

参数:

  • command: 要执行的命令
  • confirm: 确认执行危险操作(默认 false)

ssh_upload

上传文件到远程服务器

参数:

  • localPath: 本地文件路径
  • remotePath: 远程目标路径

ssh_download

从远程服务器下载文件

参数:

  • remotePath: 远程文件路径
  • localPath: 本地保存路径

ssh_deploy

自动部署项目

参数:

  • projectPath: 本地项目路径
  • remotePath: 远程部署路径
  • deployScript: 部署脚本(默认: npm install && npm run build && pm2 restart app)

ssh_audit_log

查看操作审计日志

参数:

  • limit: 返回日志条数(默认 50)

安全特性

危险命令检测

系统会自动检测以下危险操作:

  • rm -rf / - 删除根目录
  • rm -rf - 强制递归删除
  • dd if=...of=/dev/... - 磁盘写入
  • mkfs - 格式化文件系统
  • shutdown/reboot - 系统关机/重启
  • iptables -F - 清空防火墙规则
  • 等等...

危险命令需要设置 confirm: true 才能执行。

操作审计

所有操作都会记录到 ssh-mcp-audit.log 文件中,包括:

  • 时间戳
  • 操作类型
  • 目标对象
  • 执行状态
  • 风险级别

开发

# 开发模式(自动重启)
npm run dev

# 生产模式
npm start

许可证

MIT


📚 完整文档

🤝 贡献

欢迎提交 Issue 和 Pull Request!

📧 支持

如有问题,请查看文档或提交 Issue。