Guide · AWS IAM Identity Center · Multi-Account Access

AWS IAM Identity Center for MCP Servers — Centralized Multi-Account Access

AWS IAM Identity Center (formerly AWS Single Sign-On) is the recommended way to manage human and programmatic access across multiple AWS accounts in an organization. For MCP server teams operating in a multi-account structure, IdC replaces long-lived IAM access keys with short-lived STS credentials issued through a central portal, an OIDC device authorization flow, or a CLI SSO session. This guide covers how IdC works, the two SDK clients you need (@aws-sdk/client-sso-admin and @aws-sdk/client-identitystore), and how to manage users and groups programmatically.

TL;DR

IAM Identity Center has four moving parts: an instance (one per organization, enabled in the management account), an identity store (holds users and groups — built-in directory, AD, or external IdP), permission sets (IAM policy templates that become roles in each account), and account assignments (which users/groups get which permission set in which account). Users authenticate at the SSO portal URL and receive short-lived STS credentials. MCP servers access credentials programmatically via the OIDC device authorization flow.

Why IAM Identity Center matters for MCP server infrastructure

MCP server platforms typically span multiple AWS accounts: a production account where MCP servers run, a staging account for pre-production, a data account holding DynamoDB tables and S3 buckets the MCP servers read, and a shared-services account for secrets and certificates. Before IAM Identity Center, teams managed this by creating IAM users in each account with long-lived access keys, or by maintaining complex cross-account trust policies on IAM roles.

IAM Identity Center solves this with a single pane of glass:

Instance types: organization instance vs. account instance

An IAM Identity Center instance is the top-level container for your identity configuration. There are two types:

Type Where enabled Works with AWS Organizations Supports cross-account assignment
Organization instance Management account of an org Yes — integrates with OU hierarchy Yes — any account in the org
Account instance Any member account No No — single account only

Use an organization instance in all production cases. Account instances exist for teams that cannot create an org or need IdC in a standalone account for sandbox purposes. The API distinguishes the two via ownerAccountId (management account for org instances, the account itself for account instances) and instanceType ("ORGANIZATION" or "ACCOUNT").

Enabling IdC is a one-time console operation in the management account (or via CloudFormation StackSets). Once enabled, you discover the instance with ListInstances — there is at most one organization instance per organization.

SDK installation and listing the instance

npm install @aws-sdk/client-sso-admin @aws-sdk/client-identitystore

Every SSOAdminClient call requires the instance ARN; every IdentityStoreClient call requires the identity store ID. Both come from ListInstancesCommand:

import { SSOAdminClient, ListInstancesCommand } from "@aws-sdk/client-sso-admin";

// SSOAdminClient must be pointed at the IdC home region
const ssoAdmin = new SSOAdminClient({ region: "us-east-1" });

const { instances } = await ssoAdmin.send(new ListInstancesCommand({}));
const instance = instances?.[0];

console.log("Instance ARN:      ", instance?.instanceArn);
// arn:aws:sso:::instance/ssoins-0a1b2c3d4e5f6a7b
console.log("Identity Store ID: ", instance?.identityStoreId);
// d-1234567890

// Store both — every subsequent admin call needs instanceArn,
// every identity store call needs identityStoreId
const INSTANCE_ARN    = instance!.instanceArn!;
const IDENTITY_STORE  = instance!.identityStoreId!;

The home region is where you enabled IAM Identity Center. All SSOAdminClient and IdentityStoreClient calls must target this region, regardless of which region your MCP server runs in.

Identity sources

The identity store holds users and groups. Where those users and groups come from is determined by the identity source:

IAM Identity Center directory (built-in)
Users and groups live entirely in the identity store. You create them via the console or the IdentityStoreClient API (covered below). Best for teams without an existing IdP — no directory infrastructure to maintain.
AWS Managed Microsoft AD
IdC connects to an AD domain (via AWS Directory Service) and syncs users and groups on a schedule. You cannot create users via the IdentityStoreClient — they're read-only, managed by AD. Use this when your org has Windows workstations and AD logins already.
External SAML 2.0 / OIDC IdP
Okta, Azure AD, Google Workspace, Ping, and similar providers connect via automatic provisioning (SCIM) or manual sync. Users log in via the external IdP's authentication, then access AWS accounts through the IdC portal. The identity store still holds a copy of users/groups, but they're read-only from the IdC side.

For programmatic MCP server access, the identity source choice matters: if you use the built-in directory, you can create service accounts via the API. If you use an external IdP, service accounts must be provisioned in the external system and synced to IdC.

Managing users with IdentityStoreClient

When using the built-in directory, create and query users programmatically:

import {
  IdentityStoreClient,
  CreateUserCommand,
  GetUserIdCommand,
  DescribeUserCommand,
  ListUsersCommand,
} from "@aws-sdk/client-identitystore";

const store = new IdentityStoreClient({ region: "us-east-1" });

// Create a user (built-in directory only)
const created = await store.send(new CreateUserCommand({
  IdentityStoreId: IDENTITY_STORE,
  UserName: "alice@example.com",
  Name: {
    GivenName: "Alice",
    FamilyName: "Example",
  },
  DisplayName: "Alice Example",
  Emails: [{
    Value: "alice@example.com",
    Type: "work",
    Primary: true,
  }],
}));
console.log("User ID:", created.UserId);
// 12345678-aaaa-bbbb-cccc-123456789012

// Look up a user by their email (unique attribute)
const lookup = await store.send(new GetUserIdCommand({
  IdentityStoreId: IDENTITY_STORE,
  AlternateIdentifier: {
    UniqueAttribute: {
      AttributePath: "emails.value",
      AttributeValue: "alice@example.com",
    },
  },
}));
console.log("User ID:", lookup.UserId);

The DescribeUserCommand returns all stored attributes. ListUsersCommand paginates over users with optional filters:

// List all users (paginate via NextToken)
const resp = await store.send(new ListUsersCommand({
  IdentityStoreId: IDENTITY_STORE,
  Filters: [{
    AttributePath: "UserName",
    AttributeValue: "@example.com",  // partial match not supported — exact match only
  }],
}));
for (const user of resp.Users ?? []) {
  console.log(user.UserId, user.UserName, user.DisplayName);
}

Note: filters are exact matches, not wildcards. To list all users, omit the Filters array and paginate using NextToken.

Managing groups

Groups are the preferred principal type for account assignments — assign a group to an account, then add/remove users from the group rather than updating per-account assignments.

import {
  CreateGroupCommand,
  GetGroupIdCommand,
  CreateGroupMembershipCommand,
  ListGroupMembershipsCommand,
  DeleteGroupMembershipCommand,
} from "@aws-sdk/client-identitystore";

// Create a group
const group = await store.send(new CreateGroupCommand({
  IdentityStoreId: IDENTITY_STORE,
  DisplayName: "mcp-platform-engineers",
  Description: "Engineers with access to MCP server production accounts",
}));
console.log("Group ID:", group.GroupId);

// Add a user to the group
const membership = await store.send(new CreateGroupMembershipCommand({
  IdentityStoreId: IDENTITY_STORE,
  GroupId: group.GroupId!,
  MemberId: { UserId: created.UserId! },
}));
console.log("Membership ID:", membership.MembershipId);
// Keep this ID to remove the member later

// List group members
const members = await store.send(new ListGroupMembershipsCommand({
  IdentityStoreId: IDENTITY_STORE,
  GroupId: group.GroupId!,
}));
for (const m of members.GroupMemberships ?? []) {
  console.log(m.MembershipId, m.MemberId?.UserId);
}

// Remove a user from the group
await store.send(new DeleteGroupMembershipCommand({
  IdentityStoreId: IDENTITY_STORE,
  MembershipId: membership.MembershipId!,
}));

The SSO portal URL

Once IdC is enabled, your organization gets a portal URL in the form https://d-{random}.awsapps.com/start. You can customize the first segment in the IdC console (once per lifetime). Users bookmark this URL to sign in and see their assigned accounts and roles. The same URL is used by the OIDC device authorization flow in programmatic access — you pass it as startUrl to StartDeviceAuthorizationCommand.

To retrieve the portal URL programmatically:

import { DescribeInstanceCommand } from "@aws-sdk/client-sso-admin";

const desc = await ssoAdmin.send(new DescribeInstanceCommand({
  InstanceArn: INSTANCE_ARN,
}));
console.log("Portal URL:", desc.portalUrl);
// https://d-1234567890.awsapps.com/start

MFA enforcement

IAM Identity Center supports two MFA device types: TOTP authenticator apps (Google Authenticator, Authy) and FIDO2 security keys (YubiKey, Touch ID). MFA policy is set at the instance level and applies to all sign-ins via the portal. Options:

MFA policy is configured in the console or via the console API (not currently exposed in the SDK). For security-conscious MCP server teams, set MFA to Required and document the enrollment flow for new team members.

Programmatic access via the OIDC device authorization flow does not use MFA in the traditional sense — the user authenticates in the browser during the device authorization step, which does enforce MFA if required.

CloudTrail events from IAM Identity Center

IAM Identity Center publishes management events to CloudTrail under two event sources:

For compliance and incident response, search CloudTrail for eventSource = sso.amazonaws.com AND eventName = Authenticate to audit who logged in when. The userIdentity.type field is Unknown for IdC-authenticated sign-ins — this is expected and differs from IAM user sign-ins. The actual IdC username appears in requestParameters.context.user.

Delegated administrator for IdC

By default, only the management account can call the SSOAdminClient and IdentityStoreClient APIs. For teams that do not want to run automation in the management account, register a delegated administrator account:

import { RegisterDelegatedAdministratorCommand } from "@aws-sdk/client-organizations";
import { OrganizationsClient } from "@aws-sdk/client-organizations";

// Called from the management account
const orgs = new OrganizationsClient({ region: "us-east-1" });
await orgs.send(new RegisterDelegatedAdministratorCommand({
  AccountId: "234567890123",   // the account that will manage IdC
  ServicePrincipal: "sso.amazonaws.com",
}));

After registration, the delegated admin account can call all SSOAdmin and IdentityStore API operations — with one exception: it cannot call EnableOrganizationsAccess or modify the IdC instance itself. For MCP server platform automation, running provisioning scripts from a dedicated platform account (delegated admin) rather than the management account is the recommended pattern. See the AWS Organizations delegated admin guide for the full pattern.