ssh-mcp-server
Provides SSH-based tools for managing Docker on remote hosts: list containers, view container logs, start/restart/stop containers, and start/stop Docker Compose stacks.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
ssh-mcp-server
SSH access for AI agents through the Model Context Protocol
Installation · Configuration · Tools · Security
An MCP server that lets AI agents connect to remote hosts over SSH. Run commands, manage files, control services and containers, and monitor server health through a persistent connection.
Features
Persistent sessions: connect once, run many commands without reconnecting
State preservation: shell environment and working directory persist between calls
Policy enforcement: commands are classified by risk, destructive operations require confirmation
Audit logging: operations logged to stderr as JSON
Related MCP server: mcp-ssh-terminal
Installation
npm (recommended)
npx @regele/ssh-mcp-serverOr install globally:
npm install -g @regele/ssh-mcp-server
ssh-mcp-serverFrom source
Requires Bun for building.
git clone https://github.com/k6w/ssh-mcp-server.git
cd ssh-mcp-server
bun install
bun run build
node dist/index.jsConfiguration
Claude Code
claude mcp add ssh -- npx @regele/ssh-mcp-serverOr with a local build:
claude mcp add ssh -- node /path/to/ssh-mcp-server/dist/index.jsMCP config file
{
"mcpServers": {
"ssh": {
"command": "npx",
"args": ["@regele/ssh-mcp-server"]
}
}
}SSH agent
Without a password or key, the server uses your SSH agent (SSH_AUTH_SOCK or Pageant on Windows). Pass the socket explicitly if needed:
{
"mcpServers": {
"ssh": {
"command": "npx",
"args": ["@regele/ssh-mcp-server"],
"env": { "SSH_AUTH_SOCK": "/path/to/agent.sock" }
}
}
}Architecture
flowchart LR
subgraph Client
A[MCP Client]
end
subgraph Server[ssh-mcp-server]
direction TB
T[Tools]
T --> P[policy.ts]
T --> AU[audit.ts]
T --> V[validation.ts]
T --> SM[session-manager.ts]
SM --> SS[shell-session.ts]
SM --> JM[job-manager.ts]
SM --> SF[sftp-manager.ts]
end
subgraph Remote
H[Remote Hosts]
end
A <-->|stdio| T
SM <-->|SSH| HTools
32 tools across 7 categories.
Connection
Tool | Description |
| Open session with password, key, or agent auth |
| Close session |
| List active sessions |
Execution
Tool | Description |
| Run command, return stdout/stderr/exitCode |
| Open interactive PTY shell |
| Send input to shell |
| Read shell output |
| Close shell |
Background Jobs
Tool | Description |
| Start long-running command |
| Check job state |
| Read job output |
| Kill running job |
| List jobs |
Files (SFTP)
Tool | Description |
| Read file contents |
| Write file with auto-backup |
| List directory |
| Get file metadata |
| Delete file |
| Create directory |
Status
Tool | Description |
| System snapshot: OS, load, memory, disk, services, containers |
Services (systemd)
Tool | Risk | Description |
| safe | Show unit state |
| mutating | Start unit |
| mutating | Restart with verification |
| dangerous | Stop unit (requires |
| safe | Read journal entries |
Docker
Tool | Risk | Description |
| safe | List containers |
| safe | Container logs |
| mutating | Start container |
| mutating | Restart container |
| dangerous | Stop container (requires |
| mutating | Start compose stack |
| dangerous | Stop compose stack (requires |
Security
Risk tiers
Commands are classified before execution:
Tier | Behavior | Examples |
| Runs |
|
| Runs |
|
| Requires |
|
| Always refused |
|
Policy coverage
Tools | Policy | Audit |
| Yes | Yes |
| Yes | No |
| No | No |
| No | No |
ssh_exec and shell tools pass commands directly. Use a restricted account.
Audit format
{"timestamp":"...","sessionId":"...","command":"systemctl restart nginx","tier":"mutating","allowed":true,"exitCode":0,"durationMs":412}Limitations
No host key verification: accepts any server key
Credentials in memory: passwords/keys kept for session lifetime
Timeouts do not cancel remote commands: use jobs for long work
Sessions lost on restart
Recommendations
Use a dedicated non-root account with limited sudo
Enable confirmation prompts in your MCP client
Prefer key authentication with passphrase
Keep
allowDangerousoff unless necessaryReview audit logs after agent sessions
Development
bun install # install dependencies
bun run build # bundle to dist/index.js
bun run typecheck # type-check with tsc
bun run start # run serverLicense
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
- browser-sshDeprecatedcom.browserssh
Scoped, audited SSH exec, sessions, and SFTP on your saved servers without exposing credentials
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Manage remote servers, SSH terminals, files, databases and proxies with scoped access and approvals.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables AI assistants to manage remote servers via SSH with agentless command execution, file operations, and service management.9MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to have persistent, fully interactive SSH sessions into remote hosts, behaving like a local terminal.19 npm2MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to securely execute commands on remote hosts via SSH and SFTP, with persistent shells, file transfers, screenshots, and an audit log.5MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to manage remote servers via SSH, including command execution, multi-host batch operations, SFTP file transfer, background job handling, DevOps diagnostics, port tunneling, and safety guardrails like high-risk command blocking and read-only mode.MIT