MCP SSH Server 标志

MCP SSH Server

社区
mixelpixx

DEPRECATED — succeeded by SSH-Connect (Rust rewrite): https://github.com/mixelpixx/SSH-Connect

发布者mixelpixx
代码仓库SSH-MCP
语言TypeScript
复刻数
25
星标数
50
可用工具
0
传输类型stdio
分类
链接
  • 将工具接入 AI 工作流

    MCP SSH Server 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 50 个星标和 25 个复刻。

MCP SSH Server

A Model Context Protocol (MCP) server that provides comprehensive SSH and serial console access to remote servers and network devices. Enables AI tools like Claude Desktop to securely manage Linux servers, network switches, and infrastructure devices through both network SSH connections and direct USB-to-Serial console access.

Features

Core SSH Capabilities

  • SSH connection management with password or key-based authentication
  • Remote command execution with timeout handling
  • File upload and download via SFTP
  • Directory listing and file operations
  • Secure connection handling

Network Device Management

  • USB-to-Serial Console Access - Direct console connections via FTDI and other USB adapters
  • Network Switch Management - Full support for Cisco IOS/IOS-XE and Aruba switches
  • Device Discovery - Automatic detection of switch types and capabilities
  • Configuration Management - Backup, restore, and automated configuration
  • Network Diagnostics - Built-in ping, traceroute, and connectivity testing
  • Console-to-SSH Transition - Automated SSH setup via console connection
  • Firmware Management - Upload, verify, install, and rollback switch firmware

Server Management

  • Ubuntu server management tools (Nginx, SSL, packages, firewall)
  • Compatible with Claude Desktop, VS Code, and other MCP-compatible clients

Real-World Production Testing

This tool has been extensively tested in production network environments:

  • Network Discovery - Successfully discovered previously unknown fluttering ports on production switches that were causing intermittent connectivity issues
  • Zero Downtime - Managed multiple switches in live production networks without causing any network disruptions or outages
  • Time Savings - Automated SSH configuration reduced switch setup time from 15-20 minutes to under 2 minutes
  • Reliability - Zero incidents during production deployments across multiple network devices
  • USB-to-Serial Compatibility - Tested with FTDI FT232R/FT232H, Prolific PL2303, Silicon Labs CP2102/CP2104, and CH340 adapters
  • Switch Compatibility - Validated on Cisco Catalyst 2960/3560/3750 and Aruba 2530/2930 series switches

The tool has proven itself reliable enough for production network management tasks without requiring a separate lab environment for testing.

Prerequisites

  • Node.js 18 or higher
  • npm or yarn
  • Compatible with Windows, macOS, and Linux

Installation

  1. Clone the repository:

    bash
    git clone https://github.com/yourusername/mcp-ssh-server.git
    cd mcp-ssh-server
  2. Install dependencies:

    bash
    npm install
  3. Build the project:

    bash
    npm run build
  4. Install globally (optional):

    bash
    npm install -g .

Configuration

Claude Desktop Configuration

  1. Open Claude Desktop
  2. Go to Settings > Developer (or press Ctrl+Shift+D)
  3. Edit the MCP configuration
  4. Add the following configuration:
json
{
  "mcpServers": {
    "ssh-server": {
      "command": "node",
      "args": ["/path/to/mcp-ssh-server/build/index.js"],
      "env": {
        "NODE_NO_WARNINGS": "1"
      }
    }
  }
}

Important: Replace /path/to/mcp-ssh-server/build/index.js with the absolute path to your built index.js file.

VS Code Configuration (if using MCP extension)

Create or edit .vscode/mcp.json in your workspace:

json
{
  "mcpServers": {
    "ssh-server": {
      "command": "node",
      "args": ["/path/to/mcp-ssh-server/build/index.js"]
    }
  }
}

Available Tools

Core SSH Tools

ssh_connect

Establish an SSH connection to a remote server.

Parameters:

  • host (required) - Hostname or IP address
  • username (required) - SSH username
  • password (optional) - SSH password
  • privateKeyPath (optional) - Path to private key file
  • passphrase (optional) - Passphrase for private key
  • port (optional) - SSH port (default: 22)
  • connectionId (optional) - Unique identifier for this connection

Returns:

  • success - Boolean indicating success
  • connectionId - ID to use for subsequent commands
  • message - Connection status message

Example:

Connect to my server at example.com using username 'admin' and password authentication

ssh_exec

Execute a command on the remote server.

Parameters:

  • connectionId (required) - ID from ssh_connect
  • command (required) - Command to execute
  • cwd (optional) - Working directory
  • timeout (optional) - Command timeout in milliseconds (default: 60000)

Returns:

  • code - Exit code
  • signal - Signal that terminated the process (if any)
  • stdout - Standard output
  • stderr - Standard error

Example:

Run "ls -la /var/www/html" on the server

ssh_upload_file

Upload a file to the remote server.

Parameters:

  • connectionId (required) - ID from ssh_connect
  • localPath (required) - Local file path
  • remotePath (required) - Remote destination path

Returns:

  • success - Boolean indicating success
  • message - Upload status message

ssh_download_file

Download a file from the remote server.

Parameters:

  • connectionId (required) - ID from ssh_connect
  • remotePath (required) - Remote file path
  • localPath (required) - Local destination path

Returns:

  • success - Boolean indicating success
  • message - Download status message

ssh_list_files

List files in a directory on the remote server.

Parameters:

  • connectionId (required) - ID from ssh_connect
  • remotePath (required) - Directory path to list

Returns:

  • files - Array of file objects with properties:
    • filename - File name
    • isDirectory - Boolean indicating if it's a directory
    • size - File size
    • lastModified - Last modification time

ssh_disconnect

Close an SSH connection.

Parameters:

  • connectionId (required) - ID from ssh_connect

Returns:

  • success - Boolean indicating success
  • message - Disconnection status message

Usage Examples with Claude

  1. Connect to your server:

    Please connect to my VPS at example.com using username 'admin' and my SSH key at ~/.ssh/id_rsa
  2. Check server status:

    Run the command "systemctl status nginx" to check web server status
  3. Upload a website file:

    Upload my local file ~/websites/index.html to /var/www/html/index.html on the server
  4. List website files:

    Show me all files in the /var/www/html directory
  5. Download a backup:

    Download the file /var/backups/website-backup.tar.gz to my local Downloads folder
  6. Disconnect when done:

    Please disconnect from the SSH session

Network Switch Management Tools

switch_discover_device

Discover and identify network switch device type and capabilities.

Parameters:

  • connectionId (required) - ID of an active SSH connection
  • enablePassword (optional) - Enable password for privileged mode

switch_show_interfaces

Show interface status and configuration on network switch.

Parameters:

  • connectionId (required) - ID of an active SSH connection
  • interfaceType (optional) - Type of interfaces to show
  • enablePassword (optional) - Enable password for privileged mode

switch_show_vlans

Show VLAN configuration and status on network switch.

Parameters:

  • connectionId (required) - ID of an active SSH connection
  • enablePassword (optional) - Enable password for privileged mode

switch_backup_config

Backup switch configuration (running or startup config).

Parameters:

  • connectionId (required) - ID of an active SSH connection
  • configType (optional) - Type of configuration to backup
  • enablePassword (optional) - Enable password for privileged mode

switch_network_diagnostics

Run network diagnostics from switch (ping, traceroute).

Parameters:

  • connectionId (required) - ID of an active SSH connection
  • target (required) - Target IP address or hostname
  • diagnosticType (optional) - Type of diagnostic to run
  • enablePassword (optional) - Enable password for privileged mode

switch_show_mac_table

Show MAC address table on network switch.

Parameters:

  • connectionId (required) - ID of an active SSH connection
  • vlan (optional) - Specific VLAN to show MAC addresses for
  • enablePassword (optional) - Enable password for privileged mode

USB-to-Serial Console Tools

These tools enable direct console access to network devices using USB-to-Serial adapters. This is essential for initial device setup, emergency access when network connectivity is lost, or when SSH has not yet been configured.

Supported USB-to-Serial Adapters:

  • FTDI FT232R/FT232H (recommended - most reliable)
  • Prolific PL2303 (widely compatible)
  • Silicon Labs CP2102/CP2104 (good performance)
  • CH340/CH341 chipsets (budget-friendly option)

All adapters work with standard Cisco/Aruba console cables (RJ45 to DB9 or direct USB).

serial_list_ports

List available USB-to-Serial ports on the system. Automatically detects FTDI, Prolific, Silicon Labs, and CH340 adapters.

Example:

Show me all available serial ports

serial_connect

Connect to a network device via USB-to-Serial console port.

Parameters:

  • port (required) - Serial port name (e.g., COM3 on Windows, /dev/ttyUSB0 on Linux)
  • baudRate (optional) - Baud rate (default: 9600 for most switches)
  • connectionId (optional) - Unique identifier for connection
  • deviceType (optional) - Device type for optimal settings (cisco, aruba, generic)

Example:

Connect to my Cisco switch console on COM3

serial_send_command

Send a command to network device via serial connection.

Parameters:

  • connectionId (required) - ID of an active serial connection
  • command (required) - Command to send to device
  • waitForResponse (optional) - Wait for device response
  • timeout (optional) - Response timeout in milliseconds

Example:

Send "show version" command to the console connection

serial_discover_device

Discover device type and capabilities via serial connection. Automatically identifies Cisco IOS, Cisco IOS-XE, Aruba, and generic devices.

Parameters:

  • connectionId (required) - ID of an active serial connection

Example:

Discover what type of device is connected

serial_list_connections

List all active serial connections.

serial_disconnect

Disconnect from a serial port.

Parameters:

  • connectionId (required) - ID of an active serial connection

Ubuntu Website Management Tools

The following Ubuntu server management tools are available:

  • ubuntu_nginx_control - Web server control (start, stop, restart, status, reload, check-config)
  • ubuntu_update_packages - System package updates with security-only option
  • ubuntu_ssl_certificate - SSL certificate management using Let's Encrypt (issue, renew, status, list)
  • ubuntu_website_deployment - Website deployment with automatic backup and restore
  • ubuntu_ufw_firewall - Firewall (UFW) management (enable, disable, allow, deny, delete)

SSH Setup & Automation Tools

These tools automate the process of configuring SSH access on network switches via console connection, enabling a smooth transition from console-only to SSH-based management.

switch_generate_ssh_config

Generate SSH configuration template for a network switch based on device type and security level.

Parameters:

  • deviceType (optional) - Device type: cisco, aruba (auto-detected if not specified)
  • securityLevel (optional) - Security level: basic, secure (default: basic)
  • hostname (required) - Switch hostname
  • ip_address (required) - Management IP address
  • subnet_mask (optional) - Subnet mask (default: 255.255.255.0)
  • gateway (required) - Default gateway
  • username (required) - SSH username
  • password (required) - SSH password

switch_apply_ssh_config

Apply SSH configuration to a switch via an active serial console connection.

Parameters:

  • serialConnectionId (required) - ID of an active serial connection
  • deviceType (optional) - Device type: cisco, aruba
  • hostname (required) - Switch hostname
  • ip_address (required) - Management IP address
  • gateway (required) - Default gateway
  • username (required) - SSH username
  • password (required) - SSH password
  • confirmApply (required) - Must be true to proceed

switch_verify_ssh_status

Check the current SSH configuration status on a switch via serial connection.

Parameters:

  • serialConnectionId (required) - ID of an active serial connection

switch_test_ssh_connection

Test SSH connectivity to a newly configured switch.

Parameters:

  • ip_address (required) - Switch IP address
  • username (required) - SSH username
  • password (required) - SSH password
  • port (optional) - SSH port (default: 22)

switch_complete_ssh_setup

Complete end-to-end SSH setup workflow via console connection. This automates the entire process of configuring SSH on a switch.

Parameters:

  • serialConnectionId (required) - ID of an active serial connection
  • hostname (required) - Switch hostname
  • ip_address (required) - Management IP address
  • gateway (required) - Default gateway
  • username (required) - SSH username
  • password (required) - SSH password
  • confirmSetup (required) - Must be true to proceed

Console-to-SSH Transition Tools

console_to_ssh_transition

Complete automated workflow to transition a network switch from console-only access to SSH management. This is the recommended tool for initial switch setup.

Parameters:

  • port (required) - Serial port (e.g., COM3, /dev/ttyUSB0)
  • hostname (required) - Switch hostname
  • ip_address (required) - Management IP address
  • gateway (required) - Default gateway
  • username (required) - SSH username
  • password (required) - SSH password
  • deviceType (optional) - Device type: cisco, aruba (auto-detected if not specified)
  • confirmTransition (required) - Must be true to proceed

Example:

Set up SSH on my Cisco switch connected to COM3 with hostname "switch-core-01", IP 192.168.1.10, gateway 192.168.1.1, username "admin"

quick_ssh_check

Quick check of SSH status on a switch via serial connection without making any changes.

Parameters:

  • port (required) - Serial port
  • baudRate (optional) - Baud rate (default: 9600)
  • enablePassword (optional) - Enable password if required

Firmware Management Tools

These tools provide comprehensive firmware management capabilities for network switches, including version checking, firmware upload, verification, installation, and rollback preparation.

switch_check_firmware

Check the current firmware version and system information on a network switch.

Parameters:

  • connectionId (required) - ID of an active SSH connection
  • enablePassword (optional) - Enable password for privileged mode

Returns:

  • Current firmware version
  • Boot version
  • Device model and serial number
  • System uptime
  • Full version output

switch_check_storage

Verify available storage space on the switch before firmware upload.

Parameters:

  • connectionId (required) - ID of an active SSH connection
  • enablePassword (optional) - Enable password for privileged mode

Returns:

  • Flash storage information
  • Available space
  • File system details

switch_upload_firmware

Upload a firmware file to the network switch via SFTP. Supports large firmware files with 30-minute timeout.

Parameters:

  • connectionId (required) - ID of an active SSH connection
  • localFirmwarePath (required) - Local path to firmware file
  • remotePath (optional) - Remote path on switch (default: flash:/filename)
  • enablePassword (optional) - Enable password for privileged mode

Example:

Upload firmware file ~/downloads/c2960-lanbasek9-mz.150-2.SE11.bin to the switch

switch_verify_firmware

Verify the integrity of an uploaded firmware file on the switch using MD5 checksums.

Parameters:

  • connectionId (required) - ID of an active SSH connection
  • firmwarePath (required) - Path to firmware file on switch
  • enablePassword (optional) - Enable password for privileged mode

Returns:

  • Verification status
  • MD5 checksum results
  • File information

switch_install_firmware

Install firmware on the switch and optionally reboot to apply the update.

Parameters:

  • connectionId (required) - ID of an active SSH connection
  • firmwarePath (required) - Path to firmware file on switch
  • enablePassword (optional) - Enable password for privileged mode
  • autoReboot (optional) - Automatically reboot after installation (default: false)

Important: This modifies the boot configuration. Test in a lab environment first!

Example:

Install firmware flash:/c2960-lanbasek9-mz.150-2.SE11.bin and reboot the switch

switch_prepare_rollback

Prepare information needed for firmware rollback in case of issues with new firmware.

Parameters:

  • connectionId (required) - ID of an active SSH connection
  • enablePassword (optional) - Enable password for privileged mode

Returns:

  • Current boot configuration
  • Available firmware images
  • Rollback instructions

USB-to-Serial Console Setup

Hardware Requirements

USB-to-Serial Adapters:

  • FTDI-based adapters (FT232R, FT232H) - Best choice for reliability
  • Prolific PL2303 - Widely available and compatible
  • Silicon Labs CP2102/CP2104 - Good performance and stability
  • CH340/CH341 - Budget option, works well on most systems

Console Cables:

  • Cisco console cable (RJ45 to DB9 or USB)
  • Aruba/HP console cable (RJ45 to DB9 or USB)
  • Universal console cables work with most devices

Driver Installation

Windows:

  • FTDI drivers: Usually auto-installed, or download from ftdichip.com
  • Prolific drivers: Available from prolific.com.tw
  • Silicon Labs drivers: Download from silabs.com
  • CH340 drivers: Usually included in Windows 10/11, or download separately

macOS:

  • FTDI adapters: Usually work out-of-the-box
  • Other adapters: May require driver installation from manufacturer

Linux:

  • Most adapters work immediately with kernel drivers
  • FTDI, Silicon Labs, CH340: Built into kernel
  • Check dmesg after plugging in adapter to verify detection

Quick Start with Console

  1. Connect USB-to-Serial adapter to your computer
  2. Connect console cable from adapter to switch console port
  3. List available ports: "Show me available serial ports"
  4. Connect to port: "Connect to COM3 for Cisco switch"
  5. Send commands or run automated setup

Security Notes

  • Store SSH private keys securely
  • Use key-based authentication when possible
  • Limit SSH access to specific IP addresses
  • Keep your server updated
  • Use strong passwords or passphrases (minimum 8 characters)
  • Secure physical access to console ports and USB-to-Serial adapters
  • Consider setting up environment variables in a .env file for sensitive information

Troubleshooting

Server won't start

  • Check that Node.js is installed: node --version
  • Verify all dependencies are installed: npm install
  • Rebuild the project: npm run build

Connection issues

  • Verify SSH server is running on the target
  • Check firewall settings
  • Confirm credentials are correct
  • Test SSH connection manually first

Claude Desktop integration

  • Ensure the path in configuration is absolute
  • Restart Claude Desktop after configuration changes
  • Check Developer Console for error messages

Development

To modify or extend the server:

  1. Edit source files in src/
  2. Rebuild: npm run build
  3. Test your changes
  4. Restart Claude Desktop or VS Code to pick up changes

Running in Development Mode

For quick testing during development:

bash
npm run dev

Contributing

Contributions for additional tools and features are welcome. Please feel free to submit pull requests or open issues for enhancements and bug fixes.

License

MIT License

安装

TypingMind
前提条件:

Node.js 18+

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

将 MCP SSH Server MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 MCP SSH Server 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请勿关闭终端窗口或停止其中的连接器进程。
3

将 MCP SSH Server 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 MCP SSH Server MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "mixelpixx-ssh-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-ssh-server"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 MCP SSH Server MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 MCP SSH Server MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 MCP SSH Server 帮我完成这项任务吗?
MCP SSH Server
当然,我看过了。
以下是我使用 MCP SSH Server 得到的结果。

常见问题

MCP SSH Server MCP 服务器有什么用途?

MCP SSH Server 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 MCP SSH Server MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您无需为每个模型单独配置 MCP 服务器,就能在 Claude、ChatGPT、Gemini 或您在 TypingMind 中配置的其他 AI 模型中使用 MCP SSH Server。

为什么在 TypingMind 中使用 MCP SSH Server MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是最出色的大语言模型聊天前端之一。连接 MCP SSH Server 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 MCP SSH Server MCP 连接到 TypingMind?

MCP SSH Server 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

MCP SSH Server MCP 在 TypingMind 中提供哪些工具?

MCP SSH Server 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 MCP SSH Server MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行选择模型提供商,并自行管理 API 密钥、提示词和 MCP 配置。如果 MCP SSH Server 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇