Skip to main content
Glama
kunwarmahen

SSH Read-Only MCP Server

by kunwarmahen

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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • 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)
  • The @mcp.tool() decorator registers this function as an MCP tool.
    @mcp.tool()
  • 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'
    }
  • 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)
  • The @mcp.tool() decorator registers this function in the multicast variant.
    @mcp.tool()
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must disclose behavioral traits. It only mentions 'read-only,' implying non-destructiveness, but lacks details like whether a connection is required or if results are cached.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is short with two sentences, but the second sentence ('Returns: List of allowed commands') is redundant. The key information is front-loaded in the first sentence.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no parameters and an output schema, the description is fairly complete. However, it lacks context about prerequisites (e.g., whether an SSH session must exist) and does not describe the output format beyond 'list.'

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero parameters, so no explanation is needed. The description adds value by specifying the return type ('list of allowed commands'), which is clear and sufficient.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'list of allowed read-only commands,' which distinguishes it from sibling tools like ssh_connect, ssh_execute, etc.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives (e.g., before executing commands to check allowed commands). The description only states what it does, not when it's appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/kunwarmahen/ssh-mcp-server'

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