pawangunjkar-linux-ssh-mcp

v1.0.0
pawangunjkar-linux-ssh-mcp Checked 15 hours ago Published 4 months ago

MCP 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')…

ParameterTypeDescription
host *string
key_pathstring
passwordstring
portinteger
session_namestring
usernamestring

ssh_disconnect

Disconnect a specific SSH session. Args: session_name: Name of the session to disconnect (default: 'default')

ParameterTypeDescription
session_namestring

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

ParameterTypeDescription
host *string
session_name *string
key_pathstring
passwordstring
portinteger
usernamestring

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)

ParameterTypeDescription
command *string
session_namestring
timeoutinteger

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)

ParameterTypeDescription
script *string
session_namestring
timeoutinteger

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

ParameterTypeDescription
command *string
log_filestring
session_namestring

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)

ParameterTypeDescription
pathstring
session_namestring
show_hiddenboolean

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

ParameterTypeDescription
path *string
session_namestring

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)

ParameterTypeDescription
path *string
max_linesinteger
session_namestring

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

ParameterTypeDescription
content *string
path *string
appendboolean
session_namestring

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)

ParameterTypeDescription
path *string
recursiveboolean
session_namestring

ssh_move

Move or rename a file/directory. Args: source: Source path destination: Destination path session_name: SSH session to use

ParameterTypeDescription
destination *string
source *string
session_namestring

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

ParameterTypeDescription
destination *string
source *string
recursiveboolean
session_namestring

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

ParameterTypeDescription
path *string
session_namestring

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

ParameterTypeDescription
path *string
permissions *string
recursiveboolean
session_namestring

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

ParameterTypeDescription
owner *string
path *string
groupstring
recursiveboolean
session_namestring

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

ParameterTypeDescription
file_typestring
modified_withinstring
namestring
pathstring
session_namestring
sizestring

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

ParameterTypeDescription
path *string
session_namestring

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

ParameterTypeDescription
pattern *string
case_insensitiveboolean
pathstring
recursiveboolean
session_namestring

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

ParameterTypeDescription
path *string
linesinteger
session_namestring

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

ParameterTypeDescription
path *string
linesinteger
session_namestring

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

ParameterTypeDescription
pattern *string
log_pathstring
session_namestring
sincestring

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)

ParameterTypeDescription
file_path *string
find *string
replace *string
backupboolean
session_namestring

ssh_system_info

Get comprehensive system information (OS, kernel, CPU, RAM, uptime, hostname). Args: session_name: SSH session to use

ParameterTypeDescription
session_namestring

ssh_disk_usage

Show disk usage across all mounted filesystems (df -h). Args: session_name: SSH session to use

ParameterTypeDescription
session_namestring

ssh_memory_usage

Show detailed memory and swap usage. Args: session_name: SSH session to use

ParameterTypeDescription
session_namestring

ssh_cpu_info

Show CPU information, core count, and current load averages. Args: session_name: SSH session to use

ParameterTypeDescription
session_namestring

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)

ParameterTypeDescription
filter_patternstring
session_namestring
sort_bystring

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

ParameterTypeDescription
countinteger
session_namestring
sort_bystring

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

ParameterTypeDescription
pid *integer
session_namestring
signalstring

ssh_system_load

Show system load averages (1, 5, 15 minutes) and running process count. Args: session_name: SSH session to use

ParameterTypeDescription
session_namestring

ssh_network_info

Show network interfaces, IP addresses, and basic network configuration. Args: session_name: SSH session to use

ParameterTypeDescription
session_namestring

ssh_open_ports

List all listening (open) ports and the processes using them. Args: session_name: SSH session to use

ParameterTypeDescription
session_namestring

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

ParameterTypeDescription
host *string
port *integer
session_namestring

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

ParameterTypeDescription
target *string
countinteger
session_namestring

ssh_dns_lookup

Perform DNS lookup for a domain. Args: domain: Domain name to look up session_name: SSH session to use

ParameterTypeDescription
domain *string
session_namestring

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

ParameterTypeDescription
allboolean
session_namestring

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)

ParameterTypeDescription
container *string
linesinteger
session_namestring

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

ParameterTypeDescription
command *string
container *string
session_namestring

ssh_docker_images

List Docker images on the remote machine. Args: session_name: SSH session to use

ParameterTypeDescription
session_namestring

ssh_docker_stats

Show Docker container resource usage statistics (CPU, memory, network). Args: session_name: SSH session to use

ParameterTypeDescription
session_namestring

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

ParameterTypeDescription
action *string
pathstring
session_namestring

ssh_docker_inspect

Inspect a Docker container (detailed configuration and state). Args: container: Container name or ID session_name: SSH session to use

ParameterTypeDescription
container *string
session_namestring

ssh_install_package

Install a package (auto-detects apt/yum/dnf/pacman). Args: package: Package name to install session_name: SSH session to use

ParameterTypeDescription
package *string
session_namestring

ssh_remove_package

Remove/uninstall a package. Args: package: Package name to remove session_name: SSH session to use

ParameterTypeDescription
package *string
session_namestring

ssh_list_packages

List installed packages with optional filter. Args: filter_pattern: Filter packages by name pattern session_name: SSH session to use

ParameterTypeDescription
filter_patternstring
session_namestring

ssh_check_updates

Check for available package updates. Args: session_name: SSH session to use

ParameterTypeDescription
session_namestring

ssh_list_users

List system users (human accounts with login shells). Args: session_name: SSH session to use

ParameterTypeDescription
session_namestring

ssh_user_info

Get detailed information about a specific user. Args: username: Username to look up session_name: SSH session to use

ParameterTypeDescription
username *string
session_namestring

ssh_whoami

Show current user, groups, and environment info. Args: session_name: SSH session to use

ParameterTypeDescription
session_namestring

ssh_last_logins

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

ParameterTypeDescription
countinteger
session_namestring

ssh_list_cron

List cron jobs for the current or specified user. Args: user: Username (empty = current user) session_name: SSH session to use

ParameterTypeDescription
session_namestring
userstring

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

ParameterTypeDescription
command *string
schedule *string
session_namestring

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

ParameterTypeDescription
pattern *string
session_namestring

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'

ParameterTypeDescription
source *string
destinationstring
formatstring
session_namestring

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

ParameterTypeDescription
archive *string
destinationstring
session_namestring

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

ParameterTypeDescription
service *string
session_namestring

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

ParameterTypeDescription
action *string
service *string
session_namestring

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)

ParameterTypeDescription
countinteger
session_namestring