Skip to main content
Glama

SSH-MCP

SSH-MCP is a self-hosted Model Context Protocol server for audited SSH commands, bounded file operations and operator-controlled access. OAuth-protected clients select explicitly allowed SSH hosts; the service uses pinned host keys and the remote account's existing permissions.

This project is licensed under Apache-2.0. Build the published source and use the getting started guide to configure a trusted HTTPS reverse proxy, OAuth and a dedicated SSH account. Public prebuilt container image availability will be announced separately.

What it does

  • Execute synchronous commands, durable asynchronous jobs and sequential batches; inspect bounded results after disconnects.

  • Request eligible job/batch cancellation, preserving uncertain-outcome status.

  • Read/write text, preview/apply multi-file patches and transfer bounded binary files (native upload currently requires a ChatGPT attachment).

  • Require operator decisions for restricted hosts or privileged execution, with scoped and expiring access grants.

  • Display history, approvals and cancellation in the password-protected Operator Console (/console).

SSH-MCP is not a remote shell sandbox. Authorize only dedicated least-privilege accounts on hosts you explicitly trust.

Related MCP server: ssh-mcp

Choose a Docker Compose example

SSH-MCP needs a trusted HTTPS reverse proxy, but it does not require Caddy. First configure the application; then choose an HTTPS setup appropriate to your infrastructure.

Example

When to use

Public HTTPS

Basic

You already have HAProxy, Nginx, Traefik or another HTTPS proxy on the same Linux host

Bring your own proxy

Caddy

You do not have a proxy and want automatic HTTPS certificates

Bundled optional Caddy

Hardened

You have an existing HTTPS proxy and want tighter container isolation

Bring your own proxy

Start with Getting started. Basic and hardened Compose bind application HTTP only to 127.0.0.1 and require Docker Engine 28.0.0 or newer for safe loopback port isolation. Older Engine releases can expose localhost-published ports to the same Layer 2 network; do not use these examples on older versions without an independently reviewed host firewall policy. They are not public HTTPS endpoints on their own. The optional Caddy example publishes only ports 80/443 and keeps the app on its private bridge.

For all three: protect private environment files, supply a dedicated SSH identity, independently verify pinned host keys, enable OAuth, restrict the remote SSH account and retain audit history. The hardening example adds defense in depth; it does not replace authentication.

Documentation

Topic

Guide

Start with one application container

Getting started

Existing HTTPS proxy or optional Caddy

HTTPS and reverse proxies

Additional container restrictions

Hardening

Settings and inventory

Configuration

OAuth client login

OAuth clients

Trust and security boundaries

Security

Commands and jobs

Commands and jobs

Browser history

Operator Console

File operations and edits

File operations, Patch workflows

Backups, monitoring, fixes

Operations, Troubleshooting

Compatibility and development

For upgrades from earlier installations, preserve the persistent database, signed policy and SSH host-key trust. Read Upgrade compatibility before changing image or state paths.

Development uses Python 3.12; repository validation checks Ruff, strict mypy, installed-wheel tests, at least 95% combined coverage and a hardened OCI image. Offline checks do not substitute for separately authorized real HTTPS/SSH acceptance.

Contributing and security

See Contributing for local validation and pull requests, and Security policy for private vulnerability reporting.

License

SSH-MCP is licensed under the Apache License 2.0. See third-party notices for dependency licensing. For maintainers: Docker Hub publishing.

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables human-approved SSH terminal sessions and confined SFTP file operations for SSH-configured devices, with user-controlled terminal and file explorer.
      AGPL 3.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to execute SSH commands and transfer files via SFTP through a centralized HTTP gateway with per-client authorization, layered command policies, audit logging, rate limiting, circuit breakers, and connection pooling.
      9
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables secure execution of arbitrary commands on remote hosts via SSH with OIDC authentication, allowlisted access, and dynamically injected private keys.
      24 npm
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables LLM agents to run commands, manage interactive or background sessions, and transfer files on remote hosts under policy-based authorization, command classification, approval gates, and full audit logging. Supports per-host profiles with role-based rules, streaming file transfers that keep bytes out of model context, and a configurable approval policy for destructive or privileged work.
      14
      MIT