ssh-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| SSH_MCP_SCP_BIN | No | Path to the SCP client | scp |
| SSH_MCP_SSH_BIN | No | Path to the SSH client | ssh |
| SSH_MCP_TMUX_BIN | No | Path to tmux | tmux |
| SSH_MCP_RSYNC_BIN | No | Path to rsync | rsync |
| SSH_MCP_STATE_DIR | No | Where transcripts are stored | ~/.local/state/ssh-mcp |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| ssh_execA | Run a one-off remote SSH command and return stdout, stderr, and exit metadata. The command runs in a non-interactive context. Use 'cwd' and 'env' for remote directory and environment setup (requires a POSIX shell on the remote). For interactive or long-running commands, use ssh_ensure_session instead. |
| ssh_scpB | Copy files or directories between the local machine and one remote target via the local scp client. |
| ssh_syncB | Incrementally sync files or directories between the local machine and one remote target via local rsync over SSH. |
| ssh_viewA | Read a remote file or list a remote directory over SSH — the remote counterpart of the local file-viewing tool. For a file, returns its content plus 'size_bytes' and 'total_lines'. Content is truncated at 20KB by default when 'view_range' isn't given and 'force_read_large_files' isn't set; use 'view_range' to page through large files instead. For a directory, returns non-hidden entries up to 2 levels deep. |
| ssh_createA | Create a new remote file over SSH with the given content — the remote counterpart of the local file-creation tool. Fails if the path already exists (use ssh_edit to modify an existing file) or if the remote parent directory doesn't exist. |
| ssh_editA | Replace exact text in an existing remote file over SSH — the remote counterpart of the local file-editing tool. Each edit's 'old_str' must match exactly one location in the file (as it stands after any earlier edits in the same call); ambiguous or missing matches fail without writing anything. Provide multiple {old_str, new_str} entries in 'edits' to batch several changes to the same file into a single read-then-write round trip instead of one SSH round trip per edit. |
| ssh_grepA | Search remote file contents over SSH — the remote counterpart of the local content-search tool. Backed by remote grep (PCRE-like -P when available, otherwise POSIX extended regex), recursing under 'path' while skipping .git/.hg/.svn. Defaults to 'files_with_matches' mode for efficiency; use 'content' mode for matching lines with line numbers and optional context. |
| ssh_globA | Find remote files by name pattern over SSH — the remote counterpart of the local filename-pattern tool. Supports '', '?', '[seq]'/'[!seq]', '{a,b}' alternation, and '' for matching across multiple path segments (e.g. 'src//.ts'). A path segment starting with '.' is only matched by a pattern segment that itself starts with '.'. Enumerates under 'path' via remote find, skipping .git/.hg/.svn; matching is done locally. |
| ssh_start_sessionA | Start a new persistent interactive SSH session backed by a local PTY. Returns the session id, initial output, and observer metadata. If 'truncated' is true or 'pending_output_chars' > 0 in the response, call ssh_read_session to retrieve the remaining buffered output. For most agent workflows, prefer ssh_ensure_session instead — it reuses existing sessions and avoids accidental duplicates. |
| ssh_ensure_sessionA | Return an existing running SSH session or start a new one. This is the recommended tool for agent workflows — always provide a descriptive session_name so the session can be reliably found across tool calls and conversations. When a session is reused (reused=true in response), the cwd, env, and shell parameters are ignored — they only apply when creating a new session. Check 'created' vs 'reused' in the response to know which happened. |
| ssh_read_sessionA | Read unread output from a tracked SSH session. Set wait_seconds (e.g. 1-10) to block until new output arrives; 0 returns immediately with whatever is buffered right now. Default: 1.0. If 'truncated' is true or 'pending_output_chars' > 0, call again to drain remaining output. Check 'running' to know whether the session is still alive. |
| ssh_write_sessionA | Write text or a control sequence to a tracked SSH session PTY. Always terminate commands with a trailing newline (\n) to submit them. Control characters: \u0003 for Ctrl-C, \u0004 for Ctrl-D, \u001a for Ctrl-Z. Use wait_seconds (e.g. 1-5) to receive the command response in the same call. Check 'pending_output_chars' in the response; if non-zero, call ssh_read_session to drain. |
| ssh_stop_sessionA | Terminate a tracked SSH session, close any attached tmux observer, and return final unread output plus exit metadata. The transcript file is preserved on disk. |
| ssh_list_sessionsA | List tracked SSH sessions with their session_id, session_name, target, state, uptime, and observer details (including tmux_session_name for cross-referencing with tmux ls). Use session_name filter to find a specific named session. |
| ssh_forwardA | Start a dedicated SSH port forward (local or remote). This is a separate tool from ssh_exec/ssh_start_session so MCP clients can permission-gate port forwarding independently. Use direction 'local' to make a remote service reachable on a local port, or 'remote' to expose a local service on the remote host. |
| ssh_list_forwardsA | List tracked SSH port forwards with their forward_id, direction, ports, target, and running status. |
| ssh_stop_forwardC | Stop a tracked SSH port forward and return its final status. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
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/slepp/ssh-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server