Skip to main content
Glama

SSH MCP Server

by format37

ssh-mcp

SSH MCP server that provides secure shell access to local machines through a Model Context Protocol interface.

Overview

This server implements an SSH client using Paramiko and exposes SSH functionality through MCP tools, allowing AI assistants to execute commands on local machines securely.

Features

  • Session Management: Create, manage, and close SSH sessions with unique session IDs
  • Command Execution: Execute shell commands with proper input handling
  • Sudo Support: Specialized tools for running privileged commands with password authentication
  • Interactive Commands: Support for commands requiring user input (e.g., sudo prompts)
  • Thread-Safe: Concurrent session management with proper locking

Tools

  • ssh_start_session: Initialize SSH connection to localhost
  • ssh_exec_command: Execute shell commands with optional input
  • ssh_exec_sudo_command: Run sudo commands with automatic password handling
  • ssh_close_session: Clean up SSH sessions

Quick Start

  1. Install dependencies:
    pip install -r requirements.txt
  2. Start the server:
    ./start.sh

The server runs on http://0.0.0.0:7777 and provides an SSE (Server-Sent Events) endpoint for MCP communication.

Configuration

Default SSH credentials:

  • Hostname: localhost
  • Username: alex
  • Password: your-pass

Note: Update these credentials in server.py for production use.

Claude-desktop config

If using Linux, your config folder is:

/home/username/.config/Claude/claude_desktop_config.json

To enable this u need to enable it in claude desktop: File / Config / Developer / Edit config

SSH Daemon:

Configure ssh daemon:

nano /etc/systemd/system/ssh-mcp.service

Paste (update ur username):

[Unit] Description=SSH MCP Server After=network.target [Service] User=alex WorkingDirectory=/home/alex/projects/ssh-mcp ExecStart=/bin/bash -c 'eval "$(/home/alex/anaconda3/bin/conda shell.bash hook)" && conda activate base && /home/alex/anaconda3/bin/uvicorn server:app --host 0.0.0.0 --port 7777' Restart=on-failure RestartSec=5s [Install] WantedBy=multi-user.target

Start

sudo systemctl daemon-reload sudo systemctl enable ssh-mcp.service sudo systemctl start ssh-mcp.service
-
security - not tested
F
license - not found
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

Enables AI assistants to securely execute shell commands on local machines through an SSH interface with session management, command execution, and sudo support.

  1. Overview
    1. Features
      1. Tools
        1. Quick Start
          1. Configuration
            1. Claude-desktop config
              1. SSH Daemon:

                Related MCP Servers

                • -
                  security
                  F
                  license
                  -
                  quality
                  A robust SSH server facilitating secure remote command execution with TMUX session management, multi-window support, and smart session recovery for improved AI-human interaction.
                  Last updated -
                  4
                  Python
                • -
                  security
                  A
                  license
                  -
                  quality
                  Enables secure remote execution of Rails console commands over SSH for read-only operations, mutation planning, and executing approved changes in a deployed Rails environment.
                  Last updated -
                  51
                  7
                  TypeScript
                  MIT License
                • -
                  security
                  A
                  license
                  -
                  quality
                  A secure server that enables AI applications to execute shell commands in specified directories, supporting multiple shell types (bash, sh, cmd, powershell) with built-in security features like directory isolation and timeout control.
                  Last updated -
                  9
                  Python
                  Apache 2.0
                  • Linux
                  • Apple
                • -
                  security
                  -
                  license
                  -
                  quality
                  Transform your local machine into a powerful code command center. Automate file handling, run terminal commands, and leverage AI to enhance your development workflows—all securely and instantly, without cloud latency.
                  Last updated -
                  1
                  Python
                  MIT License

                View all related MCP servers

                MCP directory API

                We provide all the information about MCP servers via our MCP API.

                curl -X GET 'https://glama.ai/api/mcp/v1/servers/format37/ssh-mcp'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server