delete_ssh_connection
Remove an SSH connection from the Windows CLI MCP Server by specifying its connection ID to manage secure remote access configurations.
Instructions
Delete an existing SSH connection
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connectionId | Yes | ID of the SSH connection to delete |
Implementation Reference
- src/utils/sshManager.ts:79-87 (handler)The deleteSSHConnection function implements the core logic to delete an SSH connection by ID from the configuration file by loading the config, removing the entry, and saving it back.
/** * Delete an SSH connection. * @param connectionId The ID of the connection to delete. */ const deleteSSHConnection = (connectionId: string): void => { const config = loadConfig(); delete config.ssh.connections[connectionId]; saveConfig(config); }; - src/index.ts:510-523 (schema)The input schema for the delete_ssh_connection tool, defining the required 'connectionId' string parameter.
{ name: "delete_ssh_connection", description: "Delete an existing SSH connection", inputSchema: { type: "object", properties: { connectionId: { type: "string", description: "ID of the SSH connection to delete" } }, required: ["connectionId"] } }, - src/index.ts:855-861 (registration)Registration and dispatch logic in the CallToolRequest handler's switch statement, which validates arguments and calls the deleteSSHConnection handler.
case 'delete_ssh_connection': { const args = z.object({ connectionId: z.string(), }).parse(request.params.arguments); deleteSSHConnection(args.connectionId); return { content: [{ type: 'text', text: 'SSH connection deleted successfully.' }] }; } - src/index.ts:26-26 (registration)Import statement that brings the deleteSSHConnection handler into the main index module for use in tool dispatching.
import { createSSHConnection, readSSHConnections, updateSSHConnection, deleteSSHConnection } from './utils/sshManager.js'; - src/utils/sshManager.ts:89-89 (helper)Export statement making deleteSSHConnection available for import by other modules.
export { createSSHConnection, readSSHConnections, updateSSHConnection, deleteSSHConnection };