MCP ExplorerExplorer

My Mcp Ssh

@ffpyon 9 months ago
1 Apache-2.0
FreeCommunity
AI Systems
MCP-based SSH tool for LLMs to interact with remote servers.

Overview

What is My Mcp Ssh

my-mcp-ssh is an MCP-based SSH tool designed for large language models (LLMs) to securely connect to remote servers and perform file operations through the MCP protocol.

Use cases

Use cases include automating file transfers, executing remote commands for data processing, and managing remote server sessions securely.

How to use

To use my-mcp-ssh, configure the client with the necessary SSH connection parameters in a JSON format, set environment variables for SSH credentials, and run the tool using the command line.

Key features

Key features include SSH connection management, command execution on remote servers, file transfer capabilities, and session management.

Where to use

my-mcp-ssh can be used in various fields such as cloud computing, remote server management, and automation tasks for large language models.

Content

my-mcp-ssh

EN doc
CN doc

A Model Context Protocol (MCP) based SSH connection tool that allows large language models to securely connect to remote servers via SSH and perform file operations through the MCP protocol.

Features

  • SSH Connection Management: Connect to remote SSH servers
  • Command Execution: Execute commands on remote servers
  • File Transfer: Upload and download files
  • Session Management: Maintain and close SSH sessions

Installation

Dependencies

  • Python >= 3.12
  • uv package manager
# Clone the project
git clone https://github.com/ffpy/my-mcp-ssh.git

# Enter the project directory
cd my-mcp-ssh

# Install dependencies
uv sync

Usage

Configure in client

{
  "mcpServers": {
    "my-mcp-ssh": {
      "command": "uv",
      "args": [
        "--directory",
        "<your_path>/my-mcp-ssh",
        "run",
        "src/main.py"
      ],
      "env": {}
    }
  }
}

Environment Variables

SSH connection parameters can be configured through environment variables:

  • SSH_HOST: SSH server hostname or IP address
  • SSH_PORT: SSH server port
  • SSH_USERNAME: SSH username
  • SSH_PASSWORD: SSH password (if using password authentication)
  • SSH_KEY_PATH: SSH private key file path (if using key authentication)
  • SSH_KEY_PASSPHRASE: SSH private key passphrase (if needed)
  • SESSION_TIMEOUT: Session timeout in minutes, default is 30 minutes
  • MAX_OUTPUT_LENGTH: Maximum command output length in characters, default is 5000 characters

Tool List

connect

Connect to an SSH server

Parameters:

  • host: SSH server hostname or IP address, defaults to SSH_HOST environment variable
  • port: SSH server port, defaults to SSH_PORT environment variable or 22
  • username: SSH username, defaults to SSH_USERNAME environment variable
  • password: SSH password, defaults to SSH_PASSWORD environment variable
  • key_path: SSH private key file path, defaults to SSH_KEY_PATH environment variable or ~/.ssh/id_rsa
  • key_passphrase: SSH private key passphrase, defaults to SSH_KEY_PASSPHRASE environment variable

disconnect

Disconnect from an SSH session

Parameters:

  • session_id: The session ID to disconnect

list_sessions

List all active SSH sessions

Parameters:

  • None

execute

Execute a command on the SSH server

Parameters:

  • session_id: Session ID
  • command: Command to execute
  • stdin: Input string to provide to the command, default is empty
  • timeout: Command timeout in seconds, default is 60 seconds

upload

Upload a file to the SSH server

Parameters:

  • session_id: Session ID
  • local_path: Local file path
  • remote_path: Remote file path

download

Download a file from the SSH server

Parameters:

  • session_id: Session ID
  • remote_path: Remote file path
  • local_path: Local file path

Debugging

Run ./inspector.sh for online debugging

License

my-mcp-ssh is licensed under the Apache License, Version 2.0

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers