MCP SSH Server
Enables 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.
README
MCP SSH Server
<div align="center"> <a href="README.md">🇺🇸 English</a> | <a href="README-id.md">🇮🇩 Bahasa Indonesia</a> </div>
🚀 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-server -
Install dependencies:
npm install -
Build the project:
npm run build -
Configure 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 correct - Ensure the server was built successfully (
npm run build) - Check that
dist/index.jsexists in your project directory - Restart Claude Desktop completely
SSH Connection Failures:
- Verify SSH server is accessible from your machine
- Test SSH connection manually:
ssh username@hostname - Check SSH key permissions:
chmod 600 ~/.ssh/id_rsa - Ensure 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.
<div align="center"> <p>Made with ❤️ for seamless SSH operations</p> <p><a href="README-id.md">🇮🇩 Baca dalam Bahasa Indonesia</a></p> </div>
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.