Skip to main content
Glama

run_ssh_command

Execute pre-approved SSH commands on remote Linux servers using command templates for tasks like checking disk usage, monitoring services, viewing logs, and listing processes.

Instructions

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).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
host_idYes
template_idYes
paramsNo
session_idNo

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