Interact with AWS resources using Single Sign-On (SSO). Supports SSO login, listing accounts/roles, and executing AWS CLI commands.
Transform how you manage and access your AWS infrastructure by connecting Claude, Cursor AI, and other AI assistants directly to your AWS accounts through Single Sign-On. 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:
aws_sso_login
Basic Login:
{}
Custom Login Options:
{
"launchBrowser": false,
"autoPoll": true
}
aws_sso_status
Check Authentication Status:
{}
aws_sso_ls_accounts
List All Accounts and Roles:
{}
aws_sso_exec_command
List 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_command
Check 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)Authentication:
AWS_SSO_START_URL
: Your AWS SSO start URLAWS_SSO_REGION
: Your AWS SSO regionAWS_PROFILE
: Your AWS profile name (optional)AWS_REGION
: Your AWS region (optional)CLI commands use kebab-case
. Run --help
for details (e.g., mcp-aws-sso login --help
).
--no-launch-browser
, --no-auto-poll
). 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"
.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.json
If you're still having issues:
For AWS SSO Setup:
For EC2 Commands via SSM:
ssm:SendCommand
and ssm:GetCommandInvocation
permissionsAmazonSSMManagedInstanceCore
policyCurrently, each installation supports one AWS SSO start URL. For multiple organizations, you'd need separate configurations or manually switch the AWS_SSO_START_URL
environment variable.
AWS SSO tokens typically last 8-12 hours. Temporary credentials for specific accounts/roles last about 1 hour. The tool automatically handles token refresh and credential caching for you.
Any AI assistant that supports the Model Context Protocol (MCP):
Yes! This tool:
Yes, AWS CLI v2 is required for the aws_sso_exec_command
tool. However, the authentication and account listing features work without it.
This tool uses AWS SSO directly and doesn't rely on AWS CLI profiles. It manages its own credential cache independently of the AWS CLI configuration.
aws_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*
# Clone repository
git clone https://github.com/aashari/mcp-server-aws-sso.git
cd mcp-server-aws-sso
# Install dependencies
npm install
# Run in development mode
npm run dev:server
# Run tests
npm test
Need help? Here's how to get assistance:
Made with ❤️ for DevOps teams who want to bring AI into their AWS workflow.
An MCP server for managing ONOS (Open Network Operating System) networks.
Provides a unified interface to AWS services for security investigations and incident response.
Access Grafana resources like dashboards, datasources, Prometheus, Loki, and alerts.
Access blockchain data using the Ankr API.
Integrates with Google Play Store command-line tools, enabling AI assistants to manage apps via the Play Console API.
Administer Google Workspace using the GAM command-line tool.
Manage Terraform Cloud infrastructure using natural language via its API.
Provides AI assistants with controlled access to the Auth0 Management API for tenant management, enforcing security and least-privilege access.
Integrates Claude with Salesforce, enabling natural language interactions with your Salesforce data and metadata.
Administer Keycloak by managing users, realms, roles, and other resources through an LLM interface.