MS

mingyang91/ssh-mcp

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

6 stars 8 forks 품질 52 트렌드 14

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.

개요

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. - 🚀 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 - : Connect to SSH servers via MCP commands - : Run commands on remote SSH servers - : Setup SSH tunnels and port forwards (enabled by default via the port_forward feature) - : Track and manage multiple SSH sessions - : Built with poem-mcpserver to enable AI/LLM compatibility - : Maintain SSH sessions across multiple commands No Rust toolchain required - just Docker! Prerequisites: - Rust 1.70.0 or later - Cargo package manager To use SSH-MCP with mcpServers, add the following configuration to your mcpServers JSON configuration: This will register the SSH handler, allowing LLMs to manage SSH connections through your MCP server.

README

원문 README의 일부입니다. 원문 보기.

SSH-MCP Server

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 [email protected]:22",
  "authenticated": true
}

If connection fails:

{
  "error": "Failed to connect: Connection refused"
}
GitHub에서 전체 README 보기

설치

docker run --entrypoint ssh-mcp-stdio -i --rm ssh-mcp
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

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