ssh-utils logo

ssh-utils

by GrahamJenkins

ssh-utils is an MCP server that enables executing terminal commands on remote servers via SSH. It's designed for secure, key-based SSH command execution from development environments like Roo Code.

View on GitHub

Last updated: N/A

ssh-utils

Purpose

ssh-utils is a Model Context Protocol (MCP) server that allows you to execute terminal commands on a remote server via SSH. It is designed to be used as a tool within Roo Code or any MCP-compatible client, enabling secure, key-based SSH command execution from your development environment.

How It Works

  • The server exposes a tool called execute_ssh_command via the MCP protocol.
  • When invoked, it connects to a remote server using SSH and runs the specified command.
  • Credentials and connection details are loaded from a configuration file (ssh-utils-servers.json), which can be placed in:
    • The current working directory
    • The workspace root
    • The global config directory: ~/.config/ssh-utils/ssh-utils-servers.json
  • If multiple profiles are present in the config, the first is used by default, or you can specify a profile by name.
  • Any tool arguments (such as user, host, or server) override the config file values.

Configuration File

The configuration file is a JSON file named ssh-utils-servers.json with the following structure:

{
  "profiles": {
    "default": {
      "host": "example.com",
      "user": "bob",
      "port": 22,
      "privateKeyPath": "/home/bob/.ssh/id_ed25519"
    },
    "work": {
      "server": "workhost",
      "user": "alice"
    }
  }
}
  • host or server: The SSH hostname or IP address.
  • user: The SSH username.
  • port: (Optional) The SSH port (default: 22).
  • privateKeyPath: (Optional) Path to the private key file.

Usage

  1. Place your ssh-utils-servers.json config file in one of the supported locations.
  2. Use the execute_ssh_command tool from Roo Code or another MCP client, specifying the command and (optionally) overriding any connection parameters.

Security

  • Password-based SSH authentication is explicitly prohibited for security reasons. Only key-based authentication is supported.