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 |
Capabilities
Features and capabilities supported by this server
| 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_hosts | List all allowed SSH hosts with metadata (labels, roles, description). No authentication required beyond basic identity. Risk level: low. |
| get_host_facts | Get safe host metadata (OS, uptime, kernel) — no secrets. Risk level: low. |
| list_templates | 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_logs | Return the last N audit log entries. Read-only. Risk level: low. |
| run_ssh_command | 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_file | 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_key | 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_key | Revoke / remove an SSH key by its key_id. Requires ADMIN role and prior approval. Risk level: high. |
| issue_cert | 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_cert | 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_approval | 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_request | 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_approvals | List all pending approval requests. Risk level: low (read-only). |
| ssh_connect | 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_disconnect | Close a persistent SSH session. Risk level: low. |
| ssh_list_sessions | List all active SSH sessions and remaining connection slots. Risk level: low. |
| ssh_session_ping | Health-check a persistent SSH session. Returns liveness, idle time, and uptime. Risk level: low. |
| run_ssh_command_background | 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_job | 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_jobs | List all background jobs (running + completed). Risk level: low (read-only). |
| cancel_background_job | Cancel a running background job. Risk level: medium (requires user confirmation). |
| sftp_list_directory | List files and directories at a remote path. Only paths within the configured allowed_paths are accessible. Risk level: low (read-only). |
| sftp_delete | 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 | |