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

opencode-plugin-ssh

v0.3.0

Published

Persistent interactive SSH sessions, profiles, remote SFTP/SCP transfers, and background jobs for Claude Code, OpenCode, and MCP clients

Downloads

947

Readme

opencode-plugin-ssh

Persistent interactive SSH sessions, profiles, PTY shells, SFTP/SCP file transfers, and remote background job supervision for Claude Code, OpenCode, and MCP clients.

Dual-compatible as an OpenCode Plugin and a standalone Model Context Protocol (MCP) Server.


Features

  • Persistent SSH Sessions: Reuses open connections in memory without repeating handshakes.
  • PTY Shell & Multiplexed Exec: Run single discrete commands or maintain state across commands in a persistent shell.
  • SFTP & High-Speed SCP: Read, write, targeted find-and-replace, and chunked recursive local-remote or remote-to-remote file transfers.
  • Claude Code & MCP Native: Works out-of-the-box with Claude Code (claude mcp add), Cursor, Claude Desktop, and OpenCode.
  • Pager Guard: Automatically sets TERM=dumb, PAGER=cat, and CI=1 to prevent interactive hangs.
  • Key & Passphrase Support: Reads private keys from disk or options, supporting passphrases and environment variables.
  • Detached Background Jobs: Spawn, inspect, fetch logs, and terminate long-running remote processes.
  • Cluster Broadcast: Execute commands across multiple active sessions concurrently.
  • System Diagnostics: Single-call probe gathering OS, hardware, runtime, and network info.

Usage with Claude Code

Option 1: Quick Add via CLI (Recommended)

Run directly in your terminal:

claude mcp add ssh -- npx -y opencode-plugin-ssh

Option 2: Project .mcp.json

Add a .mcp.json file in your repository root:

{
  "mcpServers": {
    "ssh": {
      "command": "npx",
      "args": ["-y", "opencode-plugin-ssh"]
    }
  }
}

Option 3: Claude Code Plugin & Mod (Slash Commands + Live Spinner)

Install directly into Claude Code:

claude plugin add opencode-ssh

Or load locally during development:

claude --plugin-dir /path/to/opencode-ssh

When loaded as a Claude Code plugin/mod, it automatically adds:

  • /ssh-profiles: Browse configured hosts and connection parameters from ~/.ssh/config.
  • /ssh-status: View real-time active SSH tool operations and history.
  • /ssh-help: Instant cheatsheet of available SSH commands and MCP tools.
  • Live Spinner Feedback: Shows · SSH: <operation> on the Claude Code spinner whenever a remote SSH or SCP task is running.

Usage with OpenCode

Add to your OpenCode configuration (opencode.json or ~/.config/opencode/opencode.jsonc):

{
  "plugin": [
    "opencode-plugin-ssh"
  ]
}

Or install as a local dependency:

npm install -D opencode-plugin-ssh

Usage with Claude Desktop / Cursor / Other MCP Clients

Add to your claude_desktop_config.json or Cursor MCP configuration:

{
  "mcpServers": {
    "ssh": {
      "command": "npx",
      "args": ["-y", "opencode-plugin-ssh"]
    }
  }
}

Tools

All tools are available across both OpenCode and MCP clients:

Sessions & Connections

  • ssh_list_profiles: List profiles from ~/.ssh/config and saved configurations.
  • ssh_save_profile: Store host connection parameters for quick reuse.
  • ssh_connect: Open or verify an active SSH session.
  • ssh_list_sessions: List connected sessions and their active status.
  • ssh_switch_session: Change the default active session.
  • ssh_close: Disconnect and clean up a session.
  • ssh_broadcast: Run a command across multiple connected sessions.

Execution & PTY

  • ssh_exec: Run a non-interactive command and return stdout, stderr, exit code, and executedAs.
  • ssh_interactive_cmd: Execute commands inside a persistent PTY shell (returns output and executedAs).
  • ssh_switch_user: Switch user (e.g. to root) in the persistent shell via sudo/su with automatic password handling.
  • ssh_pty_send: Send raw text or control characters (e.g. \x03) to the PTY.
  • ssh_pty_read: Retrieve recent buffer output from the PTY shell.

Filesystem (SFTP & SCP)

  • ssh_scp: Securely copy files or directories between local machine and remote host (upload / download), or stream directly between two remote sessions (remote_to_remote) with recursive and chunked transfer support.
  • ssh_read_file: Read remote files with pagination and line numbering.
  • ssh_write_file: Write or overwrite remote files over SFTP.
  • ssh_edit_file: Find and replace exact substrings within remote files.
  • ssh_list_dir: Structured directory listing (name, size, mode, permissions, isDirectory, isSymlink, mtime).
  • ssh_stat: Inspect file/directory metadata or test for existence (size, permissions, timestamps, link targets).
  • ssh_mkdir: Create remote directory with optional recursive creation of parent directories (-p).
  • ssh_rm: Delete a remote file or folder with optional recursive directory removal.
  • ssh_rename: Move or rename remote files and directories over SFTP.
  • ssh_chmod: Change remote file/directory permissions via octal mode (e.g. '0755', '0644', '0600').

Background Jobs & Health

  • ssh_system_inspect: Inspect system metrics, listening ports, and installed runtimes.
  • ssh_job_spawn: Start a supervised background job.
  • ssh_job_status: Check status and exit code of a spawned job.
  • ssh_job_logs: Fetch stdout and stderr output from a background job.
  • ssh_job_kill: Terminate a background job with a specified signal.

License

MIT