AWS SSO profile switcher and MCP server for AWS authentication and profile management
awsp provides 4 well-named AWS authentication tools with comprehensive descriptions (avg 280 chars, well above baseline 194). All tools have explicit input schemas with type definitions. Tool annotations (readOnlyHint, destructiveHint) are present. However, output schemas are not documented in the visible code, and error handling guidance is minimal. The login tool is particularly complex with multiple flows (PKCE, device-code) but lacks explicit error recovery patterns. Descriptions are LLM-optimized and include dependency hints (e.g., 'call login first if auth fails'), which is excellent. Parameter descriptions are detailed and include constraints.
Report whether the AWS SSO sessions found in the AWS config are currently valid. Reads only the local SSO token cache; makes no network calls. Use this at the start of a task to check whether login is needed before touching AWS. AWS profiles are switched by the human's own shell; this MCP server cannot change the human's environment. Agents should pass `--profile <name>` on aws commands using names from list_profiles. Never returns SSO token or credential values.
List the AWS profiles found in the AWS config, along with the SSO session state and role credential cache timestamps for each. Reads only local files; makes no network calls. currentProfile, when present, is the profile the human has selected in their shell (AWS_PROFILE); prefer it when the task does not say which profile to use. It may name a profile that is not in this config if the human and the agent read different config files. AWS profiles are switched by the human's own shell; this MCP server cannot change the human's environment. Agents should pass `--profile <name>` on aws commands using names from list_profiles. Never returns SSO token or credential values.
Establish an AWS SSO session for a profile or sso-session, blocking until the human approves or timeout_seconds elapses. By default uses the Authorization Code + PKCE flow, which opens a browser on this same machine and completes automatically once approved there; the browser must be reachable from here. Set use_device_code=true to use the OIDC device-authorization flow instead, which lets the human approve from any device by opening a URL and entering a code (useful for remote/headless environments), but device-code grants may be disabled by the organization's Identity Center. If the cached token is unexpired, verifies the caller identity when a profile is given; reauthenticates on an invalid or expired token, but returns network or permission errors without reopening a browser. If the browser cannot be opened automatically, returns status=pending immediately with authorizationUrl (and userCode for device_code) for the human to open manually; call login again with the same target to join that same in-progress flow and keep waiting. Timeout includes startup. If no authorization URL is available yet, returns status=pending with phase=starting; call login again to check progress. The startup APIs have a 30-second deadline. Calling login again for a target that is already being logged in joins the same flow instead of starting a duplicate one. AWS profiles are switched by the human's own shell; this MCP server cannot change the human's environment. Agents should pass `--profile <name>` on aws commands using names from list_profiles. Never returns SSO token or credential values.
Output schemas not documented. Tools return structured data but LLMs cannot see what fields to expect (e.g., what does list_profiles return? Is it {profiles: [...], currentProfile: string}?). This forces LLMs to guess field names for downstream operations.
login tool combines multiple flows (PKCE, device-code, browser-based, headless) in one tool. While descriptions explain each mode, error handling for flow-specific failures (e.g., 'browser cannot open', 'device-code disabled by org') lacks recovery guidance. LLMs cannot determine whether to retry, switch flows, or escalate.
No pagination support documented. list_profiles likely returns all profiles at once. If an AWS config has hundreds of profiles, response could be very large. No limit, offset, or cursor parameters visible.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 65 | 2025-06-18+ | v2 |
Get the AWS STS caller identity (account, ARN) for a given profile by calling sts:GetCallerIdentity. Does not attempt to log in automatically; if it fails with an auth error, call login for that profile first. AWS profiles are switched by the human's own shell; this MCP server cannot change the human's environment. Agents should pass `--profile <name>` on aws commands using names from list_profiles. Never returns SSO token or credential values.
login parameter 'timeout_seconds' lacks explicit bounds. Description says 'Timeout includes startup' but does not specify min/max values. LLMs could pass 0, negative, or absurdly large values.
Error responses not visible in source. Code shows tool registration but not error handling paths. Cannot verify whether errors include recovery guidance (e.g., 'Token expired. Call login() to reauthenticate') or just return raw AWS SDK errors.