SSH MCP Server

SSH MCP Server

MCP-compliant SSH server for secure command execution on Linux and Windows.

137
Stars
24
Forks
137
Watchers
0
Issues
SSH MCP Server provides an MCP-compliant interface to expose SSH control for both Linux and Windows systems. It enables secure execution of shell commands remotely, supporting password and SSH key authentication as well as sudo and su elevation. Built with TypeScript and the official MCP SDK, the server offers configurable timeouts, process management, and compatibility with popular LLM clients such as Claude Desktop and Cursor. Designed for robust and flexible integration, it facilitates natural language interfaces to system administration tasks.

Key Features

MCP-compliant SSH server implementation
Execute remote shell commands on Linux and Windows
Secure authentication via password or SSH key
Sudo and su root elevation support
Configurable timeout with automatic process abortion
Graceful handling of command timeouts
Max command length configuration
Built with TypeScript and MCP SDK
Integration with LLM-based clients (e.g. Claude Desktop, Cursor)
Easy client configuration parameters

Use Cases

Secure remote administration of Linux and Windows servers
Enabling LLM and natural language-interfaces for system operations
Automated DevOps and configuration management via SSH
Execution of privileged operations with sudo or su
Development environment integration for remote shell management
Controlled shell command execution with timeout protection
Facilitating secure debugging and maintenance workflows
Bulk and scripted command execution on multiple servers
Supporting educational tools for server command learning
Extending IDE and chatbot assistants with real-time server control

README

SSH MCP Server

NPM Version Downloads Node Version License GitHub Stars GitHub Forks Build Status GitHub issues

Trust Score

SSH MCP Server is a local Model Context Protocol (MCP) server that exposes SSH control for Linux and Windows systems, enabling LLMs and other MCP clients to execute shell commands securely via SSH.

Contents

Quick Start

  • Install SSH MCP Server
  • Configure SSH MCP Server
  • Set up your MCP Client (e.g. Claude Desktop, Cursor, etc)
  • Execute remote shell commands on your Linux or Windows server via natural language

Features

  • MCP-compliant server exposing SSH capabilities
  • Execute shell commands on remote Linux and Windows systems
  • Secure authentication via password or SSH key
  • Built with TypeScript and the official MCP SDK
  • Configurable timeout protection with automatic process abortion
  • Graceful timeout handling - attempts to kill hanging processes before closing connections

Tools

  • exec: Execute a shell command on the remote server

    • Parameters:
      • command (required): Shell command to execute on the remote SSH server
    • Timeout Configuration:
  • sudo-exec: Execute a shell command with sudo elevation

    • Parameters:
      • command (required): Shell command to execute as root using sudo
    • Notes:
      • Requires --sudoPassword to be set for password-protected sudo
      • Can be disabled by passing the --disableSudo flag at startup if sudo access is not needed or not available
      • For persistent root access, consider using --suPassword instead which establishes a root shell
      • Tool will not be available at all if server is started with --disableSudo
    • Timeout Configuration:
      • Timeout is configured via command line argument --timeout (in milliseconds)
      • Default timeout: 60000ms (1 minute)
      • When a command times out, the server automatically attempts to abort the running process before closing the connection
    • Max Command Length Configuration:
      • Max command characters are configured via --maxChars
      • Default: 1000
      • No-limit mode: set --maxChars=none or any <= 0 value (e.g. --maxChars=0)

Installation

  1. Clone the repository:
    bash
    git clone https://github.com/tufantunc/ssh-mcp.git
    cd ssh-mcp
    
  2. Install dependencies:
    bash
    npm install
    

Client Setup

You can configure your IDE or LLM like Cursor, Windsurf, Claude Desktop to use this MCP Server.

Required Parameters:

  • host: Hostname or IP of the Linux or Windows server
  • user: SSH username

Optional Parameters:

  • port: SSH port (default: 22)
  • password: SSH password (or use key for key-based auth)
  • key: Path to private SSH key
  • sudoPassword: Password for sudo elevation (when executing commands with sudo)
  • suPassword: Password for su elevation (when you need a persistent root shell)
  • timeout: Command execution timeout in milliseconds (default: 60000ms = 1 minute)
  • maxChars: Maximum allowed characters for the command input (default: 1000). Use none or 0 to disable the limit.
  • disableSudo: Flag to disable the sudo-exec tool completely. Useful when sudo access is not needed or not available.
commandline
{
    "mcpServers": {
        "ssh-mcp": {
            "command": "npx",
            "args": [
                "ssh-mcp",
                "-y",
                "--",
                "--host=1.2.3.4",
                "--port=22",
                "--user=root",
                "--password=pass",
                "--key=path/to/key",
                "--timeout=30000",
                "--maxChars=none"
            ]
        }
    }
}

Claude Code

You can add this MCP server to Claude Code using the claude mcp add command. This is the recommended method for Claude Code.

Basic Installation:

bash
claude mcp add --transport stdio ssh-mcp -- npx -y ssh-mcp -- --host=YOUR_HOST --user=YOUR_USER --password=YOUR_PASSWORD

Installation Examples:

With Password Authentication:

bash
claude mcp add --transport stdio ssh-mcp -- npx -y ssh-mcp -- --host=192.168.1.100 --port=22 --user=admin --password=your_password

With SSH Key Authentication:

bash
claude mcp add --transport stdio ssh-mcp -- npx -y ssh-mcp -- --host=example.com --user=root --key=/path/to/private/key

With Custom Timeout and No Character Limit:

bash
claude mcp add --transport stdio ssh-mcp -- npx -y ssh-mcp -- --host=192.168.1.100 --user=admin --password=your_password --timeout=120000 --maxChars=none

With Sudo and Su Support:

bash
claude mcp add --transport stdio ssh-mcp -- npx -y ssh-mcp -- --host=192.168.1.100 --user=admin --password=your_password --sudoPassword=sudo_pass --suPassword=root_pass

Installation Scopes:

You can specify the scope when adding the server:

  • Local scope (default): For personal use in the current project

    bash
    claude mcp add --transport stdio ssh-mcp --scope local -- npx -y ssh-mcp -- --host=YOUR_HOST --user=YOUR_USER --password=YOUR_PASSWORD
    
  • Project scope: Share with your team via .mcp.json file

    bash
    claude mcp add --transport stdio ssh-mcp --scope project -- npx -y ssh-mcp -- --host=YOUR_HOST --user=YOUR_USER --password=YOUR_PASSWORD
    
  • User scope: Available across all your projects

    bash
    claude mcp add --transport stdio ssh-mcp --scope user -- npx -y ssh-mcp -- --host=YOUR_HOST --user=YOUR_USER --password=YOUR_PASSWORD
    

Verify Installation:

After adding the server, restart Claude Code and ask Cascade to execute a command:

"Can you run 'ls -la' on the remote server?"

For more information about MCP in Claude Code, see the official documentation.

Testing

You can use the MCP Inspector for visual debugging of this MCP Server.

sh
npm run inspect

Disclaimer

SSH MCP Server is provided under the MIT License. Use at your own risk. This project is not affiliated with or endorsed by any SSH or MCP provider.

Contributing

We welcome contributions! Please see our Contributing Guidelines for more information.

Code of Conduct

This project follows a Code of Conduct to ensure a welcoming environment for everyone.

Support

If you find SSH MCP Server helpful, consider starring the repository or contributing! Pull requests and feedback are welcome.

Star History

Star History Chart

Repository Owner

tufantunc
tufantunc

User

Repository Details

Language TypeScript
Default Branch main
Size 97 KB
Contributors 3
License MIT License
MCP Verified Nov 11, 2025

Programming Languages

TypeScript
54.58%
JavaScript
45.42%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • CMD MCP Server

    CMD MCP Server

    Execute CMD commands via the Model Context Protocol with cross-platform and SSH support.

    CMD MCP Server is an implementation of the Model Context Protocol (MCP) for executing CMD commands on Windows and Linux systems, with additional support for SSH connections. It enables seamless integration of command-line operations with MCP-compatible applications, leveraging the official MCP SDK. Written in TypeScript for cross-platform compatibility, it allows programmatic execution, configuration, and extension of CMD operations through standardized protocols. The server is designed for easy installation, robust configuration, and developer-friendly extension.

    • 22
    • MCP
    • PhialsBasement/CMD-MCP-Server
  • MCP Shell Server

    MCP Shell Server

    A secure, configurable shell command execution server implementing the Model Context Protocol.

    MCP Shell Server provides secure remote execution of whitelisted shell commands via the Model Context Protocol (MCP). It supports standard input, command output retrieval, and enforces strict safety checks on command operations. The tool allows configuration of allowed commands and execution timeouts, and can be integrated with platforms such as Claude.app and Smithery. With robust security assessments and flexible deployment methods, it facilitates controlled shell access for AI agents.

    • 153
    • MCP
    • tumf/mcp-shell-server
  • PiloTY

    PiloTY

    AI Pilot for PTY Operations via the Model Context Protocol

    PiloTY is an MCP server that enables AI agents to control interactive terminals as if they were human users. It provides stateful, context-preserving terminal sessions that support interactive programs, SSH connections, and background process management. The system allows secure integration with AI platforms like Claude Code or Claude Desktop to translate natural language instructions into complex terminal workflows. Designed for extensibility and real-world development scenarios, PiloTY empowers agents to manage remote environments, debug interactively, and automate multi-step operations.

    • 12
    • MCP
    • yiwenlu66/PiloTY
  • Firefly MCP Server

    Firefly MCP Server

    Seamless resource discovery and codification for Cloud and SaaS with Model Context Protocol integration.

    Firefly MCP Server is a TypeScript-based server implementing the Model Context Protocol to enable integration with the Firefly platform for discovering and managing resources across Cloud and SaaS accounts. It supports secure authentication, resource codification into infrastructure as code, and easy integration with tools such as Claude and Cursor. The server can be configured via environment variables or command line and communicates using standardized MCP interfaces. Its features facilitate automation and codification workflows for cloud resource management.

    • 15
    • MCP
    • gofireflyio/firefly-mcp
  • MCP Server for MySQL - Claude Code Edition

    MCP Server for MySQL - Claude Code Edition

    A Model Context Protocol MySQL server with SSH tunnels, optimized for Claude Code.

    MCP Server for MySQL - Claude Code Edition provides an implementation of the Model Context Protocol for secure, context-driven access to MySQL databases. It enables AI tools, such as Claude Code, to access and manipulate database schemas and data through SSH tunnels, supporting multi-project setups and automated management. The server offers advanced configuration options and permission controls for safe interaction with remote databases.

    • 902
    • MCP
    • benborla/mcp-server-mysql
  • wcgw

    wcgw

    Local shell and code agent server with deep AI integration for Model Context Protocol clients.

    wcgw is an MCP server that empowers conversational AI models, such as Claude, with robust shell command execution and code editing capabilities on the user's local machine. It offers advanced tools for syntax-aware file editing, interactive shell command handling, and context management to optimize AI-driven workflows. Key protections are included to safeguard files, prevent accidental overwrites, and streamline large file handling, ensuring smooth automated code development and execution.

    • 616
    • MCP
    • rusiaaman/wcgw
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results