# @uarlouski/ssh-mcp-server [Health: Active]

**Category:** 🖥️ Command Line  
**Repository:** https://github.com/uarlouski/ssh-mcp-server  
**GitHub Stars:** 38  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/uarlouski-ssh-mcp-server

## Description
MCP server enabling AI assistants to securely execute SSH commands, transfer files via SFTP, manage port forwarding, and use parameterized command templates with comprehensive security controls

## Tools
Capabilities this server exposes over MCP:

- **ssh_execute_command** — Execute commands on remote servers.
- **ssh_list_servers** — List all available SSH servers configured in your config file.
- **ssh_port_forward** — Set up SSH port forwarding to access remote services.
- **ssh_close_port_forward** — Close an active port forward.
- **ssh_restart_port_forward** — Restart an active port forward using its unique ID.
- **ssh_list_port_forwards** — List all active port forwards across all connections.
- **ssh_port_forward_service** — Start a pre-configured named port forwarding service from your config.
- **ssh_upload_file** — Upload a file from local system to remote server via SFTP.
- **ssh_download_file** — Download a file from remote server to local system via SFTP.
- **ssh_list_remote_files** — List files in a remote directory via SFTP.
- **ssh_delete_remote_file** — Delete a file on the remote server via SFTP.
- **ssh_execute_template** — Execute a pre-configured command template with variable substitution.
- **ssh_list_templates** — List all available command templates with their descriptions and variables.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "ssh-mcp-server": {
    "command": "npx",
    "args": ["@uarlouski/ssh-mcp-server@latest"]
  }
}
```

## Documentation

## What @uarlouski/ssh-mcp-server does

@uarlouski/ssh-mcp-server gives MCP clients an interface to configured SSH hosts. It can execute remote shell commands, work with remote files through SFTP, and create tunnels from local ports to services reachable through an SSH connection.

The package is suited to infrastructure tasks such as checking container or Kubernetes status, reviewing logs, inspecting disk usage, updating remote scripts, and restarting services. It can also expose predefined command workflows, allowing an assistant to supply values to approved templates rather than construct every command from scratch.

## How it works

The server is launched as a standard command-line MCP process. A JSON configuration file defines named servers, permitted commands, optional port-forwarding services, command templates, command timeouts, and the connection limit. Each server entry identifies a host, SSH username, private-key path, and optionally a non-default SSH port.

SSH public-key authentication is used with Ed25519 or RSA private keys. Existing entries can also be imported from an SSH configuration file, with optional host patterns for selecting which entries to use. The default import path is `~/.ssh/config`.

When command restrictions are configured, validation applies to command structures that include pipes, command chains, and substitutions. This is intended to prevent an allowed command from being combined with a disallowed operation. Leaving the allowed-command list empty disables that validation, so the configuration should be reviewed accordingly.

## Setup and configuration

Node.js 18 or newer and SSH access to the target machines are required. The package can run without a local install through `npx`:

```json
{
  "mcpServers": {
    "ssh": {
      "command": "npx",
      "args": [
        "@uarlouski/ssh-mcp-server@latest",
        "--configPath=/path/to/ssh-mcp-config.json"
      ]
    }
  }
}
```

It can alternatively be installed globally with npm and started using the `ssh-mcp-server` command. After adding the MCP entry, restart the client so it loads the server.

A minimal configuration contains `servers` and can include `allowedCommands`:

```json
{
  "allowedCommands": ["ls", "cat", "grep", "docker", "kubectl"],
  "servers": {
    "staging": {
      "host": "example.com",
      "username": "deploy",
      "privateKeyPath": "~/.ssh/deploy_key"
    }
  }
}
```

Port-forwarding services specify a source server, local port, remote host, and remote port. Templates use placeholders such as `{{namespace}}`; defaults can be supplied with syntax such as `{{lines:100}}`. `commandTimeout` defaults to 30,000 milliseconds and `maxConnections` defaults to 10.

## Tools and capabilities

The MCP tool set includes:

- Execute remote commands and list configured SSH servers.
- Upload, download, list, and delete remote files through SFTP.
- Open, close, restart, and list SSH port forwards.
- Start named port-forwarding services from configuration.
- Run parameterized command templates and list available templates with their descriptions and variables.

Connections can be pooled for multiple SSH sessions. Executed commands are recorded in JSONL audit logs, providing an activity trail for review. Port forwarding can expose internal services such as databases or dashboards through a local port.

## Limitations and notes

The server operates only against hosts and credentials available through its configuration or imported SSH configuration. Remote access still depends on valid SSH connectivity and private keys. Command safety depends on configuring `allowedCommands`; an omitted or empty list permits unrestricted command execution. The MCP client must support the standard MCP server connection model, and the client configuration must pass the path to the JSON configuration file.

_Full upstream README: https://allmcps.com/mcp/uarlouski-ssh-mcp-server/readme_

