The SSH MCP server enables AI tools like Claude Desktop to securely manage remote servers and network devices through SSH and serial console connections, providing comprehensive infrastructure management capabilities.
Core SSH Operations:
Connection Management: Establish SSH connections with password or key-based authentication (including passphrase support for encrypted keys), custom ports, and connection IDs
Remote Command Execution: Run commands with configurable working directory, timeout settings, and sudo support for privileged operations
File Operations: Upload/download files via SFTP and list directory contents with detailed file information
Ubuntu Server Management:
Nginx Control: Start, stop, restart, reload, check status, and validate configuration
Package Management: Update and upgrade system packages with security-only updates and automatic cleanup options
SSL Certificates: Issue, renew, check status, and list Let's Encrypt certificates with automatic domain verification
Website Deployment: Deploy files with automatic backup creation and restore capabilities
UFW Firewall: Configure rules including enable/disable, allow/deny, and protocol-specific settings
Network Device Management:
Console Access: Connect via USB-to-Serial adapters (FTDI, Prolific, Silicon Labs, CH340)
Device Operations: Discover switch types, show interfaces/VLANs/MAC tables, backup configurations, and run network diagnostics (ping/traceroute)
Automated SSH Setup: Console-to-SSH transition for switches, reducing setup time from 15-20 minutes to under 2 minutes
Firmware Management: Check versions, verify storage, upload firmware via SFTP, verify integrity, install updates, and prepare rollback procedures
Compatibility: Tested with Cisco Catalyst 2960/3560/3750 and Aruba 2530/2930 series switches
Production Reliability: Proven in live network environments with zero downtime incidents during deployments
Planned integration for Apache web server control in future enhancements
Support for .env files to store sensitive configuration information
Supports git for repository management including cloning the MCP server
Repository hosting for the MCP server code
Planned integration for SSL certificate management with Let's Encrypt
Compatible with Linux operating systems for running the MCP server
Compatible with macOS operating systems for running the MCP server
Provides tools to check NGINX server status and planned integration for Nginx web server control
Supports Node.js 18 or higher as a requirement for running the MCP server
Support for Ubuntu website management tools including system package updates and server administration
Planned integration for WordPress management on remote servers
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SSH MCPconnect to my server at example.com using username 'admin' and password authentication"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Related MCP server: MISP-MCP-SERVER
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
Clone the repository:
git clone https://github.com/yourusername/mcp-ssh-server.git cd mcp-ssh-serverInstall dependencies:
npm installBuild the project:
npm run buildInstall globally (optional):
npm install -g .
Configuration
Claude Desktop Configuration
Open Claude Desktop
Go to Settings > Developer (or press Ctrl+Shift+D)
Edit the MCP configuration
Add the following configuration:
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:
Available Tools
Core SSH Tools
ssh_connect
Establish an SSH connection to a remote server.
Parameters:
host(required) - Hostname or IP addressusername(required) - SSH usernamepassword(optional) - SSH passwordprivateKeyPath(optional) - Path to private key filepassphrase(optional) - Passphrase for private keyport(optional) - SSH port (default: 22)connectionId(optional) - Unique identifier for this connection
Returns:
success- Boolean indicating successconnectionId- ID to use for subsequent commandsmessage- Connection status message
Example:
ssh_exec
Execute a command on the remote server.
Parameters:
connectionId(required) - ID from ssh_connectcommand(required) - Command to executecwd(optional) - Working directorytimeout(optional) - Command timeout in milliseconds (default: 60000)
Returns:
code- Exit codesignal- Signal that terminated the process (if any)stdout- Standard outputstderr- Standard error
Example:
ssh_upload_file
Upload a file to the remote server.
Parameters:
connectionId(required) - ID from ssh_connectlocalPath(required) - Local file pathremotePath(required) - Remote destination path
Returns:
success- Boolean indicating successmessage- Upload status message
ssh_download_file
Download a file from the remote server.
Parameters:
connectionId(required) - ID from ssh_connectremotePath(required) - Remote file pathlocalPath(required) - Local destination path
Returns:
success- Boolean indicating successmessage- Download status message
ssh_list_files
List files in a directory on the remote server.
Parameters:
connectionId(required) - ID from ssh_connectremotePath(required) - Directory path to list
Returns:
files- Array of file objects with properties:filename- File nameisDirectory- Boolean indicating if it's a directorysize- File sizelastModified- Last modification time
ssh_disconnect
Close an SSH connection.
Parameters:
connectionId(required) - ID from ssh_connect
Returns:
success- Boolean indicating successmessage- Disconnection status message
Usage Examples with Claude
Connect to your server:
Please connect to my VPS at example.com using username 'admin' and my SSH key at ~/.ssh/id_rsaCheck server status:
Run the command "systemctl status nginx" to check web server statusUpload a website file:
Upload my local file ~/websites/index.html to /var/www/html/index.html on the serverList website files:
Show me all files in the /var/www/html directoryDownload a backup:
Download the file /var/backups/website-backup.tar.gz to my local Downloads folderDisconnect 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 connectionenablePassword(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 connectioninterfaceType(optional) - Type of interfaces to showenablePassword(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 connectionenablePassword(optional) - Enable password for privileged mode
switch_backup_config
Backup switch configuration (running or startup config).
Parameters:
connectionId(required) - ID of an active SSH connectionconfigType(optional) - Type of configuration to backupenablePassword(optional) - Enable password for privileged mode
switch_network_diagnostics
Run network diagnostics from switch (ping, traceroute).
Parameters:
connectionId(required) - ID of an active SSH connectiontarget(required) - Target IP address or hostnamediagnosticType(optional) - Type of diagnostic to runenablePassword(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 connectionvlan(optional) - Specific VLAN to show MAC addresses forenablePassword(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:
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 connectiondeviceType(optional) - Device type for optimal settings (cisco, aruba, generic)
Example:
serial_send_command
Send a command to network device via serial connection.
Parameters:
connectionId(required) - ID of an active serial connectioncommand(required) - Command to send to devicewaitForResponse(optional) - Wait for device responsetimeout(optional) - Response timeout in milliseconds
Example:
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:
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 hostnameip_address(required) - Management IP addresssubnet_mask(optional) - Subnet mask (default: 255.255.255.0)gateway(required) - Default gatewayusername(required) - SSH usernamepassword(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 connectiondeviceType(optional) - Device type: cisco, arubahostname(required) - Switch hostnameip_address(required) - Management IP addressgateway(required) - Default gatewayusername(required) - SSH usernamepassword(required) - SSH passwordconfirmApply(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 addressusername(required) - SSH usernamepassword(required) - SSH passwordport(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 connectionhostname(required) - Switch hostnameip_address(required) - Management IP addressgateway(required) - Default gatewayusername(required) - SSH usernamepassword(required) - SSH passwordconfirmSetup(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 hostnameip_address(required) - Management IP addressgateway(required) - Default gatewayusername(required) - SSH usernamepassword(required) - SSH passworddeviceType(optional) - Device type: cisco, aruba (auto-detected if not specified)confirmTransition(required) - Must be true to proceed
Example:
quick_ssh_check
Quick check of SSH status on a switch via serial connection without making any changes.
Parameters:
port(required) - Serial portbaudRate(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 connectionenablePassword(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 connectionenablePassword(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 connectionlocalFirmwarePath(required) - Local path to firmware fileremotePath(optional) - Remote path on switch (default: flash:/filename)enablePassword(optional) - Enable password for privileged mode
Example:
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 connectionfirmwarePath(required) - Path to firmware file on switchenablePassword(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 connectionfirmwarePath(required) - Path to firmware file on switchenablePassword(optional) - Enable password for privileged modeautoReboot(optional) - Automatically reboot after installation (default: false)
Important: This modifies the boot configuration. Test in a lab environment first!
Example:
switch_prepare_rollback
Prepare information needed for firmware rollback in case of issues with new firmware.
Parameters:
connectionId(required) - ID of an active SSH connectionenablePassword(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
dmesgafter plugging in adapter to verify detection
Quick Start with Console
Connect USB-to-Serial adapter to your computer
Connect console cable from adapter to switch console port
List available ports: "Show me available serial ports"
Connect to port: "Connect to COM3 for Cisco switch"
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
.envfile for sensitive information
Troubleshooting
Server won't start
Check that Node.js is installed:
node --versionVerify all dependencies are installed:
npm installRebuild 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:
Edit source files in
src/Rebuild:
npm run buildTest your changes
Restart Claude Desktop or VS Code to pick up changes
Running in Development Mode
For quick testing during development:
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