list-credentials
Retrieve and display all configured AWS credentials, configurations, and profiles available on your machine for managing resources through the aws-mcp server.
Instructions
List all AWS credentials/configs/profiles that are configured/usable on this machine
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"required": [],
"type": "object"
}
Implementation Reference
- index.ts:81-90 (registration)Registration of the 'list-credentials' tool in the ListTools response, including its input schema definition.{ name: "list-credentials", description: "List all AWS credentials/configs/profiles that are configured/usable on this machine", inputSchema: { type: "object", properties: {}, required: [], }, },
- index.ts:166-169 (handler)Dispatch handler for the 'list-credentials' tool call, which returns the profiles from listCredentials() as JSON.} else if (name === "list-credentials") { return createTextResponse( JSON.stringify({ profiles: Object.keys(profiles), error }) );
- index.ts:220-238 (helper)Helper function that loads AWS credentials and config INI files, merges them into profiles object, and returns with any error.async function listCredentials() { let credentials: any; let configs: any; let error: any; try { credentials = new AWS.IniLoader().loadFrom({}); } catch (error) { error = `Failed to load credentials: ${error}`; } try { configs = new AWS.IniLoader().loadFrom({ isConfig: true }); } catch (error) { error = `Failed to load configs: ${error}`; } const profiles = { ...(credentials || {}), ...(configs || {}) }; return { profiles, error }; }