Get the FREE Ultimate OpenClaw Setup Guide →

ssh-connect

An MCP server for SSH connections and file operations.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio t-suganuma-ssh-connect-mcp-server uv --directory /path/to/ssh-connect run ssh-connect \
  --env SSH_HOST="example.com" \
  --env SSH_PORT="22" \
  --env SSH_KEY_PATH="/path/to/private_key" \
  --env SSH_PASSWORD="password" \
  --env SSH_USERNAME="username" \
  --env SSH_KEY_PASSPHRASE="key_passphrase"

How to use

This MCP server provides a set of SSH-related tools that allow you to connect to an SSH server, execute commands, and transfer files. The available tools are: connect to establish an SSH session with optional overrides for host, port, username, password, key_path, and key_passphrase; disconnect to end the session; execute to run a command on the remote server and receive stdout, stderr, and exit status; upload to send a local file to the remote host; download to retrieve a file from the remote host; and list_files to enumerate files in a remote directory with type and size details. To use these tools, configure the SSH connection parameters via MCP environment variables (SSH_HOST, SSH_PORT, SSH_USERNAME, SSH_PASSWORD or SSH_KEY_PATH, and optionally SSH_KEY_PASSPHRASE) in your MCP settings, then invoke the tools through the MCP interface. The server returns structured results for each operation, making it straightforward to script SSH workflows within your application or automation pipeline.

How to install

Prerequisites:

  • Python 3.8+ and pip (if using uvx/uv build path) or the appropriate runtime for your environment
  • Access to install Python dependencies as needed by the ssh-connect project

Installation steps:

  1. Install the MCP server runner (assuming uv/uvx is used in this project):
    • Ensure uv is available in your environment
  2. Clone or download the ssh-connect MCP server repository and navigate to its directory.
  3. Install Python dependencies (if required by the project):
    • python -m pip install -r requirements.txt
  4. Prepare configuration file (example mcp-config.json) with the ssh-connect MCP server block as shown in the README:
    {
      "mcpServers": {
        "ssh-connect": {
          "command": "uv",
          "args": [
            "--directory",
            "/path/to/ssh-connect",
            "run",
            "ssh-connect"
          ],
          "env": {
            "SSH_HOST": "example.com",
            "SSH_PORT": "22",
            "SSH_USERNAME": "username",
            "SSH_PASSWORD": "password",
            "SSH_KEY_PATH": "/path/to/private_key",
            "SSH_KEY_PASSPHRASE": "key_passphrase"
          }
        }
      }
    }
    
  5. Run the MCP server configuration using your chosen runtime (examples below):
    • Using uv: uv run --config mcp-config.json
    • Using npm-based runner if applicable: npm run start
  6. Verify the SSH MCP server is reachable via MCP tooling and begin issuing commands. Note: If you use SSH key authentication, ensure SSH_KEY_PATH points to a valid private key and SSH_PASSWORD is omitted or empty.

Additional notes

Tips and common issues:

  • Ensure that SSH_HOST, SSH_USERNAME, and either SSH_PASSWORD or SSH_KEY_PATH are provided; SSH_KEY_PATH is used for key-based auth, while SSH_PASSWORD is used for password-based auth.
  • If you encounter connection failures, check network reachability to SSH_HOST:SSH_PORT from the MCP host and confirm that the SSH server accepts the authentication method you configured.
  • When using file upload/download, verify remote_path and local_path permissions and ensure the MCP process has access to the paths.
  • For debugging, enable verbose logging in the MCP runner and consult any inspector tooling recommended by the MCP ecosystem to view stdio exchanges.
  • If you switch between environments (e.g., local development vs. production), update SSH_HOST and related env vars accordingly in the mcp-config.json.

Related MCP Servers

Sponsor this space

Reach thousands of developers