Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
SSH_HOSTNo远程主机 IP 或域名127.0.0.1
SSH_PORTNoSSH 端口22
SSH_TIMEOUTNo连接超时秒数30
SSH_KEY_FILENo私钥路径,如 ~/.ssh/id_rsa
SSH_PASSWORDNo密码(使用密钥认证时可省略)
SSH_USERNAMENoSSH 用户名root
SSH_HOSTS_JSONNo多主机 JSON 配置(见文档)
MCP_SSH_LOG_LEVELNo日志级别:DEBUG / INFO / WARNING / ERRORWARNING
SSH_KEY_PASSPHRASENo加密私钥的口令
SSH_KNOWN_HOSTS_FILENo自定义 known_hosts 路径~/.ssh/known_hosts
SSH_IGNORE_KNOWN_HOSTSNo跳过主机密钥校验(生产环境不推荐)false

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

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

Tools

Functions exposed to the LLM to take actions

NameDescription
test_connectionA

Test SSH connectivity to the target host.

Verifies the connection is alive and returns basic server identity.

Args: host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Connection status and remote hostname.

list_configured_hostsA

List all SSH hosts configured in SSH_HOSTS_JSON.

Returns: Table of configured host names and their connection details.

close_connectionA

Close the SSH connection to a host.

The connection will be re-established automatically on the next tool call.

Args: host_name: Named host to disconnect; disconnects default host if omitted.

Returns: Confirmation message.

close_all_connectionsA

Close all active SSH connections.

Returns: Confirmation message.

check_disk_healthB

Check disk health using SMART data and filesystem errors.

Args: host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Disk health status and any detected errors.

check_high_loadA

Diagnose high CPU/memory load and identify resource hogs.

Args: host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Top resource consumers and system load details.

check_network_connectivityA

Test outbound network connectivity from the remote server.

Args: target: IP or hostname to ping/reach (default "8.8.8.8"). host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Ping results and DNS resolution status.

check_securityA

Run a basic security audit of the remote server.

Checks for: failed login attempts, listening ports, SUID files, world-writable directories, and recent auth log entries.

Args: host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Security audit report.

tail_logA

Tail the end of a remote log file.

Args: path: Absolute path to the log file (e.g., "/var/log/nginx/error.log"). lines: Number of lines to retrieve from the end (default 50). host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Last N lines of the log file.

analyze_log_errorsA

Analyze a log file for error patterns and summarize findings.

Searches for ERROR, WARN, CRITICAL, Exception, and similar keywords.

Args: path: Absolute path to the log file. host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Error/warning summary with counts and recent examples.

execute_commandA

Execute a shell command on the remote SSH server.

Runs any shell command and returns stdout + stderr. Suitable for one-off commands, diagnostics, log tailing, service control, etc.

Args: command: The shell command to execute (e.g., "df -h", "systemctl status nginx"). timeout: Maximum seconds to wait for the command to finish (default 60). host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Command output (stdout), or combined stdout/stderr on error.

execute_scriptA

Execute a multi-line shell script on the remote SSH server.

Uploads the script via stdin and runs it with the specified shell. Useful for multi-step automation, configuration changes, or complex checks.

Args: script: The full script content (multi-line bash/sh/python script). shell: Shell interpreter to use: "bash", "sh", "python3", etc. (default "bash"). timeout: Maximum seconds to wait (default 120). host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Script output or error details.

read_fileA

Read the content of a remote file.

Args: path: Absolute path to the file (e.g., "/etc/nginx/nginx.conf"). max_lines: Maximum number of lines to return (default 200, 0 = unlimited). host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: File content as text.

write_fileA

Write content to a remote file (overwrites existing content).

Creates parent directories if they do not exist.

Args: path: Absolute path to the destination file. content: Text content to write. host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Success message or error details.

append_fileA

Append content to a remote file.

Args: path: Absolute path to the file. content: Text content to append. host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Success message or error details.

list_directoryA

List files and directories at a remote path.

Args: path: Directory path to list (default "/"). host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Directory listing with permissions, size, and modification time.

delete_fileA

Delete a file or directory on the remote server.

Args: path: Absolute path to delete. recursive: If True, delete directory and all its contents (use with caution). host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Success message or error details.

search_filesA

Search for files by name pattern in a remote directory tree.

Args: path: Root directory to search from. pattern: File name pattern (e.g., "*.log", "nginx.conf"). file_type: Filter by type: "file" (f), "dir" (d), or "any" (default). host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: List of matching file paths.

grep_fileA

Search for a text pattern in remote files.

Args: path: File path or directory to search. pattern: Text or regex pattern to search for. recursive: Search recursively in directories (default False). ignore_case: Case-insensitive search (default True). context_lines: Lines of context around each match (default 2). host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Matching lines with file names and line numbers.

list_processesA

List running processes sorted by resource usage.

Args: sort_by: Sort field: "cpu" (default), "mem", or "pid". limit: Number of processes to show (default 20). host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Process list with PID, user, CPU%, MEM%, and command.

find_processA

Search for processes by name or keyword.

Args: name: Process name or keyword to search (e.g., "nginx", "python"). host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Matching processes with their PIDs and details.

kill_processA

Send a signal to a process by PID.

Args: pid: Process ID to signal. signal: Signal name: "TERM" (graceful, default), "KILL" (force), "HUP" (reload). host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Result of the kill command.

get_open_portsA

List all open listening ports and their associated processes.

Args: host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Listening ports with protocol, port number, and process name.

upload_fileA

Upload a local file to the remote server via SFTP.

Args: local_path: Absolute local file path (on the machine running this MCP server). remote_path: Destination absolute path on the remote server. host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Success message with transferred file size, or error details.

download_fileA

Download a file from the remote server to local via SFTP.

Args: remote_path: Absolute file path on the remote server. local_path: Destination absolute local path (on the machine running this MCP server). host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Success message with transferred file size, or error details.

get_file_infoA

Get detailed metadata of a remote file or directory.

Args: path: Absolute path on the remote server. host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: File metadata: size, permissions, owner, modification time.

get_system_overviewA

Get a comprehensive system overview of the remote server.

Collects hostname, OS release, kernel, uptime, CPU, memory, disk, and load average in one call. Best starting point for system analysis.

Args: host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Formatted system overview report.

get_cpu_infoA

Get detailed CPU usage and statistics.

Returns current CPU load, per-core usage, and top CPU-consuming processes.

Args: host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: CPU usage report.

get_memory_infoA

Get memory and swap usage details.

Args: host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Memory usage report including free, used, cached, and swap.

get_disk_infoA

Get disk usage and I/O statistics.

Args: host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Disk usage per filesystem and I/O stats.

get_network_infoA

Get network interface status, connections, and statistics.

Args: host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Network interfaces, active connections, and routing table.

get_system_logsA

Retrieve system logs from journald or /var/log/syslog.

Args: lines: Number of recent log lines to retrieve (default 100). unit: Optional systemd service name to filter logs (e.g., "nginx", "sshd"). host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Recent system log entries.

check_service_statusA

Check the status of a systemd service.

Args: service: Service name (e.g., "nginx", "mysql", "docker"). host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Service status including active state, PID, and recent logs.

manage_serviceA

Start, stop, restart, or reload a systemd service.

Args: service: Service name (e.g., "nginx", "mysql", "docker"). action: Action to perform: "start", "stop", "restart", "reload", "enable", "disable". host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Result of the service management action.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.9/5.0

Scored across 34 tools

Disambiguation4/5

Most tools are clearly distinct, targeting specific resources and actions (file ops, process ops, system info). However, some overlap exists between diagnostic tools like check_high_load and get_cpu_info/get_memory_info, and between execute_command and execute_script, which could cause agents to select the wrong tool in ambiguous situations.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case (e.g., read_file, list_processes, get_system_overview, manage_service). Even less conventional names like tail_log and grep_file are still recognizable and fit the pattern.

Tool Count2/5

With 34 tools, this server significantly exceeds the recommended range for a typical MCP server. While the domain is broad, many tools could be consolidated (e.g., get_cpu_info, get_memory_info, get_disk_info could be subsumed into get_system_overview), and the high count introduces unnecessary complexity for agents.

Completeness5/5

The tool set provides comprehensive coverage of SSH operations: connection management, file transfer and editing, process control, system monitoring, log inspection, service management, and diagnostics. No obvious dead ends or missing CRUD operations exist for the stated purpose.

Maintenance

ActivityInactive
ResponsivenessNo issues