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. ✅ Ask AI about your AWS accounts: "Show me all my AWS accounts and available roles" ✅ Exec
Add this skill
npx mdskills install aashari/mcp-server-aws-ssoWell-documented AWS SSO integration enabling AI assistants to manage multi-account AWS environments
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.
✅ 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"
Get up and running in 2 minutes:
Set up AWS IAM Identity Center:
https://your-company.awsapps.com/start)# Set your AWS SSO configuration
export AWS_SSO_START_URL="https://your-company.awsapps.com/start"
export AWS_REGION="us-east-1"
# Start the authentication flow
npx -y @aashari/mcp-server-aws-sso login
# List your accessible accounts and roles
npx -y @aashari/mcp-server-aws-sso ls-accounts
# Execute an AWS command
npx -y @aashari/mcp-server-aws-sso exec-command \
--account-id 123456789012 \
--role-name ReadOnly \
--command "aws s3 ls"
Add this to your Claude configuration file (~/.claude/claude_desktop_config.json):
{
"mcpServers": {
"aws-sso": {
"command": "npx",
"args": ["-y", "@aashari/mcp-server-aws-sso"],
"env": {
"AWS_SSO_START_URL": "https://your-company.awsapps.com/start",
"AWS_REGION": "us-east-1"
}
}
}
}
Restart Claude Desktop, and you'll see "🔗 aws-sso" in the status bar.
Most AI assistants support MCP. Install the server globally:
npm install -g @aashari/mcp-server-aws-sso
Then configure your AI assistant to use the MCP server with STDIO transport.
Create ~/.mcp/configs.json for system-wide configuration:
{
"aws-sso": {
"environments": {
"AWS_SSO_START_URL": "https://your-company.awsapps.com/start",
"AWS_REGION": "us-east-1",
"DEBUG": "false"
}
}
}
Alternative config keys: The system also accepts "@aashari/mcp-server-aws-sso" or "mcp-server-aws-sso" instead of "aws-sso".
Ask your AI assistant:
Ask your AI assistant:
Ask your AI assistant:
Ask your AI assistant:
Ask your AI assistant:
MCP Tool Examples (Click to expand)
aws_sso_loginBasic Login:
{}
Custom Login Options:
{
"launchBrowser": false
}
aws_sso_statusCheck Authentication Status:
{}
aws_sso_ls_accountsList All Accounts and Roles:
{}
aws_sso_exec_commandList S3 Buckets:
{
"accountId": "123456789012",
"roleName": "ReadOnly",
"command": "aws s3 ls"
}
Describe EC2 Instances in a Specific Region:
{
"accountId": "123456789012",
"roleName": "AdminRole",
"command": "aws ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId,State.Name,InstanceType]' --output table",
"region": "us-west-2"
}
aws_sso_ec2_exec_commandCheck System Resources:
{
"instanceId": "i-0a69e80761897dcce",
"accountId": "123456789012",
"roleName": "InfraOps",
"command": "uptime && df -h && free -m"
}
This server supports two transport modes for different integration scenarios:
# Run with STDIO transport (default for AI assistants)
TRANSPORT_MODE=stdio npx @aashari/mcp-server-aws-sso
# Using npm scripts (after installation)
npm run mcp:stdio
# Run with HTTP transport (default when no CLI args)
TRANSPORT_MODE=http npx @aashari/mcp-server-aws-sso
# Using npm scripts (after installation)
npm run mcp:http
# Test with MCP Inspector
npm run mcp:inspect
Transport Configuration:
TRANSPORT_MODE: Set to stdio or http (default: http for server mode, stdio for 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_REGION or AWS_REGION: AWS region for SSO authentication (e.g., us-east-1)AWS_PROFILE: AWS profile name (optional, for CLI compatibility)When integrated with AI assistants via MCP, the following tools are available:
aws_sso_login: Initiates AWS SSO device authorization flow
launchBrowser (optional, boolean, default: true)aws_sso_status: Checks current authentication status
aws_sso_ls_accounts: Lists all accessible AWS accounts and roles
aws_sso_exec_command: Executes AWS CLI commands with SSO credentials
accountId, roleName, commandregionaws_sso_ec2_exec_command: Executes shell commands on EC2 instances via SSM
instanceId, accountId, roleName, commandregionAll tools are also available as CLI commands using kebab-case. Run --help for details (e.g., mcp-aws-sso login --help).
--no-launch-browser). Ex: mcp-aws-sso login.mcp-aws-sso status.mcp-aws-sso ls-accounts.--account-id, --role-name, --command, --region). Ex: mcp-aws-sso exec-command --account-id 123456789012 --role-name ReadOnly --command "aws s3 ls".--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".CLI Command Examples (Click to expand)
Standard Login (launches browser and polls automatically):
mcp-aws-sso login
Login without Browser Launch:
mcp-aws-sso login --no-launch-browser
List S3 Buckets:
mcp-aws-sso exec-command \
--account-id 123456789012 \
--role-name ReadOnly \
--command "aws s3 ls"
List EC2 Instances with Specific Region:
mcp-aws-sso exec-command \
--account-id 123456789012 \
--role-name AdminRole \
--region us-west-2 \
--command "aws ec2 describe-instances --output table"
Check System Resources:
mcp-aws-sso ec2-exec-command \
--instance-id i-0a69e80761897dcce \
--account-id 123456789012 \
--role-name InfraOps \
--command "uptime && df -h && free -m"
Re-authenticate with AWS SSO:
# Test your SSO configuration
npx -y @aashari/mcp-server-aws-sso login
Check your AWS SSO configuration:
AWS_SSO_START_URL is correct (should be your organization's SSO portal)AWS_REGION matches your SSO region configurationVerify your SSO setup:
Check available accounts and roles:
# List all accessible accounts
npx -y @aashari/mcp-server-aws-sso ls-accounts
Verify account ID format:
ls-accounts outputCheck role permissions:
Install AWS CLI v2:
aws command is in your system PATHTest AWS CLI independently:
aws --version
aws sts get-caller-identity
Verify EC2 instance setup:
AmazonSSMManagedInstanceCore policyCheck your role permissions:
ssm:SendCommand and ssm:GetCommandInvocation permissionsTest 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/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonIf you're still having issues:
For AWS IAM Identity Center (SSO) Setup:
For EC2 Commands via SSM:
ssm:SendCommand and ssm:GetCommandInvocation permissionsAmazonSSMManagedInstanceCore policyCurrently, each installation supports one AWS SSO start URL at a time. For multiple organizations, you can:
AWS_SSO_START_URL environment variable between sessionsAny AI assistant that supports the Model Context Protocol (MCP):
Yes! This tool prioritizes security:
~/.aws/)For aws_sso_exec_command: 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 aws_sso_ec2_exec_command: No, this uses the AWS SDK directly via Systems Manager.
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:
~/.aws/sso/cache/ (standard AWS location)AWS_PROFILE for compatibility with other AWS toolsThey're the same service! AWS SSO was rebranded to AWS IAM Identity Center in 2022. This tool works with both names:
https://your-org.awsapps.com/startTOON (Token-Oriented Object Notation) is an output format optimized for Large Language Models:
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.
Response Format Examples (Click to expand)
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:
~/.mcp/data/@aashari.mcp-server-aws-sso.[session-id].logaws_sso_exec_command)# AWS SSO: Command Result
**Account/Role:** 123456789012/ReadOnly
**Region:** us-east-1 (Default: ap-southeast-1)
## Command
aws s3 ls
## Output
2023-01-15 08:42:53 my-bucket-1
2023-05-22 14:18:19 my-bucket-2
2024-02-10 11:05:37 my-logs-bucket
*Executed: 2025-05-19 06:21:49 UTC*
# ❌ AWS SSO: Command Error
**Account/Role:** 123456789012/ReadOnly
**Region:** us-east-1 (Default: ap-southeast-1)
## Command
aws s3api get-object --bucket restricted-bucket --key secret.txt output.txt
## Error: Permission Denied
The role `ReadOnly` does not have permission to execute this command.
## Error Details
An error occurred (AccessDenied) when calling the GetObject operation: Access Denied
### Troubleshooting
#### Available Roles
- AdminAccess
- PowerUserAccess
- S3FullAccess
Try executing the command again using one of the roles listed above that has appropriate permissions.
*Executed: 2025-05-19 06:17:49 UTC*
When API responses exceed 10KB, the output is truncated with a message:
[Response truncated for AI consumption. Full response logged to: /path/to/log/file.log]
This ensures AI assistants receive manageable response sizes while developers can access full output in log files.
This server follows a clean 5-layer architecture:
src/cli/): Command-line interface using Commander.jssrc/tools/): MCP tool definitions with Zod validation schemassrc/controllers/): Business logic and orchestrationsrc/services/): External API interactions (AWS SDK)src/utils/): Shared utilities (logging, config, caching, formatting)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.
~/.aws/sso/cache/ (standard AWS location)# Clone repository
git clone https://github.com/aashari/mcp-server-aws-sso.git
cd mcp-server-aws-sso
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode with HTTP transport
npm run dev:http
# Run with STDIO transport (for MCP client testing)
npm run dev:stdio
# Run with MCP Inspector (visual debugging)
npm run mcp:inspect
# Run tests
npm test
# Run tests with coverage
npm test:coverage
# Lint code
npm run lint
# Format code
npm run format
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 Prettieraws_sso_exec_command)See CHANGELOG.md for complete version history.
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.
ISC License - See LICENSE file for details
Need help? Here's how to get assistance:
~/.mcp/data/@aashari.mcp-server-aws-sso.[session-id].log for detailed error informationBuilt 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.
Install via CLI
npx mdskills install aashari/mcp-server-aws-ssoConnect AI to Your AWS Resources is a free, open-source AI agent skill. 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. ✅ Ask AI about your AWS accounts: "Show me all my AWS accounts and available roles" ✅ Exec
Install Connect AI to Your AWS Resources with a single command:
npx mdskills install aashari/mcp-server-aws-ssoThis downloads the skill files into your project and your AI agent picks them up automatically.
Connect AI to Your AWS Resources works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Gemini Cli, Amp, Roo Code, Goose. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.