Skip to main content
Glama
Faucet94

Super Windows CLI MCP Server

by Faucet94

ssh_disconnect

Cleanly terminate SSH connections with a specified ID when they are no longer needed. Ensures proper closure of remote sessions to maintain system efficiency and security.

Instructions

Disconnect from an SSH server

Example usage:

{
  "connectionId": "raspberry-pi"
}

Use this to cleanly close SSH connections when they're no longer needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionIdYesID of the SSH connection to disconnect

Implementation Reference

  • Executes the ssh_disconnect tool: validates input, checks SSH configuration, closes the specified SSH connection using the connection pool, and returns a confirmation message.
    case "ssh_disconnect": {
      if (!this.config.ssh.enabled) {
        throw new McpError(
          ErrorCode.InvalidRequest,
          "SSH support is disabled in configuration"
        );
      }
    
      const args = z.object({
        connectionId: z.string()
      }).parse(request.params.arguments);
    
      await this.sshPool.closeConnection(args.connectionId);
      return {
        content: [{
          type: "text",
          text: `Disconnected from ${args.connectionId}`
        }]
      };
    }
  • Defines the input schema, name, and description for the ssh_disconnect tool, registered in the listTools response.
            {
              name: "ssh_disconnect",
              description: `Disconnect from an SSH server
    
    Example usage:
    \`\`\`json
    {
      "connectionId": "raspberry-pi"
    }
    \`\`\`
    
    Use this to cleanly close SSH connections when they're no longer needed.`,
              inputSchema: {
                type: "object",
                properties: {
                  connectionId: {
                    type: "string",
                    description: "ID of the SSH connection to disconnect",
                    enum: Object.keys(this.config.ssh.connections)
                  }
                },
                required: ["connectionId"]
              }
            }
  • src/index.ts:123-277 (registration)
    Registers the ssh_disconnect tool in the list of available tools returned by listTools handler.
          tools: [
            {
              name: "execute_command",
              description: `Execute a command in the specified shell (powershell, cmd, or gitbash)
    
    Example usage (PowerShell):
    \`\`\`json
    {
      "shell": "powershell",
      "command": "Get-Process | Select-Object -First 5",
      "workingDir": "C:\\Users\\username"
    }
    \`\`\`
    
    Example usage (CMD):
    \`\`\`json
    {
      "shell": "cmd",
      "command": "dir /b",
      "workingDir": "C:\\Projects"
    }
    \`\`\`
    
    Example usage (Git Bash):
    \`\`\`json
    {
      "shell": "gitbash",
      "command": "ls -la",
      "workingDir": "/c/Users/username"
    }
    \`\`\``,
              inputSchema: {
                type: "object",
                properties: {
                  shell: {
                    type: "string",
                    enum: Object.keys(this.config.shells).filter(shell => 
                      this.config.shells[shell as keyof typeof this.config.shells].enabled
                    ),
                    description: "Shell to use for command execution"
                  },
                  command: {
                    type: "string",
                    description: "Command to execute"
                  },
                  workingDir: {
                    type: "string",
                    description: "Working directory for command execution (optional)"
                  }
                },
                required: ["shell", "command"]
              }
            },
            {
              name: "get_command_history",
              description: `Get the history of executed commands
    
    Example usage:
    \`\`\`json
    {
      "limit": 5
    }
    \`\`\`
    
    Example response:
    \`\`\`json
    [
      {
        "command": "Get-Process",
        "output": "...",
        "timestamp": "2024-03-20T10:30:00Z",
        "exitCode": 0
      }
    ]
    \`\`\``,
              inputSchema: {
                type: "object",
                properties: {
                  limit: {
                    type: "number",
                    description: `Maximum number of history entries to return (default: 10, max: ${this.config.security.maxHistorySize})`
                  }
                }
              }
            },
            {
              name: "ssh_execute",
              description: `Execute a command on a remote host via SSH
    
    Example usage:
    \`\`\`json
    {
      "connectionId": "raspberry-pi",
      "command": "uname -a"
    }
    \`\`\`
    
    Configuration required in config.json:
    \`\`\`json
    {
      "ssh": {
        "enabled": true,
        "connections": {
          "raspberry-pi": {
            "host": "raspberrypi.local",
            "port": 22,
            "username": "pi",
            "password": "raspberry"
          }
        }
      }
    }
    \`\`\``,
              inputSchema: {
                type: "object",
                properties: {
                  connectionId: {
                    type: "string",
                    description: "ID of the SSH connection to use",
                    enum: Object.keys(this.config.ssh.connections)
                  },
                  command: {
                    type: "string",
                    description: "Command to execute"
                  }
                },
                required: ["connectionId", "command"]
              }
            },
            {
              name: "ssh_disconnect",
              description: `Disconnect from an SSH server
    
    Example usage:
    \`\`\`json
    {
      "connectionId": "raspberry-pi"
    }
    \`\`\`
    
    Use this to cleanly close SSH connections when they're no longer needed.`,
              inputSchema: {
                type: "object",
                properties: {
                  connectionId: {
                    type: "string",
                    description: "ID of the SSH connection to disconnect",
                    enum: Object.keys(this.config.ssh.connections)
                  }
                },
                required: ["connectionId"]
              }
            }
          ]
        }));
  • SSHConnectionPool.closeConnection method: retrieves the connection by ID, calls disconnect on it, and removes it from the pool.
    async closeConnection(connectionId: string): Promise<void> {
      const connection = this.connections.get(connectionId);
      if (connection) {
        connection.disconnect();
        this.connections.delete(connectionId);
      }
    }
  • SSHConnection.disconnect method: clears reconnect timer and ends the underlying SSH client connection.
    disconnect(): void {
      if (this.reconnectTimer) {
        clearTimeout(this.reconnectTimer);
        this.reconnectTimer = null;
      }
      
      if (this.isConnected) {
        this.client.end();
        this.isConnected = false;
      }
    }
Behavior3/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 mentions 'cleanly close SSH connections', which implies a graceful termination rather than abrupt disconnection, adding useful context. However, it doesn't cover important behavioral aspects like whether this requires specific permissions, what happens to ongoing operations, or error handling for invalid connection IDs.

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 extremely concise and well-structured. It starts with the core purpose, provides a clear usage example, and ends with practical guidance. Every sentence earns its place, with no wasted words or redundant information.

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 simple disconnect tool with one parameter and no output schema, the description is reasonably complete. It covers the basic purpose, usage context, and provides an example. However, given the lack of annotations and output schema, it could benefit from more behavioral details about what 'cleanly close' entails or what happens after disconnection.

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 schema description coverage is 100%, with the parameter 'connectionId' fully documented in the schema as 'ID of the SSH connection to disconnect'. The description doesn't add any additional parameter information beyond what's in the schema, but since schema coverage is complete, the baseline score of 3 is appropriate.

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 ('Disconnect from') and target ('SSH server'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'ssh_execute', but the verb 'disconnect' is specific enough to distinguish it from execution or query tools.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool: 'when they're no longer needed' and 'to cleanly close SSH connections'. This gives practical guidance on timing and purpose. However, it doesn't explicitly mention alternatives or when NOT to use it, such as distinguishing it from simply letting connections time out.

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

Related 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/Faucet94/super-win-cli-mcp-server'

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