Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/config/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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);
4 changes: 4 additions & 0 deletions src/config/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
4 changes: 4 additions & 0 deletions src/config/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>;
description: string;
memberOf?: readonly (T[number]['name'])[];
isEmailGroup?: boolean;
onlyOnPlatforms?: readonly Platform[];
}[]
>(groups: T) {
for (const group of groups) {
Expand All @@ -30,6 +33,7 @@ export interface Group {
description: string;
memberOf?: readonly GroupKey[];
isEmailGroup?: boolean;
onlyOnPlatforms?: readonly Platform[];
}

export interface Member {
Expand Down
3 changes: 3 additions & 0 deletions src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { MEMBERS } from './config/users';
const teams: Record<string, github.Team> = {};

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)',
Expand Down
3 changes: 3 additions & 0 deletions src/google.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { MEMBERS } from './config/users';
const groups: Record<string, gworkspace.Group> = {};

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,
Expand Down