Skip to main content
Glama

ssh_list_credentials

Retrieve all stored SSH credentials from the SSH MCP Server to manage authentication details for remote server connections.

Instructions

List all saved SSH credentials

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for 'ssh_list_credentials' tool. It parses empty args, iterates over the credentialStore Map, creates a sanitized list of credentials (hiding passwords/private keys), formats as text response listing credential IDs, hosts, users, auth type, and last used time.
    private async handleListCredentials(args: unknown) { ListCredentialsSchema.parse(args); const credentials = Array.from(credentialStore.entries()).map(([id, cred]) => ({ credentialId: id, host: cred.host, port: cred.port, username: cred.username, hasPassword: !!cred.password, hasPrivateKey: !!cred.privateKeyPath, createdAt: cred.createdAt, lastUsed: cred.lastUsed })); return { content: [ { type: 'text', text: credentials.length > 0 ? `Saved credentials:\n${credentials.map(c => `- ${c.credentialId}: ${c.username}@${c.host}:${c.port} (${c.hasPassword ? 'password' : 'key'}) - Last used: ${c.lastUsed}` ).join('\n')}` : 'No saved credentials found', }, ], }; }
  • src/index.ts:388-396 (registration)
    Registration of the 'ssh_list_credentials' tool in the ListToolsRequest handler response. Defines the tool name, description, and empty input schema.
    { name: 'ssh_list_credentials', description: 'List all saved SSH credentials', inputSchema: { type: 'object', properties: {}, required: [] }, },
  • src/index.ts:507-508 (registration)
    Registration of the handler in the CallToolRequest switch statement.
    case 'ssh_list_credentials': return await this.handleListCredentials(args);
  • Zod schema for input validation of ssh_list_credentials tool (empty object as no parameters required).
    const ListCredentialsSchema = z.object({});
  • In-memory Map storing SSH credentials used by the list_credentials handler.
    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/widjis/mcp-ssh'

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