Skip to main content
Glama

mcp-ssh

MCP сервер для подключения по SSH и выполнения команд на удалённом сервере.

Быстрый старт

  1. Установите зависимости:

  • npm install

  1. Создайте .env на основе .env.example и задайте параметры подключения.

  2. Запустите в режиме разработки:

  • npm run dev

Или соберите и запустите:

  • npm run build

  • npm start

Related MCP server: SSH MCP Server

Запуск через docker-compose

  1. Создайте .env на основе .env.example.

  2. Запустите сервис:

  • docker compose up -d

Сервис работает по stdio (MCP), проброс портов не требуется.

Доступные инструменты MCP

ssh_connect

Создаёт SSH сессию.

Параметры:

  • host (string, optional)

  • port (number, optional)

  • username (string, optional)

  • privateKey (string, optional)

  • privateKeyPath (string, optional)

  • password (string, optional)

  • connectTimeoutMs (number, optional)

Возвращает: sessionId, host, port, username.

ssh_exec

Выполняет команду в существующей сессии.

Параметры:

  • sessionId (string)

  • command (string)

  • cwd (string, optional)

  • timeoutMs (number, optional)

Возвращает: stdout, stderr, exitCode, exitSignal.

ssh_disconnect

Закрывает сессию.

Параметры:

  • sessionId (string)

Возвращает: disconnected.

ssh_list_sessions

Возвращает список активных сессий.

Ограничение хостов

Если задан MCP_SSH_ALLOWED_HOSTS, подключение разрешено только к хостам из списка.

Available Tools

4 tools
ssh_connectC

Подключение по SSH и создание сессии

Inputs: connectTimeoutMs.

ssh_disconnectD

Отключение SSH сессии

Inputs: sessionId (required).

ssh_execB

Выполнение команды по SSH в существующей сессии или одноразово

Inputs: command (required), sessionId, cwd, timeoutMs.

ssh_list_sessionsB

Список активных SSH сессий

Inputs: no named parameters.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap: ssh_connect establishes sessions, ssh_disconnect terminates them, ssh_exec runs commands, and ssh_list_sessions enumerates active sessions. The descriptions reinforce these boundaries, making misselection unlikely.

    Naming Consistency5/5

    All tool names follow a consistent 'ssh_verb' pattern with snake_case, using clear action verbs like connect, disconnect, exec, and list_sessions. This predictability aids agent understanding and tool selection.

    Tool Count5/5

    With 4 tools, the server is well-scoped for SSH management, covering core operations: establishing, managing, using, and monitoring sessions. Each tool earns its place without bloat or thinness for the domain.

    Completeness5/5

    The tool set provides complete lifecycle coverage for SSH sessions: connect, disconnect, execute commands, and list sessions. There are no obvious gaps, as all essential operations for remote command execution and session management are included.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables seamless SSH operations including secure connections, file transfers, interactive shell sessions, and Docker container management on remote servers. Supports both password and SSH key authentication with credential management and connection pooling.
      18
      MIT
    • 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
      A
      quality
      D
      maintenance
      Enables secure SSH connections to multiple remote servers with support for command execution, file transfers (SFTP), directory listing, and both password and key-based authentication.
      7
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables remote server management through SSH and SFTP, supporting command execution, file transfers, and interactive shell sessions. It allows for multiple concurrent connections using either password or SSH key authentication.
      11
      31 npm
      5
      MIT