ssh_get_allowed_commands
Retrieve the list of read-only commands permitted for execution on the SSH server, ensuring secure and auditable remote access.
Instructions
Get the list of allowed read-only commands.
Returns: List of allowed commands
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- ssh_readonly_fastmcp.py:200-209 (handler)The tool handler function 'ssh_get_allowed_commands' decorated with @mcp.tool(). Returns a sorted list of allowed read-only commands.
@mcp.tool() def ssh_get_allowed_commands() -> str: """ Get the list of allowed read-only commands. Returns: List of allowed commands """ sorted_commands = sorted(ALLOWED_COMMANDS) return "Allowed Read-Only Commands:\n" + ", ".join(sorted_commands) - ssh_readonly_fastmcp.py:200-200 (registration)The @mcp.tool() decorator registers this function as an MCP tool.
@mcp.tool() - ssh_readonly_fastmcp.py:16-24 (helper)The ALLOWED_COMMANDS set containing all permitted read-only commands (the data source for the tool).
ALLOWED_COMMANDS = { 'cat', 'ls', 'pwd', 'whoami', 'id', 'date', 'uptime', 'ps', 'top', 'df', 'du', 'free', 'netstat', 'ss', 'ifconfig', 'ip', 'hostname', 'uname', 'lsb_release', 'file', 'head', 'tail', 'wc', 'grep', 'find', 'locate', 'which', 'whereis', 'stat', 'lsof', 'mount', 'dmidecode', 'lscpu', 'lsblk', 'fdisk', 'blkid', 'journalctl', 'systemctl', 'service', 'curl', 'wget', 'dig', 'nslookup', 'ping', 'traceroute', 'mtr', 'iptables', 'firewall-cmd', 'ufw', 'awk', 'sed' } - ssh_readonly_fastmcp_mcast.py:314-323 (handler)Duplicate of ssh_get_allowed_commands in the multicast discovery variant of the server.
@mcp.tool() def ssh_get_allowed_commands() -> str: """ Get the list of allowed read-only commands. Returns: List of allowed commands """ sorted_commands = sorted(ALLOWED_COMMANDS) return "Allowed Read-Only Commands:\n" + ", ".join(sorted_commands) - ssh_readonly_fastmcp_mcast.py:314-314 (registration)The @mcp.tool() decorator registers this function in the multicast variant.
@mcp.tool()