create_ssh_connection
Establish SSH connections to remote systems using host, port, credentials, or private keys for secure command-line access through the Windows CLI MCP Server.
Instructions
Create a new SSH connection
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connectionId | No | ID of the SSH connection | |
| connectionConfig | No |
Implementation Reference
- src/utils/sshManager.ts:51-55 (handler)The core handler function that executes the tool logic: loads the config, adds the new SSH connection, and saves the updated config.const createSSHConnection = (connectionId: string, connectionConfig: any): void => { const config = loadConfig(); config.ssh.connections[connectionId] = connectionConfig; saveConfig(config); };
- src/index.ts:424-462 (schema)MCP tool schema definition including name, description, and input schema for validation in ListTools response.{ name: "create_ssh_connection", description: "Create a new SSH connection", inputSchema: { type: "object", properties: { connectionId: { type: "string", description: "ID of the SSH connection" }, 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/index.ts:820-833 (registration)Tool registration and dispatch in the CallToolRequest handler: parses arguments with Zod schema and invokes the handler function.case 'create_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); createSSHConnection(args.connectionId, args.connectionConfig); return { content: [{ type: 'text', text: 'SSH connection created successfully.' }] }; }
- src/index.ts:26-26 (registration)Import statement that brings the handler function into the main index file for use in tool dispatch.import { createSSHConnection, readSSHConnections, updateSSHConnection, deleteSSHConnection } from './utils/sshManager.js';
- src/utils/sshManager.ts:89-89 (registration)Export statement making the handler function available for import.export { createSSHConnection, readSSHConnections, updateSSHConnection, deleteSSHConnection };