Mirror of https://github.com/modelcontextprotocol/access — Infrastructure as Code for MCP access management
  • TypeScript 99.1%
  • Makefile 0.8%
  • Nix 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
claude[bot] 5917af2589
Declare allowExternalMembers on managed groups so deploys stop re-arming the external-member purge (#140)
* Declare allowExternalMembers on managed group settings

Every pulumi up was resetting the Google Workspace per-group setting
ALLOW_EXTERNAL_MEMBERS to false on all managed groups, because the
GroupSettings resources never declared allowExternalMembers and the
provider (SamuZad/googleworkspace 0.11.1) defaults the field to false.
Google then silently purges external-email members from affected groups
roughly 1-2 days after each apply, with no audit events.

Pin the setting to true for all managed groups. External membership
itself remains governed exclusively by config/users.ts entries; this
setting only permits it.

Part of the #133 incident.

* Scope allowExternalMembers per group, derived from membership config

Instead of permitting external members on every managed group, derive
allowExternalMembers per group: true only for groups whose membership
config (config/users.ts) resolves at least one member to a
non-@modelcontextprotocol.io email. Email resolution is factored into
resolveGoogleMemberEmail and shared with GroupMember creation so the
two cannot drift. The field stays declared on every group because the
provider defaults it to false on each apply, after which Google
silently purges external members (#133 incident).

With current config, exactly these groups derive true: maintainers,
registry-wg, antitrust, catch-all. A config test pins this set so
changes to it are always deliberate.

* Make allowExternalMembers an explicit per-role opt-in with config validation

Replace the derived per-group allowExternalMembers (computed from
membership config) with an explicit opt-in: group owners set
allowExternalMembers: true on the role's google config in
src/config/roles.ts, and src/google.ts passes it straight through to
GroupSettings (defaulting to false). The field stays declared on every
group because the provider resets an omitted field to false on each
apply, after which Google silently purges external members (#133).

Roles opting in, matching current membership: maintainers,
registry-maintainers (registry-wg), antitrust, catch-all.

A validate-config check replaces the old pinned-set test: it fails with
an actionable error whenever a group has a member resolving to a
non-@modelcontextprotocol.io email but its role does not opt in, naming
the group, the member email, and the exact config line to add.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-03 01:19:16 +00:00
.github Repair corrupted GroupMember state so deploys stop failing (#139) 2026-07-02 15:12:31 -07:00
scripts Declare allowExternalMembers on managed groups so deploys stop re-arming the external-member purge (#140) 2026-07-03 01:19:16 +00:00
src Declare allowExternalMembers on managed groups so deploys stop re-arming the external-member purge (#140) 2026-07-03 01:19:16 +00:00
.gitignore Add Google Workspace user account provisioning (#66) 2026-02-19 22:17:25 +00:00
.pre-commit-config.yaml Add prettier formatting and CI validation checks 2025-12-13 10:01:28 +00:00
.prettierignore Add prettier formatting and CI validation checks 2025-12-13 10:01:28 +00:00
.prettierrc Add prettier formatting and CI validation checks 2025-12-13 10:01:28 +00:00
devenv.nix add devenv 2026-02-19 23:02:53 +00:00
Makefile fix(ci): reserialize dynamic providers before refresh 2026-03-21 20:41:55 +00:00
package-lock.json Add Discord API rate limit handling and bump @pulumi/github (#84) 2026-03-20 01:08:13 -07:00
package.json Add Google Workspace user account provisioning (#66) 2026-02-19 22:17:25 +00:00
Pulumi.prod.yaml remove unecessary delegation 2026-02-19 23:33:27 +00:00
Pulumi.yaml Repair corrupted GroupMember state so deploys stop failing (#139) 2026-07-02 15:12:31 -07:00
README.md Enable opt-in Google Workspace accounts for maintainers 2026-03-07 22:44:59 +00:00
tsconfig.json Add prettier formatting and CI validation checks 2025-12-13 10:01:28 +00:00

MCP Access Management

Infrastructure as Code for managing access to MCP community resources using Pulumi.

What This Manages

  • GitHub Teams: Automatically syncs team memberships in the MCP GitHub organization
  • Google Workspace Groups: Automatically syncs group memberships for @modelcontextprotocol.io email accounts
    • Email Groups: Groups with isEmailGroup: true accept emails from anyone (including external users) and notify all members. External posts are moderated for security.
  • Google Workspace User Accounts: Provisions @modelcontextprotocol.io accounts for members of roles with provisionUser: true

Opting in to a Google Workspace account (maintainers)

If you're a maintainer and want an @modelcontextprotocol.io account, open a PR adding the following fields to your entry in src/config/users.ts:

{
  github: 'your-github-username',
  // ...
  firstName: 'Your',
  lastName: 'Name',
  googleEmailPrefix: 'yourname', // -> yourname@modelcontextprotocol.io
  memberOf: [ROLE_IDS.MAINTAINERS /* , ... */],
},

Once merged, Pulumi provisions the account. An admin will share your initial password (retrievable via pulumi stack output --show-secrets newGWSUserPasswords).

Deployment

Production Deployment (Automated)

Note: Production deployment is automatically handled by GitHub Actions. All merges to the main branch trigger an automatic deployment via the configured GitHub Actions workflow.

Manual Deployment

Pre-requisites:

  1. Authenticate with GCP: gcloud auth application-default login
  2. Get the passphrase file passphrase.prod.txt from the maintainers
  3. Preview changes: make preview
  4. Deploy changes: make up

Key Management

Required GitHub Secrets (for CI/CD)

The following secrets must be configured in GitHub Actions for automated deployments:

  • GCP_PROD_SERVICE_ACCOUNT_KEY: GCP service account key

    • Used to authenticate with Google Cloud Storage for Pulumi state (gs://mcp-access-prod-pulumi-state)
    • Should be a JSON key file for a service account with Storage Admin permissions
    • See "Setting Up GCS Backend" below for setup instructions
  • PULUMI_PROD_PASSPHRASE: Passphrase for encrypting Pulumi state

    • Used to decrypt encrypted values in Pulumi stack configuration
    • Keep this secure - if lost, you cannot decrypt your Pulumi state

Initial Setup

If setting up this infrastructure for the first time:

1. Set Up Service Account

# Create project and enable APIs
gcloud projects create mcp-access-prod
gcloud config set project mcp-access-prod
gcloud services enable storage.googleapis.com
gcloud services enable admin.googleapis.com
gcloud services enable groupssettings.googleapis.com

# Create service account
gcloud iam service-accounts create pulumi-svc \
  --display-name="MCP Access Management Service Account" \
  --description="Service account for Pulumi state and Google Workspace management"

# Grant storage admin permissions (for Pulumi state)
gcloud projects add-iam-policy-binding mcp-access-prod \
  --member="serviceAccount:pulumi-svc@mcp-access-prod.iam.gserviceaccount.com" \
  --role="roles/storage.admin"

# Create key
gcloud iam service-accounts keys create sa-key.json \
  --iam-account=pulumi-svc@mcp-access-prod.iam.gserviceaccount.com

# Create GCS bucket for Pulumi state
gsutil mb gs://mcp-access-prod-pulumi-state

Then:

  1. In Google Workspace Admin Console, go to Account → Admin roles
  2. Select Groups Admin role (or create a custom role with these privileges):
    • Read, create, update, and delete groups
    • Read and update group members
  3. Click Assign service accounts
  4. Add your service account email: pulumi-svc@mcp-access-prod.iam.gserviceaccount.com

2. Initialize Pulumi Stack

# Login to Pulumi backend (GCS)
pulumi login gs://mcp-access-prod-pulumi-state

# Create production stack
export PULUMI_CONFIG_PASSPHRASE_FILE=passphrase.prod.txt
pulumi stack init prod

# Configure application secrets in Pulumi
pulumi config set --secret googleworkspace:credentials "$(cat sa-key.json)"
pulumi config set --secret github:token "ghp_your_github_token_here"

3. Configure GitHub Actions Secrets

Add the CI/CD secrets to GitHub Actions (repository settings → Secrets and variables → Actions):

  • GCP_PROD_SERVICE_ACCOUNT_KEY: Content of sa-key.json
  • PULUMI_PROD_PASSPHRASE: The passphrase you set above