mcp-ssh
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| SSH_HOST | No | 远程主机 IP 或域名 | 127.0.0.1 |
| SSH_PORT | No | SSH 端口 | 22 |
| SSH_TIMEOUT | No | 连接超时秒数 | 30 |
| SSH_KEY_FILE | No | 私钥路径,如 ~/.ssh/id_rsa | |
| SSH_PASSWORD | No | 密码(使用密钥认证时可省略) | |
| SSH_USERNAME | No | SSH 用户名 | root |
| SSH_HOSTS_JSON | No | 多主机 JSON 配置(见文档) | |
| MCP_SSH_LOG_LEVEL | No | 日志级别:DEBUG / INFO / WARNING / ERROR | WARNING |
| SSH_KEY_PASSPHRASE | No | 加密私钥的口令 | |
| SSH_KNOWN_HOSTS_FILE | No | 自定义 known_hosts 路径 | ~/.ssh/known_hosts |
| SSH_IGNORE_KNOWN_HOSTS | No | 跳过主机密钥校验(生产环境不推荐) | 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
| 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 |
|---|---|
| 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
| 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/zhouxiangjing/mcp-ssh'
If you have feedback or need assistance with the MCP directory API, please join our Discord server