pawangunjkar-linux-ssh-mcp
v1.0.0MCP server for SSH operations on remote Linux machines — 50+ tools for file management, system monitoring, Docker, networking, and more
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
ssh_connect
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')…
| Parameter | Type | Description |
|---|---|---|
host * | string | |
key_path | string | |
password | string | |
port | integer | |
session_name | string | |
username | string |
ssh_disconnect
Disconnect a specific SSH session. Args: session_name: Name of the session to disconnect (default: 'default')
| Parameter | Type | Description |
|---|---|---|
session_name | string |
ssh_disconnect_all
Disconnect all active SSH sessions.
ssh_list_sessions
List all active SSH sessions with connection details. Shows session name, host, username, uptime, and command count.
ssh_save_credentials
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
| Parameter | Type | Description |
|---|---|---|
host * | string | |
session_name * | string | |
key_path | string | |
password | string | |
port | integer | |
username | string |
ssh_list_saved_credentials
List all saved SSH credentials (passwords are masked for security). Shows credentials from environment variables and cached sessions.
ssh_execute
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)
| Parameter | Type | Description |
|---|---|---|
command * | string | |
session_name | string | |
timeout | integer |
ssh_execute_script
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)
| Parameter | Type | Description |
|---|---|---|
script * | string | |
session_name | string | |
timeout | integer |
ssh_execute_background
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_<timestamp>.log) session_name: SSH session to use (default: 'default')
| Parameter | Type | Description |
|---|---|---|
command * | string | |
log_file | string | |
session_name | string |
ssh_list_directory
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)
| Parameter | Type | Description |
|---|---|---|
path | string | |
session_name | string | |
show_hidden | boolean |
ssh_create_directory
Create a directory (and parent directories if needed). Args: path: Directory path to create (uses mkdir -p) session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
path * | string | |
session_name | string |
ssh_read_file
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)
| Parameter | Type | Description |
|---|---|---|
path * | string | |
max_lines | integer | |
session_name | string |
ssh_write_file
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
| Parameter | Type | Description |
|---|---|---|
content * | string | |
path * | string | |
append | boolean | |
session_name | string |
ssh_delete
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)
| Parameter | Type | Description |
|---|---|---|
path * | string | |
recursive | boolean | |
session_name | string |
ssh_move
Move or rename a file/directory. Args: source: Source path destination: Destination path session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
destination * | string | |
source * | string | |
session_name | string |
ssh_copy
Copy a file or directory. Args: source: Source path destination: Destination path session_name: SSH session to use recursive: If True, copy directories recursively
| Parameter | Type | Description |
|---|---|---|
destination * | string | |
source * | string | |
recursive | boolean | |
session_name | string |
ssh_file_info
Get detailed information about a file (size, type, permissions, owner, timestamps). Args: path: Path to the file session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
path * | string | |
session_name | string |
ssh_file_permissions
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
| Parameter | Type | Description |
|---|---|---|
path * | string | |
permissions * | string | |
recursive | boolean | |
session_name | string |
ssh_change_owner
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
| Parameter | Type | Description |
|---|---|---|
owner * | string | |
path * | string | |
group | string | |
recursive | boolean | |
session_name | string |
ssh_find_files
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
| Parameter | Type | Description |
|---|---|---|
file_type | string | |
modified_within | string | |
name | string | |
path | string | |
session_name | string | |
size | string |
ssh_disk_file_usage
Check disk usage of a file or directory (du -sh). Args: path: Path to check session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
path * | string | |
session_name | string |
ssh_search_in_files
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
| Parameter | Type | Description |
|---|---|---|
pattern * | string | |
case_insensitive | boolean | |
path | string | |
recursive | boolean | |
session_name | string |
ssh_tail_file
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
| Parameter | Type | Description |
|---|---|---|
path * | string | |
lines | integer | |
session_name | string |
ssh_head_file
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
| Parameter | Type | Description |
|---|---|---|
path * | string | |
lines | integer | |
session_name | string |
ssh_search_logs
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')
| Parameter | Type | Description |
|---|---|---|
pattern * | string | |
log_path | string | |
session_name | string | |
since | string |
ssh_sed_replace
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)
| Parameter | Type | Description |
|---|---|---|
file_path * | string | |
find * | string | |
replace * | string | |
backup | boolean | |
session_name | string |
ssh_system_info
Get comprehensive system information (OS, kernel, CPU, RAM, uptime, hostname). Args: session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
session_name | string |
ssh_disk_usage
Show disk usage across all mounted filesystems (df -h). Args: session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
session_name | string |
ssh_memory_usage
Show detailed memory and swap usage. Args: session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
session_name | string |
ssh_cpu_info
Show CPU information, core count, and current load averages. Args: session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
session_name | string |
ssh_process_list
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)
| Parameter | Type | Description |
|---|---|---|
filter_pattern | string | |
session_name | string | |
sort_by | string |
ssh_top_processes
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')
| Parameter | Type | Description |
|---|---|---|
count | integer | |
session_name | string | |
sort_by | string |
ssh_kill_process
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.)
| Parameter | Type | Description |
|---|---|---|
pid * | integer | |
session_name | string | |
signal | string |
ssh_system_load
Show system load averages (1, 5, 15 minutes) and running process count. Args: session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
session_name | string |
ssh_network_info
Show network interfaces, IP addresses, and basic network configuration. Args: session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
session_name | string |
ssh_open_ports
List all listening (open) ports and the processes using them. Args: session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
session_name | string |
ssh_check_port
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
| Parameter | Type | Description |
|---|---|---|
host * | string | |
port * | integer | |
session_name | string |
ssh_ping
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
| Parameter | Type | Description |
|---|---|---|
target * | string | |
count | integer | |
session_name | string |
ssh_dns_lookup
Perform DNS lookup for a domain. Args: domain: Domain name to look up session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
domain * | string | |
session_name | string |
ssh_docker_ps
List Docker containers (running or all). Args: session_name: SSH session to use all: If True, show all containers including stopped ones
| Parameter | Type | Description |
|---|---|---|
all | boolean | |
session_name | string |
ssh_docker_logs
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)
| Parameter | Type | Description |
|---|---|---|
container * | string | |
lines | integer | |
session_name | string |
ssh_docker_exec
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
| Parameter | Type | Description |
|---|---|---|
command * | string | |
container * | string | |
session_name | string |
ssh_docker_images
List Docker images on the remote machine. Args: session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
session_name | string |
ssh_docker_stats
Show Docker container resource usage statistics (CPU, memory, network). Args: session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
session_name | string |
ssh_docker_compose
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
| Parameter | Type | Description |
|---|---|---|
action * | string | |
path | string | |
session_name | string |
ssh_docker_inspect
Inspect a Docker container (detailed configuration and state). Args: container: Container name or ID session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
container * | string | |
session_name | string |
ssh_install_package
Install a package (auto-detects apt/yum/dnf/pacman). Args: package: Package name to install session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
package * | string | |
session_name | string |
ssh_remove_package
Remove/uninstall a package. Args: package: Package name to remove session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
package * | string | |
session_name | string |
ssh_list_packages
List installed packages with optional filter. Args: filter_pattern: Filter packages by name pattern session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
filter_pattern | string | |
session_name | string |
ssh_check_updates
Check for available package updates. Args: session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
session_name | string |
ssh_list_users
List system users (human accounts with login shells). Args: session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
session_name | string |
ssh_user_info
Get detailed information about a specific user. Args: username: Username to look up session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
username * | string | |
session_name | string |
ssh_whoami
Show current user, groups, and environment info. Args: session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
session_name | string |
ssh_last_logins
Show recent login history. Args: session_name: SSH session to use count: Number of recent logins to show (default: 20)
| Parameter | Type | Description |
|---|---|---|
count | integer | |
session_name | string |
ssh_list_cron
List cron jobs for the current or specified user. Args: user: Username (empty = current user) session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
session_name | string | |
user | string |
ssh_add_cron
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
| Parameter | Type | Description |
|---|---|---|
command * | string | |
schedule * | string | |
session_name | string |
ssh_remove_cron
Remove cron jobs matching a pattern. Args: pattern: Pattern to match (lines containing this will be removed) session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
pattern * | string | |
session_name | string |
ssh_compress
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'
| Parameter | Type | Description |
|---|---|---|
source * | string | |
destination | string | |
format | string | |
session_name | string |
ssh_extract
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
| Parameter | Type | Description |
|---|---|---|
archive * | string | |
destination | string | |
session_name | string |
ssh_check_service
Check the status of a systemd service. Args: service: Service name (e.g., 'nginx', 'docker', 'sshd') session_name: SSH session to use
| Parameter | Type | Description |
|---|---|---|
service * | string | |
session_name | string |
ssh_manage_service
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
| Parameter | Type | Description |
|---|---|---|
action * | string | |
service * | string | |
session_name | string |
ssh_failed_logins
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)
| Parameter | Type | Description |
|---|---|---|
count | integer | |
session_name | string |