Skip to main content
Glama

ssh_list_credentials

Retrieve all stored SSH credentials from the MCP SSH 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 main handler function for the 'ssh_list_credentials' tool. It parses empty args with ListCredentialsSchema, retrieves all credentials from the in-memory credentialStore Map, maps them to a safe summary (hiding passwords/keys), and returns a formatted text list of available credentials or 'No saved credentials found'.
    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', }, ], }; }
  • Zod schema for validating input parameters of the 'ssh_list_credentials' tool, which takes no parameters (empty object). Used in the handler for parsing.
    const ListCredentialsSchema = z.object({});
  • src/index.ts:389-396 (registration)
    Tool registration in the ListTools response. Defines the tool name, description, and empty input schema advertised to MCP clients.
    name: 'ssh_list_credentials', description: 'List all saved SSH credentials', inputSchema: { type: 'object', properties: {}, required: [] }, },
  • src/index.ts:507-508 (registration)
    Dispatch case in the CallToolRequest handler switch statement that routes calls to the specific handler function.
    case 'ssh_list_credentials': return await this.handleListCredentials(args);
  • In-memory Map storing SSH credentials used by the handler (and related tools like save/delete/connect).
    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