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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@keyue/ssh-mcp-server

v1.0.0

Published

SSH MCP Server for remote server management - 让Claude Code能够直接管理远程服务器

Readme

SSH MCP Server

一个强大的SSH MCP (Model Context Protocol) 服务器,让Claude Code能够直接管理远程服务器。

✨ 功能特性

  • 🔌 连接管理: 建立和管理多个SSH连接
  • ⚡ 命令执行: 在远程服务器上执行任意命令
  • 📁 文件操作: 上传、下载、删除文件
  • 📂 目录管理: 列出目录内容、创建目录
  • 🔐 安全认证: 支持密码和私钥认证
  • 🚀 即用即走: 通过npx直接使用,无需安装

🛠️ 安装和使用

方式一:npx直接使用(推荐)

npx @keyue/ssh-mcp-server

方式二:配置到Claude Code

在你的Claude Code配置文件中添加:

{
  "mcpServers": {
    "ssh": {
      "command": "npx",
      "args": ["@keyue/ssh-mcp-server"]
    }
  }
}

配置文件位置:

  • macOS/Linux: ~/.config/claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

方式三:从源码构建

# 克隆仓库(码云)
git clone https://gitee.com/[你的码云用户名]/ssh-mcp-server.git
cd ssh-mcp-server

# 安装依赖
npm install

# 构建项目
npm run build

# 启动服务器
npm start

📋 可用工具

连接管理

  • ssh_connect: 建立SSH连接到远程服务器
  • ssh_list_connections: 列出所有活跃的SSH连接
  • ssh_disconnect: 断开SSH连接

命令执行

  • ssh_exec: 在远程服务器上执行命令

文件操作

  • ssh_upload_file: 上传文件到远程服务器
  • ssh_download_file: 从远程服务器下载文件
  • ssh_delete_file: 删除远程文件

目录管理

  • ssh_list_files: 列出远程目录内容
  • ssh_create_directory: 创建远程目录

💡 使用示例

1. 建立SSH连接

在Claude Code中使用 ssh_connect 工具:

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

2. 执行远程命令

使用 ssh_exec 工具:

  • connectionId: 连接ID
  • command: 要执行的命令 (如:ls -la)

3. 文件上传

使用 ssh_upload_file 工具:

  • connectionId: 连接ID
  • localPath: 本地文件路径
  • remotePath: 远程文件路径

🔒 安全说明

  • 支持密码和私钥认证
  • 私钥密码短语保护
  • 连接状态管理
  • 错误处理和异常管理
  • 建议使用密钥认证而非密码认证

⚠️ 注意事项

  • 确保服务器SSH服务已启动
  • 检查防火墙设置
  • 妥善保管认证信息
  • 建议在受信任的网络环境中使用

🤝 贡献

欢迎提交Issue和Pull Request!

📦 发布

本项目通过npm发布,查看 发布指南 了解如何发布新版本。

📄 许可证

MIT License