Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
SSH_HOSTNoHostname or IP address of the remote Linux server. If not set, you must provide it when calling ssh_connect.
SSH_PORTNoSSH port number. Only change this if your server uses a non-standard SSH port.22
SSH_KEY_PATHNoAbsolute path to an SSH private key file (e.g., C:\Users\pawan\.ssh\id_rsa). Used for key-based authentication.
SSH_PASSWORDNoSSH password for password-based authentication. Mutually optional with SSH_KEY_PATH.
SSH_USERNAMENoSSH username for authentication.root
SSH_MCP_CACHE_DIRNoDirectory where credential cache files are stored. The server creates this directory automatically if it doesn't exist.~/.ssh-mcp-cache

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
ssh_connectA

Connect to a remote Linux host via SSH and create a named session.

If a session with the same name exists, it will be disconnected first. Credentials are automatically cached for future reconnection.

Args: host: Linux server IP address or hostname username: SSH username (default: root) password: SSH password (leave empty if using key_path) key_path: Path to SSH private key file (alternative to password) port: SSH port number (default: 22) session_name: Name for this session, e.g. 'prod', 'staging' (default: 'default')

ssh_disconnectB

Disconnect a specific SSH session.

Args: session_name: Name of the session to disconnect (default: 'default')

ssh_disconnect_allB

Disconnect all active SSH sessions.

ssh_list_sessionsA

List all active SSH sessions with connection details.

Shows session name, host, username, uptime, and command count.

ssh_save_credentialsA

Save SSH credentials for a session name (persisted to disk for future use).

Saved credentials are used for auto-reconnect and future sessions.

Args: session_name: Name to save these credentials under host: Linux server hostname or IP username: SSH username password: SSH password (leave empty if using key) key_path: Path to SSH private key port: SSH port

ssh_list_saved_credentialsA

List all saved SSH credentials (passwords are masked for security).

Shows credentials from environment variables and cached sessions.

ssh_executeA

Execute a shell command on the remote Linux machine.

Returns stdout, stderr, and exit code. Output is truncated if too large.

Args: command: Shell command to execute (e.g., 'ls -la /var/log') session_name: SSH session to use (default: 'default') timeout: Command timeout in seconds (default: 30, max: 300)

ssh_execute_scriptC

Execute a multi-line bash script on the remote machine.

The script is passed to bash via stdin. Use this for complex operations.

Args: script: Multi-line bash script content session_name: SSH session to use (default: 'default') timeout: Script timeout in seconds (default: 60, max: 300)

ssh_execute_backgroundA

Run a command in the background using nohup.

The command will continue running even after the SSH session ends. Output is redirected to a log file.

Args: command: Command to run in background log_file: Path for output log (default: /tmp/bg_command_.log) session_name: SSH session to use (default: 'default')

ssh_list_directoryC

List directory contents with details (permissions, owner, size, date).

Args: path: Directory path to list (default: '/') session_name: SSH session to use show_hidden: Include hidden files (default: True)

ssh_create_directoryA

Create a directory (and parent directories if needed).

Args: path: Directory path to create (uses mkdir -p) session_name: SSH session to use

ssh_read_fileA

Read the contents of a file on the remote machine.

Args: path: Absolute path to the file session_name: SSH session to use max_lines: Maximum number of lines to read (0 = all lines)

ssh_write_fileA

Write content to a file on the remote machine.

Args: path: Absolute path to the file content: Content to write session_name: SSH session to use append: If True, append to file instead of overwriting

ssh_deleteA

Delete a file or directory on the remote machine.

Args: path: Path to delete session_name: SSH session to use recursive: If True, delete directories recursively (rm -rf)

ssh_moveC

Move or rename a file/directory.

Args: source: Source path destination: Destination path session_name: SSH session to use

ssh_copyB

Copy a file or directory.

Args: source: Source path destination: Destination path session_name: SSH session to use recursive: If True, copy directories recursively

ssh_file_infoB

Get detailed information about a file (size, type, permissions, owner, timestamps).

Args: path: Path to the file session_name: SSH session to use

ssh_file_permissionsB

Change file permissions (chmod).

Args: path: Path to file/directory permissions: Permission string (e.g., '755', '644', 'u+x') session_name: SSH session to use recursive: Apply recursively to directories

ssh_change_ownerC

Change file ownership (chown).

Args: path: Path to file/directory owner: New owner username group: New group name (optional) session_name: SSH session to use recursive: Apply recursively

ssh_find_filesB

Find files and directories using the 'find' command with filters.

Args: path: Base directory to search in name: File name pattern (supports wildcards, e.g., '*.log') file_type: Type filter — 'f' for files, 'd' for directories, 'l' for symlinks size: Size filter (e.g., '+10M' for >10MB, '-1k' for <1KB) modified_within: Time filter (e.g., '7' for modified in last 7 days) session_name: SSH session to use

ssh_disk_file_usageB

Check disk usage of a file or directory (du -sh).

Args: path: Path to check session_name: SSH session to use

ssh_search_in_filesB

Search for a pattern in files using grep.

Args: pattern: Search pattern (text or regex) path: File or directory to search in session_name: SSH session to use case_insensitive: Case-insensitive search recursive: Search recursively in directories

ssh_tail_fileA

Get the last N lines of a file (useful for logs).

Args: path: Path to the file lines: Number of lines from the end (default: 50) session_name: SSH session to use

ssh_head_fileB

Get the first N lines of a file.

Args: path: Path to the file lines: Number of lines from the beginning (default: 50) session_name: SSH session to use

ssh_search_logsB

Search system logs using journalctl or grep.

Args: pattern: Search pattern log_path: Specific log file path (if empty, uses journalctl) session_name: SSH session to use since: Time filter for journalctl (e.g., '1 hour ago', '2024-01-01', 'today')

ssh_sed_replaceB

Find and replace text in a file using sed.

Args: file_path: Path to the file find: Text pattern to find replace: Replacement text session_name: SSH session to use backup: Create a .bak backup before modifying (default: True)

ssh_system_infoC

Get comprehensive system information (OS, kernel, CPU, RAM, uptime, hostname).

Args: session_name: SSH session to use

ssh_disk_usageA

Show disk usage across all mounted filesystems (df -h).

Args: session_name: SSH session to use

ssh_memory_usageB

Show detailed memory and swap usage.

Args: session_name: SSH session to use

ssh_cpu_infoB

Show CPU information, core count, and current load averages.

Args: session_name: SSH session to use

ssh_process_listB

List running processes with optional filtering and sorting.

Args: session_name: SSH session to use filter_pattern: Filter processes by name/pattern (grep) sort_by: Sort by 'cpu' or 'mem' (default: no sorting)

ssh_top_processesA

Show top N processes by CPU or memory usage.

Args: session_name: SSH session to use count: Number of processes to show (default: 10) sort_by: Sort by 'cpu' or 'mem' (default: 'cpu')

ssh_kill_processB

Kill a process by its PID.

Args: pid: Process ID to kill session_name: SSH session to use signal: Signal to send (default: TERM, options: KILL, HUP, INT, etc.)

ssh_system_loadA

Show system load averages (1, 5, 15 minutes) and running process count.

Args: session_name: SSH session to use

ssh_network_infoC

Show network interfaces, IP addresses, and basic network configuration.

Args: session_name: SSH session to use

ssh_open_portsB

List all listening (open) ports and the processes using them.

Args: session_name: SSH session to use

ssh_check_portA

Test if a specific port is reachable from the remote machine.

Args: host: Target hostname or IP port: Target port number session_name: SSH session to use

ssh_pingC

Ping a host from the remote machine.

Args: target: Hostname or IP to ping count: Number of ping packets (default: 4) session_name: SSH session to use

ssh_dns_lookupA

Perform DNS lookup for a domain.

Args: domain: Domain name to look up session_name: SSH session to use

ssh_docker_psA

List Docker containers (running or all).

Args: session_name: SSH session to use all: If True, show all containers including stopped ones

ssh_docker_logsB

Get Docker container logs.

Args: container: Container name or ID session_name: SSH session to use lines: Number of log lines to retrieve (default: 100)

ssh_docker_execA

Execute a command inside a running Docker container.

Args: container: Container name or ID command: Command to execute inside the container session_name: SSH session to use

ssh_docker_imagesC

List Docker images on the remote machine.

Args: session_name: SSH session to use

ssh_docker_statsB

Show Docker container resource usage statistics (CPU, memory, network).

Args: session_name: SSH session to use

ssh_docker_composeB

Run docker compose commands.

Args: action: Compose action — 'up', 'down', 'restart', 'ps', 'logs', 'build', 'pull' path: Path to the directory containing docker-compose.yml session_name: SSH session to use

ssh_docker_inspectA

Inspect a Docker container (detailed configuration and state).

Args: container: Container name or ID session_name: SSH session to use

ssh_install_packageA

Install a package (auto-detects apt/yum/dnf/pacman).

Args: package: Package name to install session_name: SSH session to use

ssh_remove_packageB

Remove/uninstall a package.

Args: package: Package name to remove session_name: SSH session to use

ssh_list_packagesB

List installed packages with optional filter.

Args: filter_pattern: Filter packages by name pattern session_name: SSH session to use

ssh_check_updatesC

Check for available package updates.

Args: session_name: SSH session to use

ssh_list_usersA

List system users (human accounts with login shells).

Args: session_name: SSH session to use

ssh_user_infoB

Get detailed information about a specific user.

Args: username: Username to look up session_name: SSH session to use

ssh_whoamiB

Show current user, groups, and environment info.

Args: session_name: SSH session to use

ssh_last_loginsA

Show recent login history.

Args: session_name: SSH session to use count: Number of recent logins to show (default: 20)

ssh_list_cronA

List cron jobs for the current or specified user.

Args: user: Username (empty = current user) session_name: SSH session to use

ssh_add_cronB

Add a new cron job for the current user.

Args: schedule: Cron schedule expression (e.g., '0 2 * * *' for daily at 2am) command: Command to run session_name: SSH session to use

ssh_remove_cronB

Remove cron jobs matching a pattern.

Args: pattern: Pattern to match (lines containing this will be removed) session_name: SSH session to use

ssh_compressA

Compress files or directories into an archive.

Args: source: Path to file/directory to compress destination: Output archive path (auto-generated if empty) session_name: SSH session to use format: Archive format — 'tar.gz' (default), 'tar.bz2', 'zip'

ssh_extractB

Extract an archive file.

Supports: .tar.gz, .tgz, .tar.bz2, .tar, .zip, .gz, .bz2

Args: archive: Path to the archive file destination: Directory to extract to (default: current directory) session_name: SSH session to use

ssh_check_serviceB

Check the status of a systemd service.

Args: service: Service name (e.g., 'nginx', 'docker', 'sshd') session_name: SSH session to use

ssh_manage_serviceA

Manage a systemd service (start, stop, restart, enable, disable).

Args: service: Service name (e.g., 'nginx', 'docker') action: Action — 'start', 'stop', 'restart', 'enable', 'disable', 'reload' session_name: SSH session to use

ssh_failed_loginsA

Show recent failed login attempts (from auth.log or journalctl).

Args: session_name: SSH session to use count: Number of entries to show (default: 30)

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/Pawangunjkar/linux-ssh-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server