Purpose
mcp-server-aws-sso is an MCP (Model Context Protocol) server written in Node.js/TypeScript, used to connect AI assistants to AWS resources. Through AWS IAM Identity Center (formerly AWS SSO), it enables AI systems (LLMs) to initiate SSO login, list accounts and roles, and execute AWS CLI commands using temporary credentials, thereby simplifying interaction between AI and AWS resources.
Main capabilities
- Authentication tools: aws_sso_login initiates the AWS SSO device authorization flow (optional launchBrowser, default true, automatically opens the browser and caches the token); aws_sso_status checks the current authentication status and returns session details and expiration time.
- Account management: aws_sso_ls_accounts lists all accessible AWS accounts and roles, showing account ID, name, email, and available roles.
- Command execution: aws_sso_exec_command executes AWS CLI commands using SSO credentials (required accountId, roleName, command; optional region; automatically obtains and caches temporary credentials); aws_sso_ec2_exec_command executes shell commands on EC2 instances via SSM (required instanceId, accountId, roleName, command; optional region; no SSH required; the instance must have the SSM Agent installed).
- All tools also provide kebab-case CLI commands: login, status, ls-accounts, exec-command, ec2-exec-command; use --help to view details.
Usage
- Prepare AWS SSO: enable AWS IAM Identity Center in your AWS account, configure the identity source (AWS directory, Active Directory, or external IdP), set up permission sets and assign users to AWS accounts, and record the AWS SSO Start URL (e.g., https://your-company.awsapps.com/start)。
- Connect the AI assistant: Claude Desktop users can add the configuration in the configuration file ~/.claude/claude_desktop_config.json and restart; the status bar will show "🔗 aws-sso"; other AI assistants can globally install the server (npx -y @aashari/mcp-server-aws-sso) and configure it as an MCP server using STDIO transport. You can also create ~/.mcp/configs.json for system-level configuration; the configuration key also accepts "@aashari/mcp-server-aws-sso" or "mcp-server-aws-sso".
- Transport modes: STDIO (default for MCP clients, based on stdin/stdout subprocess communication, suitable for local AI assistant integration); HTTP (default for server mode, based on SSE, supports multiple concurrent connections, default port 3000, endpoint http://localhost:3000/mcp,健康检查 http://localhost:3000/)。
- Environment variables: TRANSPORT_MODE (stdio or http), PORT (default 3000), DEBUG (default false); AWS_SSO_START_URL, AWS_SSO_REGION or AWS_REGION, AWS_PROFILE (optional).
- Example usage: Ask the AI assistant things like "List all my AWS accounts and available roles", "List all S3 buckets in the production account", "Check the disk usage of instance i-123456789", "Switch to the staging account and describe the VPC", "Run df -h on the web server via SSM", etc.
Use cases
- DevOps engineers managing multi-account AWS environments and infrastructure automation.
- Cloud architects quickly obtaining cross-account resource information.
- Developers inspecting deployments and running AWS CLI commands through AI.
- SRE teams monitoring and troubleshooting AWS resources using natural language.
- IT administrators securely managing EC2 instances and executing remote commands.
- Anyone who wants to interact with AWS through conversational AI.
Limitations and considerations
- Only one AWS SSO Start URL is supported per installation at a time; for multiple organizations, you can switch environment variables, run multiple instances, or use multiple Claude Desktop configurations.
- SSO tokens typically last 8-12 hours (managed by AWS IAM Identity Center), temporary credentials last about 1 hour, and the tool automatically handles refresh and caching; re-authentication is required after expiration.
- aws_sso_exec_command requires AWS CLI v2 to be installed; authentication, status checks, and account listing do not require AWS CLI; aws_sso_ec2_exec_command uses the AWS SDK directly and does not require AWS CLI.
- EC2 commands require the instance to have SSM Agent installed and running, and an IAM role with the AmazonSSMManagedInstanceCore policy; the assumed role needs ssm:SendCommand and ssm:GetCommandInvocation permissions.
- The tool runs entirely locally, uses the user's own AWS SSO credentials, does not send data to third parties, and credentials are stored in the standard AWS location (~/.aws/).
- Supports any MCP-compatible AI assistant, such as Claude Desktop, Cursor AI, Continue.dev, etc.