Skip to main content
Glama
GUEPARD98

SSH-PowerShell MCP Server

by GUEPARD98

ssh_scan

Scan a network to discover available SSH hosts for secure remote administration and system management tasks.

Instructions

Escanear red para encontrar hosts SSH disponibles

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkYesRed a escanear (ej: 192.168.1.0/24)

Implementation Reference

  • Handler implementation for the ssh_scan tool. Scans target network/host for open SSH port 22 using nmap (if available) or PowerShell Test-NetConnection fallback. Returns scan results.
    case 'ssh_scan':
      log('info', `🔍 Escaneando red: ${args.target}`);
      
      // Validar formato de red/host
      if (!args.target || !/^[\d\w\.\-\/]+$/.test(args.target)) {
        throw new Error('Formato de target inválido. Use formato IP (192.168.1.1) o CIDR (192.168.1.0/24)');
      }
      
      // Usar nmap si está disponible, sino usar ping básico
      let scanCommand;
      try {
        // Verificar si nmap está disponible
        await executePowerShell('nmap --version', 5000);
        scanCommand = `nmap -p 22 --open ${args.target}`;
      } catch (e) {
        // Fallback a escaneo básico con ping
        log('warn', 'nmap no disponible, usando escaneo básico');
        if (args.target.includes('/')) {
          throw new Error('Escaneo de rango CIDR requiere nmap. Instale nmap o especifique un host individual.');
        }
        scanCommand = `Test-NetConnection -ComputerName ${args.target} -Port 22 -WarningAction SilentlyContinue | Select-Object ComputerName, TcpTestSucceeded, RemotePort`;
      }
      
      const scanResult = await executePowerShell(scanCommand, args.timeout);
      
      return {
        content: [
          {
            type: 'text',
            text: `🔍 Escaneo SSH de ${args.target}:\n\n${scanResult.output}`
          }
        ],
        isError: false,
        metadata: {
          tool: 'ssh_scan',
          target: args.target,
          exitCode: scanResult.exitCode,
          executionTime: scanResult.executionTime,
          rateLimitInfo: {
            remainingRequests: rateLimiter.getRemainingRequests()
          },
          timestamp: new Date().toISOString()
        }
      };
  • src/index.js:450-467 (registration)
    Registration of the ssh_scan tool in the ListToolsRequestSchema handler, defining its name, description, and input schema.
    {
      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']
      }
    },
  • Input schema definition for ssh_scan tool.
    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']
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool scans for available SSH hosts but doesn't mention critical behaviors like whether it's read-only (likely, but not confirmed), network impact (e.g., bandwidth usage or potential intrusion detection triggers), output format, or error handling. This leaves significant gaps for an agent to understand operational implications.

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's appropriately sized and front-loaded, making it easy for an agent 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 a network scanning tool with no annotations and no output schema, the description is insufficient. It lacks details on what 'available SSH hosts' means (e.g., open port 22, SSH service responding), how results are returned, potential side effects, or security considerations. This leaves the agent with incomplete context for safe and effective 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?

The input schema has 100% description coverage, with the 'network' parameter clearly documented in the schema itself. The description doesn't add any meaningful parameter semantics beyond what the schema provides (e.g., no examples of valid networks beyond the schema's example, no clarification on format requirements). This meets the baseline for high schema coverage.

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 action ('escanear' meaning 'scan') and target ('red para encontrar hosts SSH disponibles' meaning 'network to find available SSH hosts'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'ssh_keyscan' or 'ssh_execute', which prevents a perfect score.

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_keyscan' (which might scan for SSH keys) or 'ssh_execute' (which executes commands via SSH). There's no mention of prerequisites, limitations, or typical use cases beyond the basic purpose.

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