From 0289b61df475d84ba55d793f23c72ac57711aa27 Mon Sep 17 00:00:00 2001 From: adam jones Date: Wed, 1 Oct 2025 00:59:04 +0100 Subject: [PATCH] Add catch-all email group and platform filtering (#3) - Add catch-all email group with admin-adam@modelcontextprotocol.io - Add onlyOnPlatforms configuration to restrict groups to specific platforms - Set antitrust and catch-all groups to Google only - Groups default to all platforms when onlyOnPlatforms is not specified --- src/config/groups.ts | 10 ++++++++++ src/config/users.ts | 4 ++++ src/config/utils.ts | 4 ++++ src/github.ts | 3 +++ src/google.ts | 3 +++ 5 files changed, 24 insertions(+) diff --git a/src/config/groups.ts b/src/config/groups.ts index 6cf782a..c336f3a 100644 --- a/src/config/groups.ts +++ b/src/config/groups.ts @@ -5,6 +5,9 @@ import { defineGroups } from './utils'; // // Email groups (isEmailGroup: true) accept emails from anyone (including external users) // and notify group members for each email. +// +// Groups are created on all platforms (GitHub and Google) by default. +// To limit a group to specific platforms, set the onlyOnPlatforms array (e.g., onlyOnPlatforms: ['google']). export const GROUPS = defineGroups([ { name: 'test-parent', @@ -24,5 +27,12 @@ export const GROUPS = defineGroups([ name: 'antitrust', description: 'Antitrust compliance contacts', isEmailGroup: true, + onlyOnPlatforms: ['google'], + }, + { + name: 'catch-all', + description: 'Catch-all email group', + isEmailGroup: true, + onlyOnPlatforms: ['google'], }, ] as const); \ No newline at end of file diff --git a/src/config/users.ts b/src/config/users.ts index 82b00fa..7eb78c4 100644 --- a/src/config/users.ts +++ b/src/config/users.ts @@ -6,6 +6,10 @@ export const MEMBERS: readonly Member[] = [ email: 'adam@modelcontextprotocol.io', memberOf: ['test-child'], }, + { + email: 'adamj@anthropic.com', + memberOf: ['catch-all'], + }, { email: 'davidsp@anthropic.com', memberOf: ['antitrust'], diff --git a/src/config/utils.ts b/src/config/utils.ts index 9c36942..241b86f 100644 --- a/src/config/utils.ts +++ b/src/config/utils.ts @@ -4,12 +4,15 @@ function isValidGroupName(name: string): boolean { return /^[a-z][a-z0-9-]*[a-z]$/.test(name); } +export type Platform = 'github' | 'google'; + export function defineGroups< const T extends readonly { name: Lowercase; description: string; memberOf?: readonly (T[number]['name'])[]; isEmailGroup?: boolean; + onlyOnPlatforms?: readonly Platform[]; }[] >(groups: T) { for (const group of groups) { @@ -30,6 +33,7 @@ export interface Group { description: string; memberOf?: readonly GroupKey[]; isEmailGroup?: boolean; + onlyOnPlatforms?: readonly Platform[]; } export interface Member { diff --git a/src/github.ts b/src/github.ts index f59c420..6ec40be 100644 --- a/src/github.ts +++ b/src/github.ts @@ -6,6 +6,9 @@ import { MEMBERS } from './config/users'; const teams: Record = {}; GROUPS.forEach((group: Group) => { + // Skip groups that don't include github in their platforms + if (group.onlyOnPlatforms && !group.onlyOnPlatforms.includes('github')) return; + teams[group.name] = new github.Team(group.name, { name: group.name, description: group.description + ' \n(Managed by github.com/modelcontextprotocol/access)', diff --git a/src/google.ts b/src/google.ts index 69363c6..e257ff1 100644 --- a/src/google.ts +++ b/src/google.ts @@ -6,6 +6,9 @@ import { MEMBERS } from './config/users'; const groups: Record = {}; GROUPS.forEach((group: Group) => { + // Skip groups that don't include google in their platforms + if (group.onlyOnPlatforms && !group.onlyOnPlatforms.includes('google')) return; + groups[group.name] = new gworkspace.Group(group.name, { email: `${group.name}@modelcontextprotocol.io`, name: group.name,