Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
SSH_MCP_AUTH_TOKENNoBearer token (empty = dev mode)
SSH_MCP_CONFIG_DIRNoBase config directory (all other paths derive from this)~/.ssh-mcp
SSH_MCP_HOSTS_FILENoPath to hosts configuration{config_dir}/hosts.json
SSH_MCP_MAX_SESSIONSNoMax simultaneous SSH sessions10
SSH_MCP_AUDIT_LOG_DIRNoAudit log directory{config_dir}/audit_logs
SSH_MCP_CERT_DATA_DIRNoCertificate storage directory{config_dir}/cert_data
SSH_MCP_TEMPLATES_FILENoPath to command templates{config_dir}/templates.json
SSH_MCP_JOB_TTL_SECONDSNoBackground job auto-expiry (1 hour)3600
SSH_MCP_APPROVAL_DATA_DIRNoApproval data directory{config_dir}/approval_data
SSH_MCP_KEEPALIVE_INTERVALNoSSH keepalive interval (seconds)15
SSH_MCP_KEEPALIVE_COUNT_MAXNoMax failed keepalive probes before disconnect3
SSH_MCP_MAX_BACKGROUND_JOBSNoMax concurrent background jobs10
SSH_MCP_SSH_TIMEOUT_SECONDSNoSSH connection timeout30
SSH_MCP_JOB_OUTPUT_MAX_BYTESNoMax output buffer per background job (1 MB)1048576
SSH_MCP_SESSION_IDLE_TIMEOUTNoIdle session timeout (seconds)300
SSH_MCP_SSH_KNOWN_HOSTS_FILENoPath to SSH known_hosts file
SSH_MCP_REQUIRE_TWO_PARTY_APPROVALNoRequire different user as approvertrue

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
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:

  • disk_usage: run df -h (no params needed)

  • service_status: check a systemd service (params: {"service": "docker"})

  • list_processes: show top processes by memory (no params needed)

  • tail_log: tail a log file (params: {"lines": "100", "log_path": "/var/log/syslog"})

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

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

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