ZS

zibdie/ssh-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

2 stars 7 forks 质量 66 趋势 8MIT

A MCP server written to SSH into a specified server, fully written in Nodejs

概览

A cross-platform Model Context Protocol (MCP) server that provides SSH connectivity tools. This server enables AI assistants to securely connect to and execute commands on remote servers via SSH. - : Works on Windows, macOS, and Linux - : Username/password and SSH key authentication - : Connect to servers using either IP version - : Manage multiple SSH connections simultaneously - : Upload, download, and list files via SFTP - : Run bash, python, and other scripts remotely - : Uses the robust ssh2 library for secure connections - : Works with Claude CLI, Claude Desktop, and other MCP clients This auto-detects your OS and registers the MCP server with the correct configuration for your platform. On Windows, npx is a batch file (npx.cmd). Claude Code launches MCP servers using Node.js child_process.spawn(), which cannot execute .cmd files directly. The cmd /c wrapper tells Windows to run it through the command interpreter. : Edit ~/.config/claude/claude_desktop_config.

README

以下为原文 README 节选,完整内容请查看原文。

SSH MCP Server

A cross-platform Model Context Protocol (MCP) server that provides SSH connectivity tools. This server enables AI assistants to securely connect to and execute commands on remote servers via SSH.

Features

  • Cross-platform compatibility: Works on Windows, macOS, and Linux
  • Multiple authentication methods: Username/password and SSH key authentication
  • IPv4 and IPv6 support: Connect to servers using either IP version
  • Multiple connections: Manage multiple SSH connections simultaneously
  • Comprehensive file operations: Upload, download, and list files via SFTP
  • Script execution: Run bash, python, and other scripts remotely
  • Secure: Uses the robust ssh2 library for secure connections
  • MCP compatible: Works with Claude CLI, Claude Desktop, and other MCP clients

Installation & Setup

  1. Add to Claude CLI with one command (cross-platform):

    npx @zibdie/ssh-mcp-server@latest --install
    

    This auto-detects your OS and registers the MCP server with the correct configuration for your platform.

    Or manually, if you prefer:

    macOS/Linux:

    claude mcp add ssh-mcp-server -- npx '@zibdie/ssh-mcp-server@latest'
    

    Windows:

    claude mcp add ssh-mcp-server -- cmd /c npx @zibdie/ssh-mcp-server@latest
    

    Why the difference? On Windows, npx is a batch file (npx.cmd). Claude Code launches MCP servers using Node.js child_process.spawn(), which cannot execute .cmd files directly. The cmd /c wrapper tells Windows to run it through the command interpreter.

  2. Restart Claude CLI

  3. Test the connection:

    "Connect to my server at example.com with username myuser"
    

Alternative: Manual Installation

For Claude CLI

  1. Install globally:

    npm install -g @zibdie/ssh-mcp-server
    
  2. Add to configuration:

    macOS/Linux: Edit ~/.config/claude/claude_desktop_config.json

    {
      "mcpServers": {
        "ssh-mcp-server": {
          "command": "ssh-mcp-server"
        }
      }
    }
    

    Windows: Edit %APPDATA%\Claude\claude_desktop_config.json

    {
      "mcpServers": {
        "ssh-mcp-server": {
          "command": "cmd",
          "args": ["/c", "ssh-mcp-server"]
        }
      }
    }
    

For Claude Desktop

  1. Install globally:

    npm install -g @zibdie/ssh-mcp-server
    
  2. Add to configuration:

在 GitHub 查看完整 README

安装

npx @zibdie/ssh-mcp-server@latest --install
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "ssh-mcp-server": { "command": "ssh-mcp-server" } } }