MCP SSH Server
Enables remote Docker container deployment and management through SSH connections, including Docker Compose support and container status monitoring
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., "@MCP SSH Server connect to server1 and run 'docker ps' to check container status"
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
🚀 Overview
MCP SSH Server is a powerful Model Context Protocol (MCP) server that enables seamless SSH operations, file transfers, and remote server management. This server provides comprehensive SSH functionality including secure connections, file operations, interactive shell sessions, credential management, and Docker deployment capabilities.
✨ Features
🔐 Secure SSH Connections: Support for both password and SSH key authentication
📁 File Operations: Copy files between local and remote servers with directory creation
💻 Interactive Shell Sessions: Full terminal emulation with PTY support
🔑 Credential Management: Save and reuse SSH credentials securely
🐳 Docker Integration: Deploy and manage Docker containers remotely
📂 Working Directory Context: Maintain working directory state per connection
🔍 File System Operations: List files, get file info, and navigate directories
⚡ Connection Pooling: Efficient connection management and reuse
📋 Prerequisites
Node.js 18+
TypeScript 5.3+
SSH access to target servers
Claude Desktop or compatible MCP client
🛠️ Installation
Clone the repository:
git clone <repository-url> cd mcp-ssh-serverInstall dependencies:
npm installBuild the project:
npm run buildConfigure Claude Desktop:
Add to your Claude Desktop configuration file:
Windows:
%APPDATA%/Claude/claude_desktop_config.json{ "mcpServers": { "ssh-server": { "command": "node", "args": ["C:/path/to/mcp-ssh-server/dist/index.js"], "env": {} } } }macOS:
~/Library/Application Support/Claude/claude_desktop_config.json{ "mcpServers": { "ssh-server": { "command": "node", "args": ["/Users/username/path/to/mcp-ssh-server/dist/index.js"], "env": {} } } }
🎯 Available Tools
Connection Management
ssh_connect- Establish SSH connectionssh_disconnect- Close SSH connectionssh_connect_with_credential- Connect using saved credentials
Command Execution
ssh_execute- Execute commands on remote serverssh_start_interactive_shell- Start interactive shell sessionssh_send_input- Send input to interactive shellssh_read_output- Read output from interactive shellssh_close_interactive_shell- Close interactive shell session
File Operations
ssh_copy_file- Copy files between serversssh_list_files- List directory contentsssh_file_info- Get file information
Credential Management
ssh_save_credential- Save SSH credentialsssh_list_credentials- List saved credentialsssh_delete_credential- Delete saved credentials
Working Directory
ssh_set_working_directory- Set current working directoryssh_get_working_directory- Get current working directory
Docker Operations
ssh_docker_deploy- Deploy Docker containersssh_docker_status- Check Docker container status
📖 Usage Examples
Basic SSH Connection
{
"tool": "ssh_connect",
"arguments": {
"host": "192.168.1.100",
"username": "user",
"password": "password",
"connectionId": "server1"
}
}SSH Key Authentication
{
"tool": "ssh_connect",
"arguments": {
"host": "192.168.1.100",
"username": "user",
"privateKeyPath": "/path/to/private/key",
"connectionId": "server1"
}
}File Transfer (Local to Remote)
{
"tool": "ssh_copy_file",
"arguments": {
"sourceConnectionId": "local",
"sourcePath": "/local/file.txt",
"targetConnectionId": "server1",
"targetPath": "/remote/file.txt"
}
}Execute Command
{
"tool": "ssh_execute",
"arguments": {
"connectionId": "server1",
"command": "ls -la /home/user"
}
}Docker Deployment
{
"tool": "ssh_docker_deploy",
"arguments": {
"connectionId": "server1",
"workingDirectory": "/app",
"deploymentType": "compose"
}
}Save Credentials
{
"tool": "ssh_save_credential",
"arguments": {
"credentialId": "my-server",
"host": "192.168.1.100",
"username": "user",
"privateKeyPath": "/path/to/key"
}
}🔧 Development
# Development mode
npm run dev
# Type checking
npm run type-check
# Build
npm run build
# Start production
npm start🔒 Security Considerations
Store private keys securely with appropriate file permissions (600)
Use SSH key authentication instead of passwords when possible
Consider using SSH agent forwarding for additional security
The server maintains connection pools - ensure proper cleanup on shutdown
🐛 Troubleshooting
Claude Desktop Integration Issues:
Verify the absolute path in
claude_desktop_config.jsonis correctEnsure the server was built successfully (
npm run build)Check that
dist/index.jsexists in your project directoryRestart Claude Desktop completely
SSH Connection Failures:
Verify SSH server is accessible from your machine
Test SSH connection manually:
ssh username@hostnameCheck SSH key permissions:
chmod 600 ~/.ssh/id_rsaEnsure SSH key is in the correct format (OpenSSH)
📄 License
MIT License - see LICENSE file for details.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Available Tools
18 toolsssh_close_interactive_shellC
Close an interactive shell session
Inputs: sessionId (required).
ssh_connectC
Connect to an SSH server
Inputs: host (required), username (required), connectionId (required), port, +3 more.
ssh_connect_with_credentialC
Connect to SSH server using saved credentials
Inputs: credentialId (required), connectionId (required).
ssh_copy_fileB
Copy files between local and remote servers or between remote servers
Inputs: sourceConnectionId (required), sourcePath (required), targetConnectionId (required), targetPath (required), +1 more.
ssh_delete_credentialC
Delete a saved SSH credential
Inputs: credentialId (required).
ssh_disconnectC
Disconnect from an SSH server
Inputs: connectionId (required).
ssh_docker_deployC
Deploy Docker containers with working directory context
Inputs: connectionId (required), workingDirectory (required), deploymentType (required), imageName, +7 more.
ssh_docker_statusC
Check Docker container status in working directory
Inputs: connectionId (required), workingDirectory.
ssh_executeC
Execute a command on a remote SSH server
Inputs: connectionId (required), command (required), cwd.
ssh_file_infoC
Get file information (size, permissions, etc.)
Inputs: connectionId (required), filePath (required).
ssh_get_working_directoryB
Get the current working directory for a connection
Inputs: connectionId (required).
ssh_list_credentialsB
List all saved SSH credentials
Inputs: no named parameters.
ssh_list_filesC
List files and directories on local or remote server
Inputs: connectionId (required), remotePath (required), showHidden.
ssh_read_outputC
Read output from an interactive shell session
Inputs: sessionId (required), timeout, clearBuffer.
ssh_save_credentialC
Save SSH credentials for reuse
Inputs: credentialId (required), host (required), username (required), port, +3 more.
ssh_send_inputC
Send input to an interactive shell session with optional typing simulation
Inputs: sessionId (required), input (required), simulateTyping.
ssh_set_working_directoryC
Set the current working directory for a connection
Inputs: connectionId (required), workingDirectory (required).
ssh_start_interactive_shellC
Start an interactive shell session with PTY support for typing simulation
Inputs: connectionId (required), sessionId (required), shell, cols, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Each tool has a clearly distinct purpose with no ambiguity. For example, ssh_connect, ssh_execute, ssh_copy_file, and ssh_docker_deploy target different operations (connection, command execution, file transfer, and container deployment), and interactive shell tools (start, send_input, read_output, close) are well-separated from credential management and file operations.
All tool names follow a consistent 'ssh_' prefix with snake_case and descriptive verb_noun patterns (e.g., ssh_connect, ssh_execute, ssh_list_files). This uniformity makes the tool set predictable and easy to navigate, with no deviations in naming style.
With 18 tools, the count is slightly high but reasonable for the SSH server domain, covering connection management, file operations, Docker interactions, credential handling, and interactive shells. It's well-scoped, though some tools like ssh_docker_deploy and ssh_docker_status might be considered optional extensions.
The tool surface provides complete coverage for SSH operations, including CRUD for connections (connect, disconnect), credentials (save, list, delete), files (list, copy, info), directories (get/set working directory), command execution, and interactive shells with full lifecycle support. No obvious gaps exist for the stated purpose.
Maintenance
Related MCP Connectors
Scoped, audited SSH exec, sessions, and SFTP on your saved servers without exposing credentials
Manage remote servers, SSH terminals, files, databases and proxies with scoped access and approvals.
Manage servers through SSH.
Securely control computers you explicitly pair through files, terminals, processes, screenshots, desktop UI/input, clipboard, browser automation, diagnostics, and document tools.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables SSH operations including connecting to remote servers, executing commands, and transferring files between local and remote systems. Supports multiple SSH connections with both password and private key authentication methods.18MIT
- AlicenseAqualityDmaintenanceEnables secure SSH connections to multiple remote servers with support for command execution, file transfers (SFTP), directory listing, and both password and key-based authentication.725 PyPIMIT
- AlicenseAqualityDmaintenanceEnables remote server management through SSH and SFTP, supporting command execution, file transfers, and interactive shell sessions. It allows for multiple concurrent connections using either password or SSH key authentication.1131 npm5MIT
- AlicenseBqualityDmaintenanceEnables secure SSH connections to remote servers for executing shell commands and managing active sessions. It supports authentication via passwords or private keys and provides optional host-based access control.4116 npmMIT