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.
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:
- Start the server:
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
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
Enables AI assistants to securely execute shell commands on local machines through an SSH interface with session management, command execution, and sudo support.
Related MCP Servers
- -securityFlicense-qualityA robust SSH server facilitating secure remote command execution with TMUX session management, multi-window support, and smart session recovery for improved AI-human interaction.Last updated -4Python
- -securityAlicense-qualityEnables secure remote execution of Rails console commands over SSH for read-only operations, mutation planning, and executing approved changes in a deployed Rails environment.Last updated -517TypeScriptMIT License
- -securityAlicense-qualityA secure server that enables AI applications to execute shell commands in specified directories, supporting multiple shell types (bash, sh, cmd, powershell) with built-in security features like directory isolation and timeout control.Last updated -9PythonApache 2.0
- -security-license-qualityTransform your local machine into a powerful code command center. Automate file handling, run terminal commands, and leverage AI to enhance your development workflows—all securely and instantly, without cloud latency.Last updated -1PythonMIT License