SSH-MCP: an SSH client server with Model Context Protocol integration

SSH-MCP: an SSH client server with Model Context Protocol integration

ssh-mcp-mingyang91•bymingyang91

A lightweight Rust SSH client MCP server that lets LLMs connect to SSH servers, run remote commands, set up port forwarding, and manage multiple sessions via password, key, or SSH agent authentication.

License: MIT License•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Connects to remote SSH servers using password, private key, or SSH agent authentication, returning a session identifier.
  • •Executes commands on remote SSH servers within an established session and returns stdout, stderr, and exit code.
  • •Sets up SSH tunnels and port forwards between a local port and a remote address.
  • •Tracks multiple stateful SSH sessions and supports listing and disconnecting them.

BEST FOR

  • •Letting an LLM run commands on a remote server over SSH through MCP.
  • •Accessing internal services by having an LLM set up SSH port forwarding tunnels.
  • •Maintaining persistent SSH connections across a sequence of commands in an AI-assisted workflow.

ABOUT SSH-MCP-MINGYANG91

SSH-MCP: an SSH client server with Model Context Protocol integration is cataloged as an MCP server attributed to mingyang91. A lightweight Rust SSH client MCP server that lets LLMs connect to SSH servers, run remote commands, set up port forwarding, and manage multiple sessions via password, key, or SSH agent authentication. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for SSH-MCP: an SSH client server with Model Context Protocol integration are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

How does SSH-MCP help LLMs use SSH?

It exposes SSH client capabilities as MCP commands so LLMs can connect to SSH servers, execute commands, and manage sessions.

Is port forwarding enabled by default?

Yes, port forwarding is enabled by default through the port_forward Cargo feature.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 76537d5d5e84 · 采集于 2026-11-13 10:28:55 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

SSH-MCP Server

Crates.io Version Docker Image Version

A Rust implementation of an SSH client server with Model Context Protocol (MCP) integration, allowing Large Language Models (LLMs) to connect to a SSH server and utilize SSH features.

Lightweight and Efficient:

  • 🚀 ssh-mcp: only 4.3MB binary size, 1.8MB memory footprint
  • 🔄 ssh-mcp-stdio: only 1.5MB binary size, 2.3MB memory usage
  • 🐳 docker: only 27.5MB final image size

Features

  • SSH Client Integration: Connect to SSH servers via MCP commands
  • SSH Command Execution: Run commands on remote SSH servers
  • Port Forwarding: Setup SSH tunnels and port forwards (enabled by default via the port_forward feature)
  • Session Management: Track and manage multiple SSH sessions
  • MCP Protocol Support: Built with poem-mcpserver to enable AI/LLM compatibility
  • Stateful Connections: Maintain SSH sessions across multiple commands

Installation and Integration

You have two options for installation:

No Rust toolchain required - just Docker!

# Pull the pre-built image from Docker Hub
docker pull mingyang91/ssh-mcp

# Run the server
docker run -p 8000:8000 mingyang91/ssh-mcp

Or build the image yourself:

# Build the Docker image
docker build -t ssh-mcp .

# Run the server
docker run -p 8000:8000 ssh-mcp

Option 2: Installing via Cargo

Prerequisites:

  • Rust 1.70.0 or later
  • Cargo package manager
cargo install ssh-mcp

Integration with mcpServers

To use SSH-MCP with mcpServers, add the following configuration to your mcpServers JSON configuration:

If installed via Cargo:

{
  "mcpServers": {
    "ssh": {
      "command": "ssh-mcp-stdio", 
      "args": []
    }
  }
}

If using Docker:

{
  "mcpServers": {
    "ssh": {
      "command": "docker",
      "args": ["run", "--entrypoint", "ssh-mcp-stdio", "-i", "--rm", "ssh-mcp"]
    }
  }
}

This will register the SSH handler, allowing LLMs to manage SSH connections through your MCP server.

Usage

Connecting to an SSH Server

Using Password Authentication

{
  "command": "ssh_connect",
  "params": {
    "address": "example.com:22",
    "username": "user",
    "password": "password"
  }
}

Using Key Authentication

{
  "command": "ssh_connect",
  "params": {
    "address": "example.com:22",
    "username": "user",
    "key_path": "/path/to/private_key"
  }
}

Using SSH Agent Authentication

{
  "command": "ssh_connect",
  "params": {
    "address": "example.com:22",
    "username": "user"
  }
}

Response:

{
  "session_id": "c8a3b2e1-4f5d-6e7c-8a9b-0c1d2e3f4a5b",
  "message": "Successfully connected to user@example.com:22",
  "authenticated": true
}

If connection fails:

{
  "error": "Failed to connect: Connection refused"
}

Executing Commands

{
  "command": "ssh_execute",
  "params": {
    "session_id": "c8a3b2e1-4f5d-6e7c-8a9b-0c1d2e3f4a5b",
    "command": "ls -la"
  }
}

Response:

{
  "stdout": "total 32\ndrwxr-xr-x  5 user group 4096 Jan 1 12:00 .\ndrwxr-xr-x 25 user group 4096 Jan 1 12:00 ..\n-rw-r--r--  1 user group  142 Jan 1 12:00 file.txt\n",
  "stderr": "",
  "exit_code": 0
}

Setting Up Port Forwarding

Note: Port forwarding is enabled by default via the port_forward feature flag.

{
  "command": "ssh_forward",
  "params": {
    "session_id": "c8a3b2e1-4f5d-6e7c-8a9b-0c1d2e3f4a5b",
    "local_port": 8080,
    "remote_address": "internal-server",
    "remote_port": 80
  }
}

Response:

{
  "local_address": "127.0.0.1:8080",
  "remote_address": "internal-server:80",
  "active": true
}

Disconnecting a Session

{
  "command": "ssh_disconnect",
  "params": {
    "session_id": "c8a3b2e1-4f5d-6e7c-8a9b-0c1d2e3f4a5b"
  }
}

Response:

"Session c8a3b2e1-4f5d-6e7c-8a9b-0c1d2e3f4a5b disconnected successfully"

Listing All Active Sessions

{
  "command": "ssh_list_sessions"
}

Response:

[
  "c8a3b2e1-4f5d-6e7c-8a9b-0c1d2e3f4a5b",
  "d9b4c3a2-5e6f-7g8h-9i0j-1k2l3m4n5o6p"
]

Configuration

The server can be configured through the following environment variables:

VariableDescriptionDefault
MCP_PORTPort for the MCP server8000
RUST_LOGLogging levelinfo

Features Configuration

The project uses Cargo features to enable/disable certain functionality:

FeatureDescriptionDefault
port_forwardEnables SSH port forwarding supportEnabled

To build without port forwarding:

cargo build --release --no-default-features

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

CI/CD Pipeline

This project uses GitHub Actions for continuous integration and deployment:

  • All PRs and commits to main are automatically tested
  • Tagged releases (starting with 'v') are automatically published to crates.io
  • Docker images are automatically built and pushed to Docker Hub
    • Latest tag for main branch
    • Version tags for semantic versioned releases (v1.0.0, v1.0, etc.)
  • To create a new release, ensure version in Cargo.toml matches the tag (e.g., v0.1.0)
  • You'll need to set up the CARGO_REGISTRY_TOKEN, DOCKERHUB_USERNAME, and DOCKERHUB_TOKEN secrets in your GitHub repository settings

License

This project is licensed under the MIT License - see the LICENSE file for details.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for SSH-MCP: an SSH client server with Model Context Protocol integration from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/ssh-mcp-mingyang91)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools