Skip to main content
Glama

create_ssh_connection

Establish a new SSH connection by configuring host, port, username, password, and private key path securely on the Windows CLI MCP Server for remote command execution.

Instructions

Create a new SSH connection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionConfigNo
connectionIdNoID of the SSH connection

Implementation Reference

  • The MCP tool handler for 'create_ssh_connection' that validates input using Zod, calls the createSSHConnection helper, and returns a success response.
    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:424-462 (registration)
    Registration of the 'create_ssh_connection' tool in the ListToolsRequestHandler response, including name, description, and input schema definition.
    { 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"] } } } },
  • Runtime input validation schema using Zod in the tool handler.
    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.' }] }; }
  • Helper function that loads the server config, adds the new SSH connection, and saves it back to the config file.
    const createSSHConnection = (connectionId: string, connectionConfig: any): void => { const config = loadConfig(); config.ssh.connections[connectionId] = connectionConfig; saveConfig(config); };

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/simon-ami/win-cli-mcp-server'

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