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

@lynmoe/ssh-mcp

v0.0.4

Published

MCP server: list SSH hosts from your config and run shell commands on remotes via OpenSSH (ControlMaster).

Readme

@lynmoe/ssh-mcp

通过 stdio 暴露 MCP 工具,使用本机 OpenSSH(ControlMaster)在远程主机上执行 shell:命令经 stdin 传给远端 shell -s(默认 bash),无 TTY。

环境要求

  • Node.js ≥ 18
  • 已安装并可用的 ssh(Windows 需 OpenSSH 客户端)

安装

从 npm 安装:

npm install @lynmoe/ssh-mcp

本地开发时在仓库根目录执行:

npm install
npm run build

开发调试(不编译):

npm run dev

使用方式

由 MCP 宿主(如 Cursor)在子进程中启动本服务后,通过协议调用 list_hosts / run_on_host。若需命令行试调,可使用 mcporter 等 CLI 对已写入 mcporter.json 的 stdio 服务发起 call

在 MCP 客户端中配置

使用 stdio 启动服务。已安装 npm 包时可用 npx(推荐),或指向包内 dist/index.js

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

本地克隆开发时可将 args 改为 ["/你的路径/ssh-mcp/dist/index.js"] 并用 "command": "node"

Cursor 中可将上述片段合并进 MCP 设置;其他支持 MCP 的 IDE 同理。

工具说明

| 工具 | 作用 | | ------------- | -------------------------------------------------------------------------------------------------------- | | list_hosts | 从 ~/.ssh/configInclude 中列出 Host 别名(不发起连接)。 | | run_on_host | 在指定目标上执行脚本:hostcommandtimeoutMs(单次执行上限 ms)、可选 shell(仅裸名,默认 bash)。同一目标复用一条 SSH 连接;空闲一段时间后关闭主连接。 |

环境变量(可选)

| 变量 | 含义 | | ------------------ | -------------------------------------------------- | | SSH_CONFIG | 自定义 ssh 配置文件路径(否则使用 ~/.ssh/config)。 | | SSH_MCP_SSH_PATH | 指定 ssh 可执行文件路径。 | | SSH_MCP_IDLE_MS | 连接池空闲断开时间(毫秒),默认 120000,有效范围约 100086400000。 | | SSH_MCP_CONTROL_DIR | ControlMaster 套接字所在目录。POSIX 默认 /tmp(避免 macOS 上 TMPDIR 过长导致 path too long for Unix domain socket);可设为更短路径。 |

命令行直接运行

全局或项目内安装后:

ssh-mcp

或:

node dist/index.js

进程从 stdin/stdout 读写 MCP 消息,请勿向 stdout 打印其它内容。

开源协议

MIT

安全提示

本服务等价于在运行它的用户身份下执行 ssh;仅在信任的 MCP 宿主与网络环境中启用,并确保 ~/.ssh 与密钥权限得当。