create_ssh_key_pair
Generate or upload an SSH key pair on the CloudStack MCP Server to securely access and manage virtual machines and cloud resources.
Instructions
Create a new SSH key pair
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Key pair name | |
| publickey | No | Public key string (optional - generates if not provided) |
Implementation Reference
- src/handlers/security-handlers.ts:31-42 (handler)The main handler function that executes the create_ssh_key_pair tool. It calls the CloudStack client to create the key pair and formats the response with fingerprint and private key.async handleCreateSSHKeyPair(args: any) { const result = await this.cloudStackClient.createSSHKeyPair({ name: args.name }); return { content: [ { type: 'text', text: `Created SSH key pair: ${args.name}\nFingerprint: ${result.createsshkeypairresponse?.fingerprint}\nPrivate Key:\n${result.createsshkeypairresponse?.privatekey}` } ] }; }
- The tool schema definition including input schema for name (required) and optional publickey.{ name: 'create_ssh_key_pair', description: 'Create a new SSH key pair', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Key pair name', }, publickey: { type: 'string', description: 'Public key string (optional - generates if not provided)', }, }, required: ['name'], additionalProperties: false, }, },
- src/server.ts:202-203 (registration)MCP server registration: dispatches the tool call to the security handler.case 'create_ssh_key_pair': return await this.securityHandlers.handleCreateSSHKeyPair(args);
- src/cloudstack-client.ts:277-279 (helper)CloudStack client helper method that makes the API request to createSSHKeyPair.async createSSHKeyPair(params: CloudStackParams): Promise<CloudStackResponse> { return this.request('createSSHKeyPair', params); }