ssh-mcp — Claude Code MCP server: what it does, how to install
An intermediary gateway giving coding agents guarded remote SSH execution alongside per-token policies, request limits, and structured audit logs.
Open on GitHubWhat ssh-mcp does
The gateway runs via Docker and accepts requests from AI clients over Streamable HTTP. Instead of distributing SSH keys across multiple workstations, administrators define remote targets and command allowlists inside ssh-mcp-config.json. The service handles connection pooling, sliding-window rate limiting, and circuit breaking automatically.
Clients interact through six dedicated tools under the ssh_* prefix. They can test connectivity, list targets, inspect allowed commands, execute individual actions, and transfer single files via SFTP. Interactive terminal sessions are not supported. File transfers operate on individual files without folder synchronization.
Without a reverse proxy like Traefik or nginx in front, traffic runs without TLS termination.
What it helps with
- manage agent SSH access from a single gateway
- enforce command allowlists on remote targets
- isolate failing hosts using circuit breakers
- track agent commands in structured JSONL audit logs
- transfer individual files to remote hosts over SFTP
Example prompts for the agent
- Check connectivity to host
my-serverusingssh_check_connection - Run
uptimeonmy-serverwithssh_execute_command - Download
/var/log/app.logfrom the remote server usingssh_download_file
How to install ssh-mcp
Install
The MCP registry has no launch command for it: see the repository README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about ssh-mcp
How to set up and run ssh-mcp for Claude Code?
Deploy the container by running docker compose pull followed by docker compose up -d. Connect the client over Streamable HTTP to http://host:9080/mcp using an X-API-Key or Authorization: Bearer header.
What does ssh-mcp do?
It acts as an intermediary gateway between AI agents and target machines over SSH. The server enforces command policies, records structured JSONL audit logs, and applies rate limits.
Does ssh-mcp support interactive shell sessions or folder transfers?
No, commands run individually with structured responses rather than an interactive terminal. SFTP file transfers handle single files without recursive directory sync.