update_ssh_connection
Update an existing SSH connection on the Windows CLI MCP Server by modifying details such as host, port, username, password, or private key path for secure command-line access.
Instructions
Update an existing SSH connection
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connectionConfig | No | ||
| connectionId | No | ID of the SSH connection to update |
Implementation Reference
- src/index.ts:840-853 (handler)MCP tool handler for 'update_ssh_connection'. Parses arguments using Zod schema matching the tool's inputSchema and delegates to the updateSSHConnection helper function from sshManager.case 'update_ssh_connection': { const args = z.object({ connectionId: z.string(), connectionConfig: z.object({ host: z.string(), port: z.number(), username: z.string(), password: z.string().optional(), privateKeyPath: z.string().optional(), }) }).parse(request.params.arguments); updateSSHConnection(args.connectionId, args.connectionConfig); return { content: [{ type: 'text', text: 'SSH connection updated successfully.' }] }; }
- src/index.ts:471-508 (schema)Input schema definition for the 'update_ssh_connection' tool, registered in the ListTools response.{ name: "update_ssh_connection", description: "Update an existing SSH connection", inputSchema: { type: "object", properties: { connectionId: { type: "string", description: "ID of the SSH connection to update" }, connectionConfig: { type: "object", properties: { host: { type: "string", description: "Host of the SSH connection" }, port: { type: "number", description: "Port of the SSH connection" }, username: { type: "string", description: "Username for the SSH connection" }, password: { type: "string", description: "Password for the SSH connection" }, privateKeyPath: { type: "string", description: "Path to the private key for the SSH connection" } }, required: ["connectionId", "connectionConfig"] } } }
- src/utils/sshManager.ts:71-77 (helper)Core helper function that implements the SSH connection update logic by modifying the loaded configuration and saving it back to the config file.const updateSSHConnection = (connectionId: string, connectionConfig: any): void => { const config = loadConfig(); if (config.ssh.connections[connectionId]) { config.ssh.connections[connectionId] = connectionConfig; saveConfig(config); } };
- src/utils/sshManager.ts:89-89 (registration)Export of the updateSSHConnection helper function, making it available for import in src/index.ts.export { createSSHConnection, readSSHConnections, updateSSHConnection, deleteSSHConnection };
- src/index.ts:26-26 (registration)Import of the updateSSHConnection helper function into the main index file where MCP handlers are defined.import { createSSHConnection, readSSHConnections, updateSSHConnection, deleteSSHConnection } from './utils/sshManager.js';