remote-ssh-mcp
remote-ssh-mcp
MCP server for persistent SSH sessions with native GUI credential prompts.
Features
🔗 Persistent Sessions - Connections survive across multiple commands
🔐 GUI Credential Prompts - Native dialogs on Linux/macOS/Windows
📁 File Transfer - Upload/download via SFTP
⏱️ Background Commands - Run long tasks without blocking
🔄 Session Reuse - Automatic connection pooling per host
🛡️ Secure - Per-process secrets, localhost-only helper
Installation
npm install -g remote-ssh-mcpQuick Start
Add to your MCP client config:
{
"mcpServers": {
"ssh": {
"command": "remote-ssh-mcp"
}
}
}That's it! Connect to servers and credentials will be prompted via native GUI.
Configuration
Environment Variables (Optional)
Skip GUI prompts by setting credentials:
{
"mcpServers": {
"ssh": {
"command": "remote-ssh-mcp",
"env": {
"SSH_USER": "deploy",
"SSH_PASSWORD": "secret"
}
}
}
}Host Config File (Optional)
Create ~/.ssh/mcp-hosts.json:
{
"defaults": { "username": "admin" },
"hosts": {
"prod.example.com": {
"username": "deploy",
"keyPath": "~/.ssh/deploy_key"
}
}
}Tools
Tool | Description |
| Connect to SSH server, returns session_id |
| Execute command (with optional background mode) |
| Read terminal output history |
| Close a session |
| List active sessions |
| Upload file via SFTP |
| Download file via SFTP |
Example Usage
1. ssh_connect(host="server.com", auth_mode="password")
→ { session_id: "abc-123", status: "connected" }
2. ssh_exec(session_id="abc-123", command="cd /app && git pull")
→ { stdout: "Already up to date.", exit_code: 0 }
3. ssh_exec(session_id="abc-123", command="npm run build", background=true)
→ { status: "running", pid: "12345" }
4. ssh_read_buffer(session_id="abc-123", lines=50)
→ { lines: ["Building...", "Done!"], total_buffered: 150 }GUI Requirements
For credential prompts:
Linux:
zenity(apt install zenity)macOS: Built-in (osascript)
Windows: Built-in (PowerShell)
Without GUI, use environment variables or config file.
Security
Credentials prompted via native OS dialogs
Never logged or written to disk
Per-process authentication tokens
Localhost-only credential helper
Sessions auto-expire after 15 min inactivity
License
MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/code-pumpkin/remote-ssh-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server