Skip to main content
Glama
widjis
by widjis

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
NameRequiredDescriptionDefault
credentialIdYesCredential ID to delete

Implementation Reference

  • 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`,
          },
        ],
      };
    }
  • 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);

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

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