Provides tools for managing and accessing AWS resources across multiple accounts through AWS IAM Identity Center (SSO), enabling account and role discovery, execution of AWS CLI commands, and remote shell command execution on EC2 instances via Systems Manager (SSM).
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AWS SSO MCP ServerList all running EC2 instances in my production account"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Connect AI to Your AWS Resources
Transform how you manage and access your AWS infrastructure by connecting Claude, Cursor AI, and other AI assistants directly to your AWS accounts through AWS IAM Identity Center (formerly AWS SSO). Get instant access to your cloud resources, execute commands, and manage EC2 instances using natural language.
What You Can Do
✅ Ask AI about your AWS accounts: "Show me all my AWS accounts and available roles"
✅ Execute AWS commands: "List all S3 buckets in my production account"
✅ Manage EC2 instances: "Check the disk usage on server i-123456789"
✅ Access multi-account setups: "Switch to the staging account and describe the VPCs"
✅ Monitor resources: "Get the status of all running EC2 instances"
✅ Run shell commands: "Execute 'df -h' on my web server via SSM"
Perfect For
DevOps Engineers managing multi-account AWS environments and infrastructure automation
Cloud Architects needing quick access to resource information across AWS accounts
Developers who want to check deployments and run AWS CLI commands through AI
SRE Teams monitoring and troubleshooting AWS resources using natural language
IT Administrators managing EC2 instances and executing remote commands securely
Anyone who wants to interact with AWS using conversational AI
Quick Start
Get up and running in 2 minutes:
1. Get Your AWS SSO Setup
Set up AWS IAM Identity Center:
Enable AWS IAM Identity Center in your AWS account
Configure your identity source (AWS directory, Active Directory, or external IdP)
Set up permission sets and assign users to AWS accounts
Note your AWS SSO Start URL (e.g.,
https://your-company.awsapps.com/start)
2. Try It Instantly
Connect to AI Assistants
For Claude Desktop Users
Add this to your Claude configuration file (~/.claude/claude_desktop_config.json):
Restart Claude Desktop, and you'll see "🔗 aws-sso" in the status bar.
For Other AI Assistants
Most AI assistants support MCP. Install the server globally:
Then configure your AI assistant to use the MCP server with STDIO transport.
Alternative: Configuration File
Create ~/.mcp/configs.json for system-wide configuration:
Alternative config keys: The system also accepts "@aashari/mcp-server-aws-sso" or "mcp-server-aws-sso" instead of "aws-sso".
Real-World Examples
🔐 Authenticate and Explore
Ask your AI assistant:
"Log into AWS SSO and show me my authentication status"
"List all my AWS accounts and the roles I can assume"
"Check if I'm still authenticated to AWS"
"Show me which AWS accounts I have access to"
🛠️ Execute AWS Commands
Ask your AI assistant:
"List all S3 buckets in my production account using the ReadOnly role"
"Show me all running EC2 instances in the us-west-2 region"
"Describe the VPCs in my staging AWS account"
"Get the status of my RDS databases in account 123456789012"
🖥️ Manage EC2 Instances
Ask your AI assistant:
"Check the disk usage on EC2 instance i-1234567890abcdef0"
"Run 'uptime' on my web server via Systems Manager"
"Execute 'systemctl status nginx' on instance i-abc123 in production"
"Get memory usage from all my application servers"
🔍 Infrastructure Monitoring
Ask your AI assistant:
"List all Lambda functions in my development account"
"Show me the CloudFormation stacks in us-east-1"
"Check the health of my load balancers"
"Get the latest CloudWatch alarms that are in ALARM state"
🔄 Multi-Account Operations
Ask your AI assistant:
"Switch to account 987654321098 with AdminRole and list all security groups"
"Compare the running instances between staging and production accounts"
"Check backup policies across all my AWS accounts"
"Audit IAM users in the security account"
aws_sso_login
Basic Login:
Custom Login Options:
aws_sso_status
Check Authentication Status:
aws_sso_ls_accounts
List All Accounts and Roles:
aws_sso_exec_command
List S3 Buckets:
Describe EC2 Instances in a Specific Region:
aws_sso_ec2_exec_command
Check System Resources:
Transport Modes
This server supports two transport modes for different integration scenarios:
STDIO Transport (Default for MCP Clients)
Traditional subprocess communication via stdin/stdout
Ideal for local AI assistant integrations (Claude Desktop, Cursor AI)
Uses pipe-based communication for direct MCP protocol exchange
HTTP Transport (Default for Server Mode)
Modern HTTP-based transport with Server-Sent Events (SSE)
Supports multiple concurrent connections
Better for web-based integrations and development
Runs on port 3000 by default (configurable via PORT env var)
Endpoint: http://localhost:3000/mcp
Health check: http://localhost:3000/
Environment Variables
Transport Configuration:
TRANSPORT_MODE: Set tostdioorhttp(default:httpfor server mode,stdiofor MCP clients)PORT: HTTP server port (default: 3000)DEBUG: Enable debug logging (default: false)
AWS Configuration:
AWS_SSO_START_URL: Your AWS IAM Identity Center start URL (e.g.,https://your-org.awsapps.com/start)AWS_SSO_REGIONorAWS_REGION: AWS region for SSO authentication (e.g.,us-east-1)AWS_PROFILE: AWS profile name (optional, for CLI compatibility)
Available Tools
When integrated with AI assistants via MCP, the following tools are available:
Authentication Tools
aws_sso_login: Initiates AWS SSO device authorization flowParameters:
launchBrowser(optional, boolean, default: true)Opens browser automatically for authentication
Handles device authorization code flow
Caches tokens for subsequent operations
aws_sso_status: Checks current authentication statusNo parameters required
Returns session details and expiration time
Verifies cached token validity
Account Management Tools
aws_sso_ls_accounts: Lists all accessible AWS accounts and rolesNo parameters required
Shows account IDs, names, emails, and available roles
Essential for discovering which accounts/roles you can use
Command Execution Tools
aws_sso_exec_command: Executes AWS CLI commands with SSO credentialsRequired:
accountId,roleName,commandOptional:
regionAutomatically obtains and caches temporary credentials
Supports any AWS CLI command
aws_sso_ec2_exec_command: Executes shell commands on EC2 instances via SSMRequired:
instanceId,accountId,roleName,commandOptional:
regionNo SSH access required (uses AWS Systems Manager)
Instance must have SSM Agent installed
CLI Commands
All tools are also available as CLI commands using kebab-case. Run --help for details (e.g., mcp-aws-sso login --help).
login: Authenticates via AWS SSO (
--no-launch-browser). Ex:mcp-aws-sso login.status: Checks authentication status (no options). Ex:
mcp-aws-sso status.ls-accounts: Lists accounts/roles (no options). Ex:
mcp-aws-sso ls-accounts.exec-command: Runs AWS CLI command (
--account-id,--role-name,--command,--region). Ex:mcp-aws-sso exec-command --account-id 123456789012 --role-name ReadOnly --command "aws s3 ls".ec2-exec-command: Runs shell command on EC2 (
--instance-id,--account-id,--role-name,--command,--region). Ex:mcp-aws-sso ec2-exec-command --instance-id i-0a69e80761897dcce --account-id 123456789012 --role-name InfraOps --command "uptime".
Login
Standard Login (launches browser and polls automatically):
Login without Browser Launch:
Execute AWS Commands
List S3 Buckets:
List EC2 Instances with Specific Region:
Execute EC2 Commands
Check System Resources:
Troubleshooting
"Authentication failed" or "Token expired"
Re-authenticate with AWS SSO:
# Test your SSO configuration npx -y @aashari/mcp-server-aws-sso loginCheck your AWS SSO configuration:
Verify your
AWS_SSO_START_URLis correct (should be your organization's SSO portal)Ensure your
AWS_REGIONmatches your SSO region configuration
Verify your SSO setup:
Make sure you can access the SSO portal in your browser
Check that your AWS account assignments are active
"Account not found" or "Role not found"
Check available accounts and roles:
# List all accessible accounts npx -y @aashari/mcp-server-aws-sso ls-accountsVerify account ID format:
Account ID should be exactly 12 digits
Use the exact account ID from the
ls-accountsoutput
Check role permissions:
Make sure you have permission to assume the specified role
Use the exact role name from your permission sets
"AWS CLI not found" or Command execution errors
Install AWS CLI v2:
Download from AWS CLI Installation Guide
Ensure
awscommand is in your system PATH
Test AWS CLI independently:
aws --version aws sts get-caller-identity
"EC2 command failed" or "SSM connection issues"
Verify EC2 instance setup:
Instance must have SSM Agent installed and running
Instance needs an IAM role with
AmazonSSMManagedInstanceCorepolicy
Check your role permissions:
Your assumed role needs
ssm:SendCommandandssm:GetCommandInvocationpermissionsVerify the instance is in a running state
Test SSM connectivity:
# Test if instance is reachable via SSM npx -y @aashari/mcp-server-aws-sso exec-command \ --account-id YOUR_ACCOUNT \ --role-name YOUR_ROLE \ --command "aws ssm describe-instance-information"
Claude Desktop Integration Issues
Restart Claude Desktop after updating the config file
Check the status bar for the "🔗 aws-sso" indicator
Verify config file location:
macOS:
~/.claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Getting Help
If you're still having issues:
Run a simple test command to verify everything works
Check the GitHub Issues for similar problems
Create a new issue with your error message and setup details
Frequently Asked Questions
What permissions do I need?
For AWS IAM Identity Center (SSO) Setup:
Access to AWS IAM Identity Center with a configured identity source
Permission sets assigned to you by your AWS administrator
Access to the specific AWS accounts you want to manage
For EC2 Commands via SSM:
Your assumed role needs
ssm:SendCommandandssm:GetCommandInvocationpermissionsEC2 instances need an IAM role with
AmazonSSMManagedInstanceCorepolicySSM Agent must be installed and running on target instances
Can I use this with multiple AWS organizations?
Currently, each installation supports one AWS SSO start URL at a time. For multiple organizations, you can:
Switch the
AWS_SSO_START_URLenvironment variable between sessionsRun separate instances with different configurations
Use multiple Claude Desktop configurations for different organizations
How long do the SSO credentials last?
SSO tokens: Typically 8-12 hours (managed by AWS IAM Identity Center)
Temporary credentials: Approximately 1 hour per account/role
The tool automatically handles token refresh and credential caching
You'll be prompted to re-authenticate when tokens expire
What AI assistants does this work with?
Any AI assistant that supports the Model Context Protocol (MCP):
Claude Desktop (most popular and well-tested)
Cursor AI (code editor with AI)
Continue.dev (VS Code extension)
Any other MCP-compatible client
Is my data secure?
Yes! This tool prioritizes security:
Runs entirely on your local machine (no external servers)
Uses your own AWS SSO credentials (no third-party authentication)
Never sends your data to third parties
Only accesses what you explicitly grant permission to
Uses AWS temporary credentials that automatically expire
Follows AWS best practices for credential management
Credentials are stored in standard AWS locations (
~/.aws/)
Do I need AWS CLI installed?
For Yes, AWS CLI v2 is required to execute AWS commands.
For other tools: No, authentication (aws_sso_login), status checking (aws_sso_status), and account listing (aws_sso_ls_accounts) work without AWS CLI.
For No, this uses the AWS SDK directly via Systems Manager.
Can I use this with AWS CLI profiles?
This tool uses AWS IAM Identity Center directly and manages its own credential cache. It doesn't require AWS CLI profiles but is compatible with them:
The tool stores credentials in
~/.aws/sso/cache/(standard AWS location)You can optionally set
AWS_PROFILEfor compatibility with other AWS toolsThe tool works independently of AWS CLI profile configuration
What's the difference between AWS SSO and AWS IAM Identity Center?
They're the same service! AWS SSO was rebranded to AWS IAM Identity Center in 2022. This tool works with both names:
References to "AWS SSO" in the code and documentation refer to AWS IAM Identity Center
Your start URL format remains the same:
https://your-org.awsapps.com/startAll functionality is identical regardless of the naming
What is TOON format?
TOON (Token-Oriented Object Notation) is an output format optimized for Large Language Models:
More compact than JSON (saves tokens when sending data to AI)
Still human-readable
Automatically used when available, falls back to JSON if needed
Learn more: @toon-format/toon
Where are logs stored?
Debug logs are written to: ~/.mcp/data/@aashari.mcp-server-aws-sso.[session-id].log
Each session gets a unique log file. Enable debug logging with DEBUG=true.
Output Format (TOON)
Responses are formatted using TOON (Token-Oriented Object Notation) format, which is optimized for LLM token efficiency. TOON provides a more compact representation than JSON while maintaining readability.
Key Features:
Automatically converts responses to TOON format when available
Falls back to JSON if TOON conversion fails
Truncates large responses (>10KB) with a note about the full response location
Logs full responses to
~/.mcp/data/@aashari.mcp-server-aws-sso.[session-id].log
MCP Tool Response Example (aws_sso_exec_command)
Error Response Example
Large Response Handling
When API responses exceed 10KB, the output is truncated with a message:
This ensures AI assistants receive manageable response sizes while developers can access full output in log files.
Technical Details
Architecture
This server follows a clean 5-layer architecture:
CLI Layer (
src/cli/): Command-line interface using Commander.jsTools Layer (
src/tools/): MCP tool definitions with Zod validation schemasControllers Layer (
src/controllers/): Business logic and orchestrationServices Layer (
src/services/): External API interactions (AWS SDK)Utils Layer (
src/utils/): Shared utilities (logging, config, caching, formatting)
Key Dependencies
@modelcontextprotocol/sdk v1.23.0: MCP protocol implementation
@aws-sdk/client-sso v3.893.0: AWS SSO API client
@aws-sdk/client-ssm v3.893.0: AWS Systems Manager for EC2 commands
@toon-format/toon v2.0.1: Token-efficient output formatting
zod v4.1.13: Runtime type validation
commander v14.0.2: CLI framework
Logging
Debug logs are written to: ~/.mcp/data/@aashari.mcp-server-aws-sso.[session-id].log
Enable debug logging by setting DEBUG=true in your environment.
Caching
SSO tokens: Cached in
~/.aws/sso/cache/(standard AWS location)Temporary credentials: Cached for 1 hour per account/role combination
Account information: Fetched fresh on each request (no persistent cache)
Development
Available npm Scripts
npm run build- Compile TypeScript to JavaScriptnpm run mcp:stdio- Run with STDIO transportnpm run mcp:http- Run with HTTP transportnpm run mcp:inspect- Run with MCP Inspector for debuggingnpm test- Run Jest testsnpm run lint- Run ESLintnpm run format- Format code with Prettier
Requirements
Node.js: Version 18.0.0 or higher
AWS CLI: Version 2.x (required only for
aws_sso_exec_command)AWS IAM Identity Center: Configured and accessible
Operating System: macOS, Linux, or Windows
Version History
v3.0.1 (Current)
Fixed picomatch dependency conflict for npm ci
Enhanced raw response logging with truncation for large API responses
Improved AI guidance for AWS SSO login instructions
v3.0.0
BREAKING: Modernized to @modelcontextprotocol/sdk v1.23.0 with registerTool API
Added Node.js version specification (Node 22.14.0 compatibility)
Enhanced logging and error handling
v2.0.0
BREAKING: Fixed AWS CLI execution and credential region mismatch issues
Improved cross-region authentication handling
Prevented dotenv from outputting to STDIO in MCP mode
See CHANGELOG.md for complete version history.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
License
ISC License - See LICENSE file for details
Support
Need help? Here's how to get assistance:
Check the troubleshooting section above - most common issues are covered there
Visit our GitHub repository for documentation and examples: github.com/aashari/mcp-server-aws-sso
Report issues at GitHub Issues
Start a discussion for feature requests or general questions
Check debug logs at
~/.mcp/data/@aashari.mcp-server-aws-sso.[session-id].logfor detailed error information
Built with: TypeScript, MCP SDK, AWS SDK for JavaScript v3, TOON Format
Made with care for DevOps teams who want to bring AI into their AWS workflow.