Giving full access over a pool of ssh connections for system reconnaissance and administration.
1.7K
mcp-ssh-gateway is an MCP-native boundary agent for remote operational capability.
It gives LLMs and automation systems controlled arms and legs into selected remote machines through SSH-based connections. Those machines may provide shell access, specialized hardware, local tools, storage, network adjacency, compute capacity, or access to isolated infrastructure.
The gateway is useful for work such as systems automation, remote administration, diagnostics, troubleshooting, penetration testing, offensive security research, and AI-assisted operational workflows.
The project is not a general orchestration platform, not a replacement for configuration management systems, and not an unrestricted remote shell broker. It is a narrow operational boundary between orchestration systems and real environments.
LLMs are good at reasoning, planning, and interpreting complex output. Real systems require tools, hardware, shell access, network locality, and execution environments.
mcp-ssh-gateway bridges those worlds.
The gateway owns SSH identities, connection configuration, capability discovery, capability caching, execution logging, and transport mechanics. The orchestrator receives operational capability through MCP tools, but does not directly manage passwords, private keys, target addresses, or network topology.
The orchestrator gets capability, not custody.
LLM / MCP client
↓
FastMCP tool surface
↓
mcp-ssh-gateway
├── node registry
├── connection pool
├── execution logging
└── transport orchestration
├── direct SSH
└── reverse tunnel SSH
↓
remote node environments
Each configured node represents a trusted operational arm into a remote environment. The gateway manages SSH identities, connections, and execution, and exposes those capabilities back through MCP tools.
This allows an LLM to inspect available nodes, select the most appropriate machine for a task, and coordinate workflows across multiple remote systems.
| Tool | Description |
|---|---|
get_node_status | List all nodes and their connection states |
get_node_info | Get detailed node facts (use refresh=true for explicit manual refresh) |
get_agent_public_key | Retrieve the agent's SSH public key for node enrollment |
add_node | Enroll a new direct-mode node via password bootstrap |
enable_node | Enable a node (use validate=true to probe connectivity) |
disable_node | Disable a node and close its connection |
remove_node | Remove a node from the pool and registry |
run_command_on_node | Execute a command on a named node |
upload_file_to_node | Upload a file to a named node via SFTP |
download_file_from_node | Download a file from a named node via SFTP |
Direct mode is used when the remote machine is reachable from the gateway.
The gateway opens outbound SSH connections directly to the target. This is the simpler model and works well for internal infrastructure, VPN-connected environments, trusted networks, and static lab environments.
Reverse tunnel mode is used when the remote environment is not directly reachable from the gateway.
In this model, the remote machine initiates connectivity toward the gateway, exposes its local SSH service through a reverse tunnel, and the gateway connects back through the exposed local port.
This is useful for NATed environments, outbound-only infrastructure, headless devices, remote labs, and restricted networks.
The current configuration value is still:
{
"mode": "tunnel"
}
The documentation uses “reverse tunnel mode” to describe the operational model clearly.
The gateway is intended to work together with runbooks, skills, procedures, and higher-level orchestration systems such as Open WebUI, n8n, OpenClaw, or other MCP-compatible clients.
The gateway provides operational reach. The orchestrator provides reasoning and workflow composition.
Paired with runbooks and skills, an LLM can plan larger workflows and execute them through real environments while keeping actions visible and attributable.
The project is in an active implementation phase.
Implemented:
add_node)get_agent_public_key)resources/node/handshake.shEvolving:
Not yet implemented:
Documentation must continue to distinguish implemented behavior from intended architecture.
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install pytest
pytest
The current startup path expects a valid connection configuration file.
python app.py --connection-config ./connections.json
docs/DOCUMENTATION_GUIDE.mddocs/ARCHITECTURE.mddocs/TESTING_STRATEGY.mddocs/ARCHITECTURAL_DECISIONS.mddocs/EDGE.mddocs/DEVELOPER.mddocs/SECURITY.mddocs/CONTRIBUTING.mdApache 2.0.
Content type
Image
Digest
sha256:3dc4dc822…
Size
227.3 MB
Last updated
4 months ago
docker pull olilanz/mcp-ssh-gateway