SSH MCP Server
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., "@SSH MCP Server copy my local config file to the production server"
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.
SSH MCP Server
A Model Context Protocol (MCP) server that provides SSH functionality including file copying between servers, command execution, and file management.
Features
🔐 SSH Connection Management: Connect to multiple SSH servers with connection pooling
📁 File Operations: Copy files between local and remote servers, or between remote servers
🖥️ Command Execution: Execute commands on remote servers
📋 File Listing: List files and directories on local or remote systems
ℹ️ File Information: Get detailed file information (size, permissions, timestamps)
🔑 Authentication: Support for password and private key authentication
Related MCP server: SSH MCP Server
Installation
npm install
npm run buildUsage
Claude Desktop Integration
To use this SSH MCP server with Claude Desktop, you need to configure it in your Claude Desktop settings.
1. Build the Server
npm install
npm run build2. Configure Claude Desktop
Add the following configuration to your Claude Desktop MCP settings file:
On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"ssh-server": {
"command": "node",
"args": ["/absolute/path/to/mcp-ssh/dist/index.js"],
"env": {}
}
}
}Important: Replace /absolute/path/to/mcp-ssh/ with the actual absolute path to your mcp-ssh project directory.
3. Restart Claude Desktop
After adding the configuration, restart Claude Desktop completely for the changes to take effect.
4. Verify Installation
Once restarted, you should see the SSH tools available in Claude Desktop. You can test by asking Claude to:
"Connect to an SSH server"
"List available SSH tools"
"Copy a file between servers"
Development Mode
npm run devProduction
npm run build
npm startQuick Start
New to SSH MCP Server? Check out our How to Use Authentication Guide for simple, step-by-step instructions on connecting to your servers using natural language with Claude Desktop.
Available Tools
1. ssh_connect
Connect to an SSH server.
Parameters:
host(string): SSH server hostname or IP addressport(number, default: 22): SSH port numberusername(string): SSH usernamepassword(string, optional): SSH passwordprivateKeyPath(string, optional): Path to private key filepassphrase(string, optional): Passphrase for private keyconnectionId(string): Unique identifier for this connection
Authentication Methods:
Password Authentication:
{
"host": "192.168.1.100",
"username": "your_username",
"password": "your_password",
"connectionId": "server1"
}SSH Key Authentication:
{
"host": "192.168.1.100",
"username": "your_username",
"privateKeyPath": "/path/to/private/key",
"passphrase": "optional_passphrase",
"connectionId": "server1"
}2. ssh_disconnect
Disconnect from an SSH server.
Parameters:
connectionId(string): Connection ID to disconnect
3. ssh_execute
Execute a command on a remote SSH server.
Parameters:
connectionId(string): SSH connection IDcommand(string): Command to executecwd(string, optional): Working directory for command execution
Example:
{
"connectionId": "server1",
"command": "ls -la /home/user",
"cwd": "/home/user"
}4. ssh_copy_file
Copy files between local and remote servers or between remote servers.
Parameters:
sourceConnectionId(string): Source SSH connection ID (use "local" for local files)sourcePath(string): Source file pathtargetConnectionId(string): Target SSH connection ID (use "local" for local files)targetPath(string): Target file pathcreateDirectories(boolean, default: true): Create target directories if they don't exist
Examples:
Local to Remote:
{
"sourceConnectionId": "local",
"sourcePath": "/local/file.txt",
"targetConnectionId": "server1",
"targetPath": "/remote/file.txt"
}Remote to Local:
{
"sourceConnectionId": "server1",
"sourcePath": "/remote/file.txt",
"targetConnectionId": "local",
"targetPath": "/local/file.txt"
}Remote to Remote:
{
"sourceConnectionId": "server1",
"sourcePath": "/path/on/server1/file.txt",
"targetConnectionId": "server2",
"targetPath": "/path/on/server2/file.txt"
}5. ssh_list_files
List files and directories on local or remote server.
Parameters:
connectionId(string): SSH connection ID (use "local" for local files)remotePath(string): Directory path to listshowHidden(boolean, default: false): Show hidden files
6. ssh_file_info
Get file information (size, permissions, etc.).
Parameters:
connectionId(string): SSH connection ID (use "local" for local files)filePath(string): File path to get info for
Troubleshooting
Claude Desktop Integration Issues
Server not appearing in Claude Desktop:
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 (quit and reopen)
Check Claude Desktop logs for error messages
Permission errors:
Ensure Node.js has permission to read the project directory
On macOS, you may need to grant Claude Desktop full disk access in System Preferences > Security & Privacy
SSH connection failures:
Verify SSH server is accessible from your machine
Test SSH connection manually:
ssh username@hostnameCheck SSH key permissions (should be 600):
chmod 600 ~/.ssh/id_rsaEnsure SSH key is in the correct format (OpenSSH)
File transfer issues:
Check file paths are absolute and correct
Verify write permissions on target directories
Ensure sufficient disk space on target system
Getting Help
If you encounter issues:
Check the Claude Desktop console/logs for error messages
Verify your configuration matches the examples exactly
Test SSH connections manually before using the MCP server
Security Considerations
Private keys should be stored 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
Error Handling
The server provides detailed error messages for:
Connection failures
Authentication errors
File operation errors
Invalid parameters
Missing connections
Connection Management
Connections are pooled and reused for efficiency
Each connection has a unique ID for reference
Connections are automatically cleaned up on server shutdown
Use
ssh_disconnectto manually close connections
Temporary Files
For remote-to-remote file transfers, temporary files are created in /tmp/ and automatically cleaned up after transfer completion or on error.
Dependencies
@modelcontextprotocol/sdk: MCP SDK for server implementationnode-ssh: SSH client for Node.jsssh2: Low-level SSH2 clientzod: Runtime type validation
License
MIT
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 overlap. For example, ssh_connect establishes a connection, ssh_execute runs commands, ssh_list_files enumerates files, and ssh_docker_deploy handles container deployment. The descriptions reinforce unique functions, preventing misselection.
All tools follow a consistent 'ssh_verb_noun' pattern, such as ssh_connect, ssh_execute, and ssh_list_files. This uniform naming scheme makes the tool set predictable and easy to navigate, with no deviations in style or structure.
With 18 tools, the count is slightly high but reasonable for the SSH server domain, which requires operations for connection management, file handling, command execution, Docker integration, and credential storage. It covers a broad scope without being excessive.
The tool set provides comprehensive coverage for SSH operations, including connection lifecycle (connect, disconnect), file management (copy, list, info), command execution (execute, interactive shell), Docker deployment, and credential handling. No obvious gaps exist for typical SSH workflows.
Related MCP Connectors
Manage servers through SSH.
- browser-sshDeprecatedcom.browserssh
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.
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 seamless SSH operations including secure connections, file transfers, interactive shell sessions, and Docker container management on remote servers. Supports both password and SSH key authentication with credential management and connection pooling.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.7MIT
- 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.1122 npm5MIT
- FlicenseBqualityDmaintenanceEnables 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.4-