my-mcp-ssh
Click on "Deploy 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., "@my-mcp-ssh connect to 192.168.1.100 and run 'uptime'"
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.
my-mcp-ssh
A Model Context Protocol (MCP) based SSH connection tool that allows large language models to securely connect to remote servers via SSH and perform file operations through the MCP protocol.
Features
SSH Connection Management: Connect to remote SSH servers
Command Execution: Execute commands on remote servers
File Transfer: Upload and download files
Session Management: Maintain and close SSH sessions
Related MCP server: ssh-client-mcp-server
Installation
Dependencies
Python >= 3.12
uv package manager
# Clone the project
git clone https://github.com/ffpy/my-mcp-ssh.git
# Enter the project directory
cd my-mcp-ssh
# Install dependencies
uv syncUsage
Configure in client
{
"mcpServers": {
"my-mcp-ssh": {
"command": "uv",
"args": [
"--directory",
"<your_path>/my-mcp-ssh",
"run",
"src/main.py"
],
"env": {}
}
}
}Environment Variables
SSH Connection Defaults (Optional)
Environment variables provide default values for SSH connections, useful when frequently connecting to the same server or in automated environments:
SSH_HOST: SSH server hostname or IP addressSSH_PORT: SSH server portSSH_USERNAME: SSH usernameSSH_PASSWORD: SSH password (if using password authentication)SSH_KEY_PATH: SSH private key file path (if using key authentication)SSH_KEY_PASSPHRASE: SSH private key passphrase (if needed)
When to use SSH environment variables:
Repeated connections: When connecting to the same server multiple times
CI/CD pipelines: For automated deployment scripts
Development environments: Set defaults for your commonly used servers
Container deployments: Configure defaults without modifying code
Note: Parameters passed to the connect tool always override environment variables.
Server Configuration
Additional server behavior can be configured:
SESSION_TIMEOUT: Session timeout in minutes, default is 30 minutesMAX_OUTPUT_LENGTH: Maximum command output length in characters, default is 5000 characters
SSH Credentials File
For better security, you can store SSH credentials in a local configuration file instead of passing passwords as parameters.
Copy the example file:
cp ssh-credentials.json.example ssh-credentials.jsonEdit
ssh-credentials.jsonwith your actual credentials:
{
"root@192.168.1.100": "your_password",
"admin@web-[0-9].example.com": "web_password",
"deploy@server-{dev,test,staging}.company.com": "deploy_password",
"admin@*.internal.network": "internal_password"
}Supported Patterns:
*- matches any characters?- matches single character[0-9]- matches any digit{dev,test,staging}- matches any of the listed options
Authentication Priority Order:
Parameters passed to connect tool (
password,key_path)Exact match in credentials file (
username@host)Pattern match in credentials file (wildcards)
Environment variable password (
SSH_PASSWORD)Environment variable key (
SSH_KEY_PATH)Default SSH key (
~/.ssh/id_rsaif exists)
Security:
File permissions are automatically set to 600 (owner read/write only)
The file is added to .gitignore to prevent accidental commits
Note:
Credential file changes take effect immediately without server restart
The file is read fresh on each connection attempt
Tool List
connect
Connect to an SSH server
Parameters:
host: SSH server hostname or IP address (optional)port: SSH server port (optional, default 22)username: SSH username (optional)password: SSH password for authentication (optional)key_path: SSH private key file path for authentication (optional)key_passphrase: SSH private key passphrase if needed (optional)
disconnect
Disconnect from an SSH session
Parameters:
session_id: The session ID to disconnect
list_sessions
List all active SSH sessions
Parameters:
None
execute
Execute a command on the SSH server
Parameters:
session_id: Session IDcommand: Command to executestdin: Input string to provide to the command, default is emptytimeout: Command timeout in seconds, default is 60 seconds
upload
Upload a file to the SSH server
Parameters:
session_id: Session IDlocal_path: Local file pathremote_path: Remote file path
download
Download a file from the SSH server
Parameters:
session_id: Session IDremote_path: Remote file pathlocal_path: Local file path
Debugging
Run ./inspector.sh for online debugging
License
my-mcp-ssh is licensed under the Apache License, Version 2.0
Available Tools
6 toolsconnectA
Connect to SSH server
Args:
host: SSH server hostname or IP address (optional)
port: SSH server port (optional, default 22)
username: SSH username (optional)
password: SSH password for authentication (optional)
key_path: SSH private key file path for authentication (optional)
key_passphrase: SSH private key passphrase if needed (optional)
Returns:
Connection status
Inputs: host, port, key_path, password, +2 more.
disconnectB
Disconnect from SSH server
Args:
session_id: Session ID to disconnect
Returns:
Disconnection status
Inputs: session_id (required).
downloadC
Download file from SSH server
Args:
session_id: Session ID
remote_path: Remote file path
local_path: Local file path
Returns:
Dictionary containing download status information
Inputs: local_path (required), session_id (required), remote_path (required).
executeA
Execute command on SSH server
Args:
session_id: Session ID
command: Command to execute
stdin: Input string to provide to the command, defaults to None
timeout: Command timeout in seconds, defaults to 60 seconds
Returns:
Command output (stdout and stderr) and exit status
Inputs: command (required), session_id (required), stdin, timeout.
list_sessionsA
List all active SSH sessions
Returns:
List containing information about all sessions
Inputs: no named parameters.
uploadC
Upload file to SSH server
Args:
session_id: Session ID
local_path: Local file path
remote_path: Remote file path
Returns:
Dictionary containing upload status information
Inputs: local_path (required), session_id (required), remote_path (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct action: connect/disconnect manage sessions, list_sessions enumerates them, execute runs commands, and upload/download transfer files. There is no overlap or ambiguity between tool purposes.
All tool names follow a clear imperative verb style, using lowercase with underscores. The names are concise and predictable, with list_sessions being the only verb_noun form, which is appropriate for a listing operation.
The server provides 6 tools, which is well-scoped for an SSH MCP server. Each tool serves a core function (session management, command execution, file transfer) without unnecessary bloat, fitting the typical 3-15 tool range.
The tool surface covers the full lifecycle of SSH interactions: connect, disconnect, session listing, command execution, and file upload/download. No obvious gaps exist for standard SSH usage, making the set complete for its stated purpose.
Maintenance
Related MCP Connectors
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Termalin's hosted MCP server. Claude, ChatGPT or any MCP client runs commands, moves files over SFTP, queries databases and reads server metrics and monitoring alerts on your servers, keylessly through Termalin Connectors: no SSH key is handed over and no inbound port is opened. Per-host command policy and an audit log. Needs a termal.in Pro or Team account (new accounts start with a 14-day Pro trial).
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables remote SSH command execution and bidirectional file transfers through a standardized interface. It allows AI assistants to securely manage remote servers while keeping credentials isolated and applying command-level security controls.ISC
- AlicenseNot gradedqualityBmaintenanceA local MCP server that enables LLMs to execute shell commands on remote hosts over SSH with multiple authentication methods.35 npm3MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that gives AI agents SSH capabilities to execute commands, transfer files, and inspect remote systems through a preconfigured host list.78 npmMIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server for managing remote SSH servers, enabling AI agents to execute commands, transfer files, and perform deployment operations securely.MIT