Skip to main content
Glama
mcp_linux_ssh

mcp_linux_ssh

by samdoran

MCP Server to run commands over SSH

⚠️ This is an early prototype. Use at your own risk. ⚠️

Getting started

python -m venv .venvs/mcp
.venvs/mcp/bin/python -m pip install -e .

Run the MCP server with .venvs/mcp/bin/mcp-linux-ssh

To have an MCP client run the application, point it at realpath .venvs/mcp/bin/mcp-linux-ssh.

Here's an example configuration for Claude Desktop:

{
    "mcpServers": {
        "linux_ssh": {
            "command": "/Users/sdoran/Developer/mcp_linux_ssh/.venvs/mcp/bin/mcp-linux-ssh",
            "env": {
                "TMPDIR": "/tmp"
            }
        }
    }
}

Create a standalone executable

Use shiv to create portable executable.

mkdir build
shiv -o build/mcp_linux_ssh --console-script mcp-linux-ssh .

Logging

Commands and the hosts they are run on are logged to a local file that is rotated once it reaches five megabytes in size. The file location depends on the platform running the MCP server.

Linux: ~/.local/share/logs/mcp-linux-ssh.log

macOS: ~/Library/Logs/mcp-linux-ssh.log

Available Tools

6 tools
get_cpu_infoCPU informationC
Read-only

Get detailed information about system CPUs

Inputs: host (required).

get_disk_infoDisk informationC
Read-only

Get details about the system filesystems and free space

Inputs: host (required).

get_processesGet running processB
Read-only

List all processes on a system sorted in descending order by CPU

Inputs: host (required).

get_service_statusService statusB
Read-only

Get details on a systemd unit

Inputs: host (required), unit (required).

run_sshRun SSHC

This command could make changes to the system. Care should be taken to not disable ssh or modify files such as /etc/sudoers, etc/password, or /etc/shadow so as to render tho system inaccessible.

It can use sudo but should not prompt for password input. The sudo settings shoould allow passwordless sudo on the remote machine.

When using systemctl, make sure to add --no-pager to prevent the command from hanging.

Inputs: host (required), command (required). Returns: object

run_ssh_read_onlyRun SSH read onlyB

Only run commands that would not make changes to the system. sudo is not allowed.

When using systemctl, make sure to add --no-pager to prevent the command from hanging.

Inputs: host (required), command (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool targets a distinct system resource or action. The two command execution tools are clearly separated by read-only vs. writable behavior, eliminating ambiguity.

    Naming Consistency5/5

    All tool names follow a consistent snake_case pattern: informational tools use 'get_' prefix and execution tools use 'run_' prefix, making the set predictable.

    Tool Count5/5

    Six tools cover the essential operations for a Linux SSH management server—information gathering and command execution—without being excessive or sparse.

    Completeness4/5

    The set covers CPU, disk, processes, services, and generic command execution. Missing memory or network info, but the core diagnostic and action capabilities are present.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables SSH connectivity and remote command execution on servers, allowing users to test connections and run commands remotely with support for both local networks and public servers.
      2
      16 npm
      1
      ISC
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables remote execution of Linux commands via SSH, supporting system monitoring, file operations, and secure authentication with configurable safety controls.
      4
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables managing Linux servers via SSH with tools for command execution, file operations, service management, and log analysis.
      -