Skip to main content
Glama

⚡ AWS-Auth

快速、智能的 AWS SSO 认证与模型上下文协议(MCP)服务器

CI Release License: MIT Python Version MCP Ready

告别 AWS SSO 登录疲劳。 零配置样板、智能角色优先级排序、原子化凭据缓存,以及原生 AI 结对编程集成。

快速开始为什么选择 aws-auth?AI / MCP 集成功能特性文档


  ┌───────────────────────┐       ┌────────────────────────┐       ┌───────────────────────┐
  │  IAM Identity Center  │ ────> │       aws-auth         │ ────> │  ~/.aws/credentials   │
  │     (AWS SSO OIDC)    │       │  (Smart Role Selector) │       │ (Strict 0600 POSIX)   │
  └───────────────────────┘       └───────────┬────────────┘       └───────────┬───────────┘
                                              │                                │
                                  ┌───────────▼────────────┐       ┌───────────▼───────────┐
                                  │   MCP Server (stdio)   │       │ Terraform / K8s / CLI │
                                  │ (Claude / Cursor / AI) │       │ (Instant Compatibility)│
                                  └────────────────────────┘       └───────────────────────┘

💡 为什么选择 aws-auth 而非其他替代方案?

功能

aws-auth

官方 aws sso login

granted / assume

aws-vault

零配置账户发现

自动

❌ 需要手动配置 ~/.aws/config

⚠️ 部分

❌ 手动

模型上下文协议(MCP)

原生内置

❌ 无

❌ 无

❌ 无

1 秒 MRU / 固定登录

智能优先级

❌ 无

⚠️ 历史提示

❌ 无

实时子串与别名过滤

即时输入

❌ 无

✅ 是

❌ 无

直接同步 ~/.aws/credentials

原子化且 0600

❌ 仅令牌缓存

⚠️ Shell 包装器

⚠️ 钥匙串包装器

旧版与 GUI 工具兼容性

100% 开箱即用

⚠️ 许多工具会失败

⚠️ 需要包装器

⚠️ 需要包装器

WSL2 -> Windows 浏览器桥接

自动

❌ 失败 / 手动复制

⚠️ 部分

❌ 否

EC2 SSM 与 EKS 上下文切换

内置

❌ 独立工具

❌ 独立工具

❌ 否

👉 阅读完整的功能对比指南


✨ 核心功能

  • 零样板发现:无需在 ~/.aws/config 中维护数百行配置。只需输入一次 SSO Start URL,所有已授权的账户和角色即可动态加载。

  • 智能角色优先级排序(MRU):自动将最近使用的角色(例如 QA AdminProd Admin)固定到 #1#2。按下 Enter 即可在 1 秒 内完成登录。

  • 🔍 交互式子串搜索:在选择提示符下输入任意关键字(prodqaadmingpueks),即可即时筛选数十个账户。

  • 🤖 原生模型上下文协议(MCP)服务器:向 LLM 结对编程工具(Claude Desktop、Cursor、Antigravity、Gemini)开放 AWS 配置文件切换、调用者身份以及 EC2/EKS 探索功能。

  • 🔒 企业级安全:严格的 POSIX 0600 文件权限、原子化文件替换(os.replace)以及 300 秒过期安全余量。

  • 🌐 WSL2 无缝浏览器桥接:自动检测 WSL2 并直接在 Windows 主机浏览器中打开授权 URL。

  • ☸️ DevOps 加速:即时 EC2 SSM Shell 会话和一键式 Amazon EKS kubeconfig 上下文切换。


📦 安装

选项 1:独立二进制文件(推荐)

GitHub Releases 下载最新的预编译二进制文件:

Windows(PowerShell 单行命令)

在 PowerShell 中运行以自动下载二进制文件并配置 PATH:

irm https://raw.githubusercontent.com/N0mansky/aws-auth/main/install.ps1 | iex

或通过 PowerShell 手动下载:

curl.exe -L https://github.com/N0mansky/aws-auth/releases/latest/download/aws-auth-windows-amd64.exe -o aws-auth.exe

Linux (x86_64)

curl -L https://github.com/N0mansky/aws-auth/releases/latest/download/aws-auth-linux-amd64 -o aws-auth
chmod +x aws-auth && sudo mv aws-auth /usr/local/bin/

macOS(通用)

curl -L https://github.com/N0mansky/aws-auth/releases/latest/download/aws-auth-macos-universal -o aws-auth
chmod +x aws-auth && sudo mv aws-auth /usr/local/bin/

选项 2:通过 pip 安装

pip install git+https://github.com/N0mansky/aws-auth.git

选项 3:从源码克隆并安装

git clone https://github.com/N0mansky/aws-auth.git
cd aws-auth

./install.sh                      # Linux / macOS / WSL2
powershell .\install.ps1          # Windows (PowerShell)
.\install.bat                     # Windows (Command Prompt)

🚀 快速开始

1. 交互式登录

aws-auth
Available account-role combinations (Showing 1-10 of 18):
+-----+------------------------------+-----------------+------------------------------+-------------+
| #   | Account                      | Account ID      | Role                         | Region      |
+-----+------------------------------+-----------------+------------------------------+-------------+
| 1   | ⭐ Production-App (PROD)        | (111222333444)  | AdministratorAccess     | us-east-1   |
| 2   | ⭐ Staging-Web (QA)          | (555666777888)  | AdministratorAccess     | us-east-1   |
| 3   | Analytics-Data                  | (999888777666)  | AdministratorAccess     | us-east-1   |
...
Select number 1-10 (default: 1) (type keyword to filter): [ENTER]

✅ Profile 'production-app-admin' set as default in ~/.aws/credentials.

2. 配置门户与自定义别名

aws-auth --configure

~/.aws-auth/config.json 中自定义环境标签和首选账户:

{
  "sso_start_url": "https://my-company.awsapps.com/start",
  "sso_region": "us-east-1",
  "preferred_accounts": ["Staging-Web", "Production-App"],
  "aliases": {
    "555666777888": "QA",
    "111222333444": "PROD"
  }
}

🤖 AI 代理集成(模型上下文协议)

aws-auth 作为基于 stdio 的高性能 MCP 服务器 运行。

添加到 Claude Desktop(claude_desktop_config.json)或 Cursor:

{
  "mcpServers": {
    "aws-auth": {
      "command": "aws-auth",
      "args": ["--mcp"]
    }
  }
}

AI 助手使用 aws-auth 可以做什么:

  • 检查当前 AWS 账户、区域和 IAM 角色 ARN(aws_get_caller_identity)。

  • 无需人工干预即可切换当前 AWS 配置文件(aws_switch_profile)。

  • 检查正在运行的 EC2 实例和 Amazon EKS 集群(aws_list_ec2_instancesaws_list_eks_clusters)。

  • 更新本地 Kubernetes 上下文(aws_update_kubeconfig)。

👉 阅读完整的 MCP 设置与工具参考指南


🛠️ CLI 命令参考

# Core Authentication
aws-auth                     # Interactive SSO login & smart role switch
aws-auth --configure         # Interactive SSO portal setup
aws-auth --identity          # Show current STS caller identity
aws-auth --refresh-cache     # Force refresh remote account/role metadata

# Profile Management
aws-auth --list-profiles     # List all stored AWS profiles
aws-auth --switch-profile    # Switch active default profile
aws-auth --set-default NAME  # Set specific profile as default
aws-auth --delete NAME       # Delete profile credentials

# Resource Discovery & DevOps
aws-auth --list-ec2          # List EC2 instances and connect via SSM
aws-auth --list-eks          # List EKS clusters and update kubeconfig

# Scripting & Headless Automation
aws-auth --list-profiles --json
aws-auth --identity --json
eval $(aws-auth --export-env prod-profile)  # Export AWS keys to current shell

# AWS credential_process standard
aws-auth --credential-process my-profile

📚 文档


🤝 贡献

欢迎贡献!请查看 CONTRIBUTING.md 了解如何设置开发环境和运行测试的详细信息。


📄 许可证

本项目采用 MIT 许可证 许可。

-
license - not tested
-
quality - not tested
A
maintenance

Maintenance

Maintainers
Response time
Release cycle
1Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • Hosted Amazon Seller and Vendor MCP server for Claude, ChatGPT, Cursor, Codex, Gemini, Copilot.

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

  • Hosted Amazon Seller Central and Amazon Ads MCP server for Claude, ChatGPT, Cursor, and agents.

View all MCP Connectors

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/N0mansky/aws-auth'

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