Secure MCP SSH server with remote commands file transfer and management support
The MCP SSH Server is a robust and secure implementation of an SSH server that supports Model Context Protocol (MCP) clients, enabling seamless integration with various AI applications such as Claude Desktop, Continue, Cursor, and more. Designed to provide secure remote command execution and file transfer capabilities, this server supports both password and key-based authentication methods, ensuring flexibility and security in different deployment scenarios.
The MCP SSH Server offers a comprehensive set of features that are crucial for integrating with AI applications:
Secure SSH Connection Management: Utilizing the Secure Shell (SSH) protocol, this server establishes secure remote connections, ensuring data confidentiality and integrity.
Authentication Methods: Supports both password-based and key-based authentication methods, providing flexibility in terms of user access control.
Remote Command Execution: Allows authorized users to execute commands remotely, facilitating efficient task automation and system administration tasks.
File Operations (Upload/Download): Offers comprehensive file management functionalities such as uploading and downloading files between the client and server systems. This is particularly useful for managing assets or configurations in AI workflows.
Progress Tracking for File Transfers: Provides real-time tracking of file transfer statuses, ensuring that users are always informed about the progress of large transfers.
Advanced Permission Management: Enforces robust permission policies to control what operations different users can perform on server resources.
Directory Operations: Enables users to perform directory-related tasks such as listing files and directories, providing a full suite of file management capabilities.
Bulk File Transfers: Supports the transfer of multiple files in one operation, optimizing resource utilization during large-scale deployments.
Detailed Logging: Maintains logs for all operations performed on the server, which is invaluable for debugging and security auditing purposes.
The MCP SSH Server architecture is designed to be compliant with Model Context Protocol standards, ensuring seamless integration with supported clients. The protocol flow diagram below illustrates how an AI application communicates with the MCP SSH Server:
graph TB
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
The following table shows the compatibility of the MCP SSH Server with various MCP clients:
MCP Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ✅ | Full Support |
Cursor | ❌ | ✅ | ❌ | Tools Only |
To get started with the MCP SSH Server, follow these steps:
Install the Package:
npm install mcp-ssh
Configure the MCP Client (Claude Desktop):
Edit your Claude desktop configuration file (claude_desktop_config.json
) to include the server details.
{
"mcpServers": {
"ssh": {
"command": "node",
"args": ["%APPDATA%/npm/node_modules/mcp-ssh/dist/server.js"],
"env": {
"SSH_PORT": "8889",
"SSH_LOG_LEVEL": "info"
}
}
}
}
Start the Server:
Testing Connections: Use PowerShell or CLI tools to test different authentication methods, command execution, and file operations as described in the README.
AI researchers can use this server to synchronize training data sets more securely. By connecting via MCP SSH Server, they can upload or download datasets without exposing them over insecure channels.
# Sample PowerShell commands
$uploadForm = @{
file = Get-Item -Path "localfile.txt"
remotePath = "/model_data/train_set/data.csv"
}
Invoke-RestMethod -Uri "http://localhost:8889/upload/test" -Method Post -Form $uploadForm
$jsonBody = @{
id = "test"
command = "aws s3 cp localfile.txt s3://my-bucket/model_data/"
} | ConvertTo-Json
Invoke-RestMethod -Uri "http://localhost:8889/exec" -Method Post -Body $jsonBody -ContentType "application/json"
DevOps engineers can perform remote machine management tasks using the MCP SSH Server. This includes managing multiple AI infrastructure nodes securely, executing scripts or commands to update configurations, or run monitoring tasks.
$execBody = @{
id = "test"
command = "ps -aux | grep python3"
} | ConvertTo-Json
Invoke-RestMethod -Uri "http://localhost:8889/exec" -Method Post -Body $execBody -ContentType "application/json"
The MCP SSH Server can be easily integrated into various AI applications through the following steps:
Clone and Configure:
git clone https://github.com/shaike1/mcp-server-ssh.git
cd mcp-server-ssh
Install Dependencies:
npm install
Build the Server:
npm run build
Start the Server:
npm start
Test with MCP Clients: Test connections and operations using the provided REST API endpoints.
The following table demonstrates the performance and compatibility matrix of the MCP SSH Server:
Feature | Performance (Latency) | Compatibility (Clients) |
---|---|---|
Secure SFTP Connections | <100ms | ✅ (Multiple Clients) |
File Operations (Upload/Download) | ≤500MB/s | ✅ (Multiple Clients) |
Command Execution | N/A | ✅ (Multiple Clients) |
graph TD
A[AI Application] -->|MCP Client| B[MCP SSH Server]
B --> C[Data Access/Tool Usage]
This diagram illustrates the flow from an AI application to the MCP SSH Server and subsequent actions, ensuring a clear understanding of the interaction between components.
{
"mcpServers": {
"mcp-ssh": {
"command": "node",
"args": ["%APPDATA%/npm/node_modules/mcp-ssh/dist/server.js"],
"env": {
"SSH_PORT": "8889",
"SSH_LOG_LEVEL": "info"
}
}
}
}
A: The server supports bulk file transfer operations, which ensures efficient handling of large files through optimized data streams.
A: Yes, you can further enhance security by integrating additional encryption methods during file transfers and command execution sessions.
A: The server automatically scales based on the hardware resources available. You can also configure limits or use load balancers for handling high-traffic scenarios.
A: Yes, the MCP SSH Server is designed with backward compatibility in mind, making it easy to transition from traditional SSH setups while gaining protocol-specific benefits.
A: Regular updates and enhancements are provided based on user feedback and new requirements, ensuring a robust and up-to-date solution.
git checkout -b feature/bug-fixes
git commit -m 'Add new features or fix bugs'
git push origin feature/bug-fixes
To stay updated with the latest developments in the MCP ecosystem, follow these resources:
By integrating the MCP SSH Server into your AI applications, you can enhance security and interoperability across various platforms while ensuring seamless operation within the MCP ecosystem.
Learn to connect to MCP servers over HTTP with Python SDK using SSE for efficient protocol communication
Next-generation MCP server enhances documentation analysis with AI-powered neural processing and multi-language support
Analyze search intent with MCP API for SEO insights and keyword categorization
Python MCP client for testing servers avoid message limits and customize with API key
Learn how to use MCProto Ruby gem to create and chain MCP servers for custom solutions
AI Vision MCP Server offers AI-powered visual analysis, screenshots, and report generation for MCP-compatible AI assistants