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

remote-server-mcp

v0.1.1

Published

Model Context Protocol server for executing commands on remote hosts via SSH.

Readme

remote-server-mcp

A Model Context Protocol (MCP) server that lets AI agents execute shell commands on pre-configured remote machines via SSH. It validates configuration up front, streams command output, and records telemetry so future guardrails can plug in without rewriting the core transport layer.

Prerequisites

  • Node.js 20+
  • Remote SSH hosts configured with credentials accessible to the machine running the MCP server

Installation

npm install

Configuration

By default the server looks for a TOML file at ~/.config/remote-server-mcp/config.toml. Override the path with the REMOTE_SERVER_MCP_CONFIG environment variable if needed.

Example config.toml:

[[hosts]]
alias = "staging-web"
host = "staging.example.com"
username = "deploy"
auth.type = "ssh-key"
auth.privateKeyPath = "/Users/me/.ssh/id_ed25519"
knownHostsPath = "/Users/me/.ssh/known_hosts"
timeoutMs = 60000

Supported auth strategies:

  • ssh-key – load a private key from disk (optional passphrasePrompt to read from REMOTE_SERVER_MCP_PASSPHRASE_<ALIAS> environment variable)
  • ssh-agent – use the current SSH agent (SSH_AUTH_SOCK)
  • credential-command – run a shell command that prints a password to stdout

Configuration hot-reloads automatically when the file changes.

Running the server

npm run build
npm start

During development you can run the TypeScript sources directly:

npm run dev

The server currently uses the stdio MCP transport; integrate it with your MCP client by pointing at the process.

MCP client (stdio) setup

Because the server speaks stdio, you can let your MCP client spawn it on demand instead of keeping a long-running daemon.

  1. Build once with npm run build.
  2. (Optional but convenient) run npm link so the remote-server-mcp CLI is available globally while developing.
  3. In your MCP client config, define a stdio server, for example:
[[servers]]
name = "remote-server-mcp"
type = "stdio"
command = "npx"
args = ["remote-server-mcp@latest"]
env = { REMOTE_SERVER_MCP_CONFIG = "/Users/me/.config/remote-server-mcp/config.toml" }
  • If you have not published the package yet, point command to node and pass the absolute path to dist/index.js, or use command = "npx", args = ["tsx", "src/index.ts"] for live TypeScript execution.
  • Each time a client session starts, it will invoke the binary, stream stdout/stderr through the MCP logging channel, and exit when the command finishes—no background service is required.

Testing

npm test

Tests cover configuration parsing, validation failure scenarios, and the command service orchestration (including streaming and telemetry hooks). Linting is enforced with:

npm run lint

Telemetry & Hooks

Execution telemetry is emitted through Pino. By default logs go to stderr (so stdio MCP transports keep stdout clean). Set REMOTE_SERVER_MCP_LOG_PATH to write logs to a file instead. Pre/post/error hook callbacks are in place for future policy enforcement.

Safety Notes

  • Never commit real credentials or private keys
  • Ensure host key verification paths are populated before enabling strictHostKeyChecking
  • Use the provided hook interface to add confirmations or whitelists before deploying to production