Skip to main content
Glama
simon-ami

Windows CLI MCP Server

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
NameRequiredDescriptionDefault
connectionIdNoID of the SSH connection
connectionConfigNo

Implementation Reference

  • 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);
    };
  • 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';
  • Export statement making the handler function available for import.
    export { createSSHConnection, readSSHConnections, updateSSHConnection, deleteSSHConnection }; 

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