Provides secure shell access to local machines, allowing execution of shell commands, management of SSH sessions, running privileged commands with sudo, and handling interactive command prompts.
ssh-mcp
SSH MCP server that provides secure shell access to local machines through a Model Context Protocol interface.
Overview
This server implements an SSH client using Paramiko and exposes SSH functionality through MCP tools, allowing AI assistants to execute commands on local machines securely.
Related MCP server: MCP Server: SSH Rails Runner
Features
Session Management: Create, manage, and close SSH sessions with unique session IDs
Command Execution: Execute shell commands with proper input handling
Sudo Support: Specialized tools for running privileged commands with password authentication
Interactive Commands: Support for commands requiring user input (e.g., sudo prompts)
Thread-Safe: Concurrent session management with proper locking
Tools
ssh_start_session: Initialize SSH connection to localhostssh_exec_command: Execute shell commands with optional inputssh_exec_sudo_command: Run sudo commands with automatic password handlingssh_close_session: Clean up SSH sessions
Quick Start
Install dependencies:
pip install -r requirements.txtStart the server:
./start.sh
The server runs on http://0.0.0.0:7777 and provides an SSE (Server-Sent Events) endpoint for MCP communication.
Configuration
Default SSH credentials:
Hostname: localhost
Username: alex
Password: your-pass
Note: Update these credentials in server.py for production use.
Claude-desktop config
If using Linux, your config folder is:
To enable this u need to enable it in claude desktop: File / Config / Developer / Edit config
SSH Daemon:
Configure ssh daemon:
Paste (update ur username):
Start