ssh_delete_credential
Remove a saved SSH credential from the SSH MCP Server to manage authentication data and maintain security by deleting unused or outdated credentials.
Instructions
Delete a saved SSH credential
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| credentialId | Yes | Credential ID to delete |
Implementation Reference
- src/index.ts:1155-1176 (handler)Handler function that parses input, checks if credential exists, deletes it from the in-memory store, and returns success message.private async handleDeleteCredential(args: unknown) { const params = DeleteCredentialSchema.parse(args); if (!credentialStore.has(params.credentialId)) { throw new McpError( ErrorCode.InvalidParams, `Credential ID '${params.credentialId}' not found` ); } const credential = credentialStore.get(params.credentialId)!; credentialStore.delete(params.credentialId); return { content: [ { type: 'text', text: `Credential '${params.credentialId}' (${credential.username}@${credential.host}) deleted successfully`, }, ], }; }
- src/index.ts:139-141 (schema)Zod schema defining the input parameters for the ssh_delete_credential tool: credentialId (string).const DeleteCredentialSchema = z.object({ credentialId: z.string().describe('Credential ID to delete') });
- src/index.ts:398-407 (registration)Tool registration entry in the ListTools handler, defining name, description, and input schema.name: 'ssh_delete_credential', description: 'Delete a saved SSH credential', inputSchema: { type: 'object', properties: { credentialId: { type: 'string', description: 'Credential ID to delete' } }, required: ['credentialId'] }, },
- src/index.ts:509-510 (registration)Dispatch case in the CallToolRequestHandler switch statement that routes to the handler.case 'ssh_delete_credential': return await this.handleDeleteCredential(args);