mcp-server-aws-sso

mcp-server-aws-sso

Seamlessly connect AI assistants to AWS resources using Single Sign-On.

4
Stars
7
Forks
4
Watchers
13
Issues
mcp-server-aws-sso enables integration of AI assistants such as Claude and Cursor AI with AWS resources via AWS SSO. It facilitates secure, natural language access and management of AWS infrastructure, including executing CLI commands, listing accounts and roles, and performing EC2 operations. MCP transport modes are supported, including STDIO and HTTP, making it compatible with a wide range of MCP-compliant clients.

Key Features

Integrates AI assistants with AWS resources via SSO
Natural language execution of AWS CLI commands
Multi-account and multi-role AWS management
Supports STDIO and HTTP transport modes for MCP compatibility
EC2 instance management via SSM
Role-based authentication and credential caching
Interactive CLI and programmatic configuration
Detailed error handling and troubleshooting support
Customizable through config files and environment variables
Secure local operation with no third-party data sharing

Use Cases

Enabling DevOps engineers to manage AWS environments conversationally
Allowing developers to execute AWS CLI tasks through AI assistants
Cloud architects retrieving multi-account resource information using natural language
SRE teams monitoring and troubleshooting AWS infrastructure interactively
IT administrators securely executing remote commands on EC2 instances
Automating resource discovery and audits across multiple AWS accounts
Performing multi-region AWS operations via AI-driven interfaces
Supporting end users in authentication and AWS session management
Integrating AWS operations into custom AI workflows using MCP STDIO or HTTP
Enhancing cloud security audits through role-based AWS access verification

README

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 Single Sign-On. Get instant access to your cloud resources, execute commands, and manage EC2 instances using natural language.

NPM Version

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:

  1. Enable AWS IAM Identity Center in your AWS account
  2. Configure your identity source (AWS directory, Active Directory, or external IdP)
  3. Set up permission sets and assign users to AWS accounts
  4. Note your AWS SSO Start URL (e.g., https://your-company.awsapps.com/start)

2. Try It Instantly

bash
# 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"

Connect to AI Assistants

For Claude Desktop Users

Add this to your Claude configuration file (~/.claude/claude_desktop_config.json):

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.

For Other AI Assistants

Most AI assistants support MCP. Install the server globally:

bash
npm install -g @aashari/mcp-server-aws-sso

Then configure your AI assistant to use the MCP server with STDIO transport.

Alternative: Configuration File

Create ~/.mcp/configs.json for system-wide configuration:

json
{
  "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".

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:

json
{}

Custom Login Options:

json
{
  "launchBrowser": false,
  "autoPoll": true
}

aws_sso_status

Check Authentication Status:

json
{}

aws_sso_ls_accounts

List All Accounts and Roles:

json
{}

aws_sso_exec_command

List S3 Buckets:

json
{
  "accountId": "123456789012", 
  "roleName": "ReadOnly",
  "command": "aws s3 ls"
}

Describe EC2 Instances in a Specific Region:

json
{
  "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:

json
{
  "instanceId": "i-0a69e80761897dcce",
  "accountId": "123456789012",
  "roleName": "InfraOps",
  "command": "uptime && df -h && free -m"
}

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
bash
# 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

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/
bash
# 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

Environment Variables

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 URL
  • AWS_SSO_REGION: Your AWS SSO region
  • AWS_PROFILE: Your AWS profile name (optional)
  • AWS_REGION: Your AWS region (optional)

CLI Commands

CLI commands use kebab-case. Run --help for details (e.g., mcp-aws-sso login --help).

  • login: Authenticates via AWS SSO (--no-launch-browser, --no-auto-poll). 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):

bash
mcp-aws-sso login

Login without Browser Launch:

bash
mcp-aws-sso login --no-launch-browser

Execute AWS Commands

List S3 Buckets:

bash
mcp-aws-sso exec-command \
  --account-id 123456789012 \
  --role-name ReadOnly \
  --command "aws s3 ls"

List EC2 Instances with Specific Region:

bash
mcp-aws-sso exec-command \
  --account-id 123456789012 \
  --role-name AdminRole \
  --region us-west-2 \
  --command "aws ec2 describe-instances --output table"

Execute EC2 Commands

Check System Resources:

bash
mcp-aws-sso ec2-exec-command \
  --instance-id i-0a69e80761897dcce \
  --account-id 123456789012 \
  --role-name InfraOps \
  --command "uptime && df -h && free -m"

Troubleshooting

"Authentication failed" or "Token expired"

  1. Re-authenticate with AWS SSO:

    bash
    # Test your SSO configuration
    npx -y @aashari/mcp-server-aws-sso login
    
  2. Check your AWS SSO configuration:

    • Verify your AWS_SSO_START_URL is correct (should be your organization's SSO portal)
    • Ensure your AWS_REGION matches your SSO region configuration
  3. 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"

  1. Check available accounts and roles:

    bash
    # List all accessible accounts
    npx -y @aashari/mcp-server-aws-sso ls-accounts
    
  2. Verify account ID format:

    • Account ID should be exactly 12 digits
    • Use the exact account ID from the ls-accounts output
  3. 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

  1. Install AWS CLI v2:

  2. Test AWS CLI independently:

    bash
    aws --version
    aws sts get-caller-identity
    

"EC2 command failed" or "SSM connection issues"

  1. Verify EC2 instance setup:

    • Instance must have SSM Agent installed and running
    • Instance needs an IAM role with AmazonSSMManagedInstanceCore policy
  2. Check your role permissions:

    • Your assumed role needs ssm:SendCommand and ssm:GetCommandInvocation permissions
    • Verify the instance is in a running state
  3. Test SSM connectivity:

    bash
    # 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

  1. Restart Claude Desktop after updating the config file
  2. Check the status bar for the "🔗 aws-sso" indicator
  3. Verify config file location:
    • macOS: ~/.claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json

Getting Help

If you're still having issues:

  1. Run a simple test command to verify everything works
  2. Check the GitHub Issues for similar problems
  3. Create a new issue with your error message and setup details

Frequently Asked Questions

What permissions do I need?

For AWS SSO Setup:

  • You need an AWS SSO account with access to IAM Identity Center
  • Permission sets configured by your AWS administrator
  • Access to the specific AWS accounts you want to manage

For EC2 Commands via SSM:

  • Your assumed role needs ssm:SendCommand and ssm:GetCommandInvocation permissions
  • EC2 instances need an IAM role with AmazonSSMManagedInstanceCore policy
  • SSM 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. For multiple organizations, you'd need separate configurations or manually switch the AWS_SSO_START_URL environment variable.

How long do the SSO credentials last?

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.

What AI assistants does this work with?

Any AI assistant that supports the Model Context Protocol (MCP):

  • Claude Desktop (most popular)
  • Cursor AI
  • Continue.dev
  • Many others

Is my data secure?

Yes! This tool:

  • Runs entirely on your local machine
  • Uses your own AWS SSO credentials
  • Never sends your data to third parties
  • Only accesses what you give it permission to access
  • Uses temporary credentials that automatically expire

Do I need AWS CLI installed?

Yes, AWS CLI v2 is required for the aws_sso_exec_command tool. However, the authentication and account listing features work without it.

Can I use this with AWS CLI profiles?

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.

MCP Tool Response Example (aws_sso_exec_command)

markdown
# 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*

Error Response Example

markdown
# ❌ 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*

Development

bash
# 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

Support

Need help? Here's how to get assistance:

  1. Check the troubleshooting section above - most common issues are covered there
  2. Visit our GitHub repository for documentation and examples: github.com/aashari/mcp-server-aws-sso
  3. Report issues at GitHub Issues
  4. Start a discussion for feature requests or general questions

Made with ❤️ for DevOps teams who want to bring AI into their AWS workflow.

Star History

Star History Chart

Repository Owner

aashari
aashari

User

Repository Details

Language TypeScript
Default Branch main
Size 1,171 KB
Contributors 4
MCP Verified Sep 5, 2025

Programming Languages

TypeScript
94.76%
JavaScript
5.24%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • awslabs/mcp

    awslabs/mcp

    Specialized MCP servers for seamless AWS integration in AI and development environments.

    AWS MCP Servers is a suite of specialized servers implementing the open Model Context Protocol (MCP) to bridge large language model (LLM) applications with AWS services, tools, and data sources. It provides a standardized way for AI assistants, IDEs, and developer tools to access up-to-date AWS documentation, perform cloud operations, and automate workflows with context-aware intelligence. Featuring a broad catalog of domain-specific servers, quick installation for popular platforms, and both local and remote deployment options, it enhances cloud-native development, infrastructure management, and workflow automation for AI-driven tools. The project includes Docker, Lambda, and direct integration instructions for environments such as Amazon Q CLI, Cursor, Windsurf, Kiro, and VS Code.

    • 6,220
    • MCP
    • awslabs/mcp
  • cloudflare/mcp-server-cloudflare

    cloudflare/mcp-server-cloudflare

    Connect Cloudflare services to Model Context Protocol (MCP) clients for AI-powered management.

    Cloudflare MCP Server enables integration between Cloudflare's suite of services and clients using the Model Context Protocol (MCP). It provides multiple specialized servers that allow AI models to access, analyze, and manage configurations, logs, analytics, and other features across Cloudflare's platform. Users can leverage natural language interfaces in compatible MCP clients to read data, gain insights, and perform automated actions on their Cloudflare accounts. This project aims to streamline the orchestration of security, development, monitoring, and infrastructure tasks through standardized MCP connections.

    • 2,919
    • MCP
    • cloudflare/mcp-server-cloudflare
  • k8s-mcp-server

    k8s-mcp-server

    Securely enable Claude to run Kubernetes CLI tools via Anthropic's Model Context Protocol.

    K8s MCP Server provides a Docker-based implementation of Anthropic's Model Context Protocol (MCP), allowing Claude to securely execute Kubernetes CLI tools such as kubectl, helm, istioctl, and argocd within a containerized environment. It integrates with Claude Desktop so users can interact with their Kubernetes clusters using natural language. The server emphasizes security by operating as a non-root user and offering strict command validation, while also supporting major cloud providers like AWS, Google Cloud, and Azure. Easy configuration and support for various Unix tools further enhance its capabilities.

    • 166
    • MCP
    • alexei-led/k8s-mcp-server
  • mcp

    mcp

    Universal remote MCP server connecting AI clients to productivity tools.

    WayStation MCP acts as a remote Model Context Protocol (MCP) server, enabling seamless integration between AI clients like Claude or Cursor and a wide range of productivity applications, such as Notion, Monday, Airtable, Jira, and more. It supports multiple secure connection transports and offers both general and user-specific preauthenticated endpoints. The platform emphasizes ease of integration, OAuth2-based authentication, and broad app compatibility. Users can manage their integrations through a user dashboard, simplifying complex workflow automations for AI-powered productivity.

    • 27
    • MCP
    • waystation-ai/mcp
  • mcp-server-js

    mcp-server-js

    Enable secure, AI-driven process automation and code execution on YepCode via Model Context Protocol.

    YepCode MCP Server acts as a Model Context Protocol (MCP) server that facilitates seamless communication between AI platforms and YepCode’s workflow automation infrastructure. It allows AI assistants and clients to execute code, manage environment variables, and interact with storage through standardized tools. The server can expose YepCode processes directly as MCP tools and supports both hosted and local installations via NPX or Docker. Enterprise-grade security and real-time interaction make it suitable for integrating advanced automation into AI-powered environments.

    • 31
    • MCP
    • yepcode/mcp-server-js
  • 1mcp-app/agent

    1mcp-app/agent

    A unified server that aggregates and manages multiple Model Context Protocol servers.

    1MCP Agent provides a single, unified interface that aggregates multiple Model Context Protocol (MCP) servers, enabling seamless integration and management of external tools for AI assistants. It acts as a proxy, managing server configuration, authentication, health monitoring, and dynamic server control with features like asynchronous loading, tag-based filtering, and advanced security options. Compatible with popular AI development environments, it simplifies setup by reducing redundant server instances and resource usage. Users can configure, monitor, and scale model tool integrations across various AI clients through easy CLI commands or Docker deployment.

    • 96
    • MCP
    • 1mcp-app/agent
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results