Skip to main content
Glama
GUEPARD98

SSH-PowerShell MCP Server

by GUEPARD98

ssh_keyscan

Retrieve SSH key fingerprints from remote hosts to verify server identity and establish secure connections for system administration tasks.

Instructions

Obtener fingerprint de claves SSH de un host

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYesHost para obtener claves SSH

Implementation Reference

  • The main handler for the 'ssh_keyscan' tool. It validates the host input, constructs the ssh-keyscan command with optional port, executes it using the shared executePowerShell function, and formats the response with output and metadata.
    case 'ssh_keyscan':
      log('info', `🔑 Obteniendo claves SSH: ${args.host}`);
      
      // Validar formato de host
      if (!args.host || !/^[\w\.\-]+$/.test(args.host)) {
        throw new Error('Formato de host inválido');
      }
      
      const port = args.port || 22;
      const keyCommand = `ssh-keyscan -p ${port} ${args.host}`;
      const keyResult = await executePowerShell(keyCommand, args.timeout);
      
      return {
        content: [
          {
            type: 'text',
            text: `🔑 Claves SSH de ${args.host}:${port}:\n\n${keyResult.output}`
          }
        ],
        isError: false,
        metadata: {
          tool: 'ssh_keyscan',
          host: args.host,
          port: port,
          exitCode: keyResult.exitCode,
          executionTime: keyResult.executionTime,
          rateLimitInfo: {
            remainingRequests: rateLimiter.getRemainingRequests()
          },
          timestamp: new Date().toISOString()
        }
      };
  • The input schema and registration details for the 'ssh_keyscan' tool, defining parameters like host (required), port (default 22), and timeout.
    {
      name: 'ssh_keyscan',
      description: 'Obtener fingerprint de claves SSH de un host',
      inputSchema: {
        type: 'object',
        properties: {
          host: {
            type: 'string',
            description: 'Host para obtener claves SSH'
          },
          port: {
            type: 'number',
            description: 'Puerto SSH (opcional, default: 22)',
            default: 22
          },
          timeout: {
            type: 'number',
            description: 'Timeout en milisegundos (opcional)'
          }
        },
        required: ['host']
      }
    }
  • src/index.js:399-493 (registration)
    The ListToolsRequestSchema handler where all tools including 'ssh_keyscan' are registered and listed.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          {
            name: 'ssh_execute',
            description: 'Ejecutar comandos en máquinas remotas vía SSH usando clave SSH',
            inputSchema: {
              type: 'object',
              properties: {
                host: {
                  type: 'string',
                  description: 'Dirección IP o hostname del servidor remoto'
                },
                user: {
                  type: 'string',
                  description: 'Nombre de usuario para SSH'
                },
                command: {
                  type: 'string',
                  description: 'Comando a ejecutar en el servidor remoto'
                },
                keyPath: {
                  type: 'string',
                  description: 'Ruta a la clave SSH privada (opcional)'
                },
                timeout: {
                  type: 'number',
                  description: 'Timeout en milisegundos (opcional)'
                }
              },
              required: ['host', 'user', 'command']
            }
          },
          {
            name: 'powershell_execute',
            description: 'Ejecutar comandos PowerShell localmente',
            inputSchema: {
              type: 'object',
              properties: {
                command: {
                  type: 'string',
                  description: 'Comando PowerShell a ejecutar'
                },
                timeout: {
                  type: 'number',
                  description: 'Timeout en milisegundos (opcional)'
                }
              },
              required: ['command']
            }
          },
          {
            name: 'ssh_scan',
            description: 'Escanear red para encontrar hosts SSH disponibles',
            inputSchema: {
              type: 'object',
              properties: {
                target: {
                  type: 'string',
                  description: 'Red a escanear (ej: 192.168.1.0/24) o host individual'
                },
                timeout: {
                  type: 'number',
                  description: 'Timeout en milisegundos (opcional)'
                }
              },
              required: ['target']
            }
          },
          {
            name: 'ssh_keyscan',
            description: 'Obtener fingerprint de claves SSH de un host',
            inputSchema: {
              type: 'object',
              properties: {
                host: {
                  type: 'string',
                  description: 'Host para obtener claves SSH'
                },
                port: {
                  type: 'number',
                  description: 'Puerto SSH (opcional, default: 22)',
                  default: 22
                },
                timeout: {
                  type: 'number',
                  description: 'Timeout en milisegundos (opcional)'
                }
              },
              required: ['host']
            }
          }
        ]
      };
    });
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('obtener fingerprint') but doesn't describe what the tool returns (e.g., format of the fingerprint), error conditions, network behavior, or security implications. This is a significant gap for a tool that interacts with SSH keys.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy to parse quickly.

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

Completeness2/5

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

Given the complexity of SSH key operations and the lack of annotations and output schema, the description is incomplete. It doesn't explain what the fingerprint output looks like, potential errors, or how it differs from sibling tools, leaving the agent with insufficient context for reliable use.

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

Parameters3/5

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

Schema description coverage is 100%, with the single parameter 'host' documented as 'Host para obtener claves SSH'. The description adds no additional meaning beyond this, such as examples or constraints, so it meets the baseline for adequate but not enhanced parameter semantics.

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

Purpose4/5

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

The description clearly states the verb ('obtener fingerprint') and resource ('claves SSH de un host'), making the purpose understandable. However, it doesn't explicitly differentiate this tool from sibling tools like 'ssh_scan' or 'ssh_execute', which might have overlapping or related functionality.

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?

The description provides no guidance on when to use this tool versus alternatives like 'ssh_scan' or 'ssh_execute'. It lacks context about prerequisites, typical use cases, or exclusions, leaving the agent to infer usage from the tool name and description alone.

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/GUEPARD98/MCP-POWERSHELL'

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