SSH MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| SSH_MCP_AUTH_TOKEN | No | Bearer token (empty = dev mode) | |
| SSH_MCP_CONFIG_DIR | No | Base config directory (all other paths derive from this) | ~/.ssh-mcp |
| SSH_MCP_HOSTS_FILE | No | Path to hosts configuration | {config_dir}/hosts.json |
| SSH_MCP_MAX_SESSIONS | No | Max simultaneous SSH sessions | 10 |
| SSH_MCP_AUDIT_LOG_DIR | No | Audit log directory | {config_dir}/audit_logs |
| SSH_MCP_CERT_DATA_DIR | No | Certificate storage directory | {config_dir}/cert_data |
| SSH_MCP_TEMPLATES_FILE | No | Path to command templates | {config_dir}/templates.json |
| SSH_MCP_JOB_TTL_SECONDS | No | Background job auto-expiry (1 hour) | 3600 |
| SSH_MCP_APPROVAL_DATA_DIR | No | Approval data directory | {config_dir}/approval_data |
| SSH_MCP_KEEPALIVE_INTERVAL | No | SSH keepalive interval (seconds) | 15 |
| SSH_MCP_KEEPALIVE_COUNT_MAX | No | Max failed keepalive probes before disconnect | 3 |
| SSH_MCP_MAX_BACKGROUND_JOBS | No | Max concurrent background jobs | 10 |
| SSH_MCP_SSH_TIMEOUT_SECONDS | No | SSH connection timeout | 30 |
| SSH_MCP_JOB_OUTPUT_MAX_BYTES | No | Max output buffer per background job (1 MB) | 1048576 |
| SSH_MCP_SESSION_IDLE_TIMEOUT | No | Idle session timeout (seconds) | 300 |
| SSH_MCP_SSH_KNOWN_HOSTS_FILE | No | Path to SSH known_hosts file | |
| SSH_MCP_REQUIRE_TWO_PARTY_APPROVAL | No | Require different user as approver | true |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_hostsA | List all allowed SSH hosts with metadata (labels, roles, description). No authentication required beyond basic identity. Risk level: low. |
| get_host_factsA | Get safe host metadata (OS, uptime, kernel) — no secrets. Risk level: low. |
| list_templatesA | List all available command templates that can be used with run_ssh_command. Each template defines a pre-approved command pattern with its allowed parameters, roles, and risk level. Use the template_id when calling run_ssh_command. Risk level: low. |
| get_audit_logsB | Return the last N audit log entries. Read-only. Risk level: low. |
| run_ssh_commandA | Execute a pre-approved command template on a target host. Use list_templates to discover available template_ids. Examples:
Only commands from the template registry are allowed. Parameters are validated against per-template regex rules. Output is automatically redacted for secrets. Pass session_id from ssh_connect to reuse a persistent connection. Risk level: medium (requires user confirmation in VS Code). |
| transfer_fileA | Upload or download a file to/from a remote host. Enforces path policy, blocked extensions, and size limits. Downloads require a justification string. For uploads, provide local_path (the file to upload). Pass session_id from ssh_connect to reuse a persistent connection. Risk level: medium-high (requires user confirmation). |
| add_ssh_keyA | Register a new SSH public key with policy checks. Validates key format and strength. Enforces TTL limits from key policy. Requires ADMIN role and prior approval. Risk level: high (requires approval). |
| remove_ssh_keyA | Revoke / remove an SSH key by its key_id. Requires ADMIN role and prior approval. Risk level: high. |
| issue_certA | Issue a short-lived SSH certificate for a user. Certificates are signed by the local CA with a tight TTL. Requires ADMIN role and prior approval. Risk level: high. |
| revoke_certA | Revoke an issued SSH certificate. Revoked certificates are added to the revocation list and their PEM files are deleted. Requires ADMIN role and prior approval. Risk level: high. |
| request_approvalA | Request approval for a privileged (Tier 2) operation. Returns a request_id and one-time approval_token. The token must be presented to the approver. The request_id is then passed to the privileged tool. Risk level: low (creating a request is safe). |
| approve_requestA | Approve a pending approval request. In two-party mode, the approver must be a different user from the requester. Risk level: high (grants execution permission). |
| list_pending_approvalsA | List all pending approval requests. Risk level: low (read-only). |
| ssh_connectA | Open a persistent SSH session to a host. Returns a session_id that can be passed to run_ssh_command and transfer_file to reuse the connection. Sessions have keepalive probes and auto-close after idle timeout. Risk level: low. |
| ssh_disconnectB | Close a persistent SSH session. Risk level: low. |
| ssh_list_sessionsA | List all active SSH sessions and remaining connection slots. Risk level: low. |
| ssh_session_pingA | Health-check a persistent SSH session. Returns liveness, idle time, and uptime. Risk level: low. |
| run_ssh_command_backgroundA | Start a template command in the background (non-blocking). Returns a job_id immediately. Use poll_background_job to read output, list_background_jobs to see all jobs, or cancel_background_job to stop. Same template-only security model as run_ssh_command. Risk level: medium (requires user confirmation). |
| poll_background_jobA | Read accumulated output and status of a background job (redacted). Returns new stdout since last poll, plus current status and exit code. Risk level: low (read-only). |
| list_background_jobsA | List all background jobs (running + completed). Risk level: low (read-only). |
| cancel_background_jobB | Cancel a running background job. Risk level: medium (requires user confirmation). |
| sftp_list_directoryA | List files and directories at a remote path. Only paths within the configured allowed_paths are accessible. Risk level: low (read-only). |
| sftp_deleteA | Delete a remote file via SFTP. Only files within allowed_paths can be deleted. Blocked extensions are enforced. Requires a justification. Risk level: medium (requires user confirmation). |
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/bhayanak/ssh-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server