Skip to main content
Glama

ssh_delete_credential

Remove a saved SSH credential from the MCP SSH Server's credential store to manage authentication profiles and maintain security.

Instructions

Delete a saved SSH credential

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
credentialIdYesCredential ID to delete

Implementation Reference

  • Handler function that validates input using DeleteCredentialSchema, checks if the credential exists in the in-memory store, deletes it, and returns a 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`, }, ], }; }
  • Zod schema defining the input parameter 'credentialId' for the ssh_delete_credential tool.
    const DeleteCredentialSchema = z.object({ credentialId: z.string().describe('Credential ID to delete') });
  • src/index.ts:398-407 (registration)
    Tool registration in the ListTools response, providing 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 handleDeleteCredential method.
    case 'ssh_delete_credential': return await this.handleDeleteCredential(args);
  • In-memory Map storing SSH credentials, used by the delete handler to remove entries.
    const credentialStore = new Map<string, StoredCredential>();

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/mahathirmuh/mcp-ssh-server'

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