aws_whoami
Identify the AWS identity and account context currently in use to verify permissions and ensure proper access control for security audits.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| auth | No |
Implementation Reference
- src/aws_mcp_audit/server.py:43-53 (handler)Handler function for the 'aws_whoami' tool, decorated with @mcp.tool for registration. Retrieves AWS account, ARN, and user ID using STS GetCallerIdentity.@mcp.tool def aws_whoami(auth: Optional[Dict[str, Any]] = None) -> Dict[str, Any]: session = build_boto3_session(auth) sts = session.client("sts", region_name=session.region_name or "us-east-1") ident = sts.get_caller_identity() return { "account": ident.get("Account"), "arn": ident.get("Arn"), "user_id": ident.get("UserId"), }
- src/aws_mcp_audit/server.py:43-43 (registration)Registration of the 'aws_whoami' tool using FastMCP's @mcp.tool decorator.@mcp.tool