Skip to main content

aws-sso-mcp

Got more than one AWS account or org? Sign in once, ask in plain English, and get one merged answer from all of them, using the IAM roles your rules choose, never the AI's.

aws-sso-mcp is an MCP (Model Context Protocol) server. It plugs into a chat assistant such as GitHub Copilot Chat in VS Code or Claude Desktop, and lets that assistant query and manage AWS through your AWS IAM Identity Center (SSO) login.

"List all stopped EC2 instances across every prod account in org1."

One sentence in. One combined answer out, from every matching account.

Contents

Is this for you?

If you work in more than one AWS account, yes. The more accounts and orgs you have, the more it saves you.

  • Several orgs. Keep every org in one config file. Switch between them in chat, or query several in a single request. Each org needs its own login, and you never mix them up by accident.
  • Dozens or hundreds of accounts. Find accounts by name, id or environment, then ask one question of all of them. No account-by-account console hopping, no profile juggling.
  • A different role per account. Prod gets ReadOnlyAccess, sandboxes get PowerUserAccess. You write that once, and it is applied everywhere.
  • Questions that cross accounts. "Where is this running?", "Which accounts have public buckets?", "What is stopped in prod?" Each is one sentence instead of an afternoon of clicking.

If you only ever use a single account, it still works, but a plain AWS CLI profile is simpler.

Why this exists

Companies often have tens or hundreds of AWS accounts, spread over several AWS Organizations. Answering "where is X running?" normally means logging in to each account in turn.

This server removes that grind:

Without it With it
Sign in to every account, one by one Sign in once per organization
Remember which IAM role to use in which account Roles are chosen by rules you write in a config file
Run the same CLI command N times One request fans out to all N accounts in parallel
Copy and merge the outputs yourself One merged, sorted, redacted result

What you can do with it

  • Query any AWS service. One generic tool (aws_query) takes the same service and operation names as the AWS CLI and boto3, for example ec2 and DescribeInstances. There are no per-service tools to wait for.
  • Select accounts flexibly. Pick by org, exact name, id, name substring, or an environment (prod, staging, dev) that you define. Exclusions are supported.
  • Chain steps. run_dag runs a small multi-step plan per account. For example, list the instances, then describe their volumes using the first step's output.
  • Manage sessions. Log in, switch org, check token status, search the cached account directory.
  • Audit everything. Every call is appended to a local JSONL audit log.

How it works in 30 seconds

flowchart TD
    You([You]) -->|1. ask in plain English| Chat[Chat assistant<br/>Copilot, Claude, ...]
    Chat -->|2. MCP tool call over stdio| MCP[aws-sso-mcp]
    MCP -->|3. sign in once, device login| IDC[AWS IAM Identity Center]
    IDC -->|4. short-lived role keys<br/>kept in memory only| MCP
    MCP -->|5. API calls, in parallel| ACC[Your AWS accounts<br/>EC2, S3, IAM ...]
    ACC -->|one reply per account| MCP
    MCP -->|6. merged, redacted result| Chat
    Chat -->|7. answer in plain English| You

The full, step-by-step explanation (with code references) is in docs/how-it-works.md. The detailed connectivity diagrams are in docs/architecture.md.

Quick start

You need Python 3.12+ and uv.

For the full walkthrough, see docs/setup-guide.md.

1. Install

uv tool install aws-sso-mcp     # or: pipx install aws-sso-mcp
aws-sso-mcp --version

2. Create your config (references only, never secrets)

mkdir -p ~/.config/aws-sso-mcp
curl -fsSL https://raw.githubusercontent.com/arnabdas24/aws-sso-mcp/main/examples/config.example.toml \
  -o ~/.config/aws-sso-mcp/config.toml

Edit it and set your start_url and region per org. The minimum is:

default_org = "org1"

[portals.org1]
start_url = "https://your-org1.awsapps.com/start"
region    = "us-east-1"   # where your Identity Center lives, NOT where you query

[portals.org1.environments.prod]
match    = "endswith"
patterns = ["-prod"]
roles    = ["ReadOnlyAccess"]

On Windows, use %USERPROFILE%\.config\aws-sso-mcp\config.toml, or point AWS_SSO_MCP_CONFIG at any path.

3. Register it with your chat client (VS Code example, in your user mcp.json)

{
  "servers": {
    "aws-sso-mcp": { "type": "stdio", "command": "aws-sso-mcp" }
  }
}

Claude Desktop, Claude Code, Cursor, Windsurf and non-default config paths are all covered in docs/setup-guide.md.

4. Chat

In Agent mode, try:

  1. Log in to org1. A browser opens once for approval.
  2. Find accounts with "prod" in the name.
  3. List stopped EC2 instances in us-east-1 across every prod account.

More ready-made phrasings, plus mistakes to avoid, are in docs/prompt-guide.md. To see the exact tool call behind each sentence, read docs/examples.md.

Safety model

Read this before pointing the server at real accounts.

Good to know: it works with exactly the permissions you have.

The server signs in through IAM Identity Center and inherits the permission set of the role you choose. It can see and do what that role allows in IAM, no more and no less, and IAM is the only gate. That is what keeps it simple and predictable. A few habits make it even safer:

  • Pick a read-only role. ViewOnlyAccess, ReadOnlyAccess or a custom least-privilege set is ideal for everyday questions, and is all most people need.
  • Know what the role can read. Read-only roles may still reach some sensitive data, such as S3 objects or Lambda environment variables. Output is redacted on a best-effort basis.
  • Treat AWS text as untrusted. Tags, names and log lines can contain odd instructions, so skim results before acting on them.
  • Glance at wide requests. The server asks you to confirm large selections.
Property What it means
IAM is the only gate The server does not block writes locally. If your SSO role may delete something, a request can delete it. Use read-only roles in your config unless you truly need more.
Role choice is deterministic The AI model never picks a role. Rules in your TOML do (see roles.py).
No surprise browser windows Only the login tool starts a sign-in. Queries fail with clear instructions instead.
Blast-radius cap A selection wider than max_accounts (default 200) is refused until you confirm it.
Secrets are redacted Tokens and keys are scrubbed from logs and tool output (redact.py). Credentials are never written to disk.
Config cannot hold secrets The loader rejects keys that look like secrets (config.py).
Everything is audited One line per call in audit.jsonl, with writes flagged.

AWS response data (tags, names, log lines) is untrusted text that reaches the model. This server bounds its size but cannot remove prompt-injection attempts. Details in docs/architecture.md.

Documentation map

Document Read it if you want to...
docs/how-it-works.md Understand, step by step and in plain language, what happens from your sentence to the answer
docs/architecture.md See connectivity diagrams, components, threads, storage and security layers
docs/code-walkthrough.md Understand each Python file step by step: who calls what, and how files link
docs/technical-deep-dive.md Internals: authentication, token and credential caching, locks, threads, timeouts, known quirks
docs/prompt-guide.md Learn what to say to your assistant, with copy-paste examples
docs/tools-reference.md Look up every tool, argument and response shape
docs/configuration.md Configure orgs, environments, roles and performance
docs/developer-guide.md Set up, test, extend and release the project
docs/adr/README.md Understand why a design decision was made, and what it cost
docs/troubleshooting.md Fix a specific error message
CONTRIBUTING.md Contribute code: setup, quality gates, commit conventions
SECURITY.md Report a vulnerability, or review the threat model
examples/README.md Install and wire up the server in various MCP clients

Project layout

src/aws_sso_mcp/
├── server.py        # MCP tools (thin entry points)
├── fanout.py        # the shared multi-account pipeline
├── planner.py       # which accounts? (selectors -> targets)
├── roles.py         # which role? (deterministic rules)
├── state.py         # per-process session state
├── config.py        # TOML loading and validation
├── audit.py         # append-only JSONL audit log
├── redact.py        # secret scrubbing
├── hardening.py     # output size caps + redaction in one pass
├── logging_setup.py # stderr + chat-UI logging
├── awscfg.py        # cached boto3 client factory
├── errors.py        # clean, user-facing exception types
├── sso/             # login (device_auth), credentials (broker), directory
├── cache/           # SQLite account/role cache
└── engine/          # catalog (one AWS call), dag (multi-step), executor (threads)

Requirements and status

  • Python 3.12 or newer, boto3, and the mcp SDK (see pyproject.toml).
  • Alpha (0.1.x): interfaces may change.
  • Transport is stdio. The server is started by your chat client, one process per session.

Security

Credentials are brokered, never stored on disk; see Safety model and the full threat model in SECURITY.md. Report vulnerabilities privately via GitHub Security Advisories, not public issues.

Releases are built by GitHub Actions with PyPI Trusted Publishing and carry a signed SLSA build-provenance attestation plus a CycloneDX SBOM:

gh attestation verify ./aws_sso_mcp-<version>-py3-none-any.whl --repo arnabdas24/aws-sso-mcp

Contributing

See CONTRIBUTING.md. Every change must pass ruff, mypy --strict, the test suite with its global and per-module coverage floors, and vulture.

License

MIT

Metadata

Release files for aws-sso-mcp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aws-sso-mcp 0.1.1
File Size Uploaded Provenance Actions
aws_sso_mcp-0.1.1.tar.gz 70.5 kB With provenance Details for aws_sso_mcp-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aws-sso-mcp 0.1.1
File Interpreter ABI Platform Actions
aws_sso_mcp-0.1.1-py3-none-any.whl Python 3 none any Details for aws_sso_mcp-0.1.1-py3-none-any.whl

Total release size: 151.1 kB

Release files / aws_sso_mcp-0.1.1.tar.gz

Download URL aws_sso_mcp-0.1.1.tar.gz
Size 70.5 kB
Tags Source
SHA-256 checksum
How to use checksums
aa699b2b7cf98532fd2a4846eeb1aa626ffb32fb6915a0acdc8bcb81c2df9620
BLAKE2b-256 checksum
How to use checksums
a30be649cd2d42f4ba5f394069699ab574e0862c3774c233b0e74675a8b87cdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Release files / aws_sso_mcp-0.1.1-py3-none-any.whl

Download URL aws_sso_mcp-0.1.1-py3-none-any.whl
Size 80.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e015992938ea1e5a42e63b1f733dbed266db1058e2954b9d787f36572bb99aaf
BLAKE2b-256 checksum
How to use checksums
9a54f114ce0bafcc9934ad51a04933157d87b2fc0ce12e288472fad6330f8ec6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Security for aws-sso-mcp 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aws_sso_mcp-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page