Skip to content

Commit 9dc4620

Browse files
Add Google Groups support
1 parent 5a2e1f3 commit 9dc4620

11 files changed

Lines changed: 924 additions & 0 deletions

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,21 @@ Saved files expire after 1 hour and are cleaned up automatically.
10451045
| `manage_contacts_batch` | Complete | Batch create, update, or delete contacts |
10461046
| `manage_contact_group` | Complete | Create, update, delete groups, or modify membership |
10471047

1048+
</td>
1049+
<td width="50%" valign="top">
1050+
1051+
### 👥 **Google Groups** <sub>[`groups_tools.py`](ggroups/groups_tools.py)</sub>
1052+
1053+
| Tool | Tier | Description |
1054+
|------|------|-------------|
1055+
| `search_groups` | **Core** | Search groups with CEL queries |
1056+
| `get_group` | **Core** | Retrieve group details |
1057+
| `list_group_members` | **Core** | List members of a group |
1058+
| `manage_group` | **Core** | Create, update, or delete groups |
1059+
| `manage_group_members` | Extended | Add, remove, or modify member roles |
1060+
| `list_groups` | Complete | List all groups under a customer |
1061+
| `lookup_group` | Complete | Look up group resource name by email |
1062+
10481063
</td>
10491064
</tr>
10501065
<tr>

auth/permissions.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
TASKS_READONLY_SCOPE,
4747
CONTACTS_SCOPE,
4848
CONTACTS_READONLY_SCOPE,
49+
GROUPS_SCOPE,
50+
GROUPS_READONLY_SCOPE,
4951
CUSTOM_SEARCH_SCOPE,
5052
SCRIPT_PROJECTS_SCOPE,
5153
SCRIPT_PROJECTS_READONLY_SCOPE,
@@ -105,6 +107,10 @@
105107
("readonly", [CONTACTS_READONLY_SCOPE]),
106108
("full", [CONTACTS_SCOPE]),
107109
],
110+
"groups": [
111+
("readonly", [GROUPS_READONLY_SCOPE]),
112+
("full", [GROUPS_SCOPE]),
113+
],
108114
"search": [
109115
("readonly", [CUSTOM_SEARCH_SCOPE]),
110116
("full", [CUSTOM_SEARCH_SCOPE]),

auth/scopes.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@
6666
CONTACTS_SCOPE = "https://www.googleapis.com/auth/contacts"
6767
CONTACTS_READONLY_SCOPE = "https://www.googleapis.com/auth/contacts.readonly"
6868

69+
# Google Groups (Cloud Identity) scopes
70+
GROUPS_SCOPE = "https://www.googleapis.com/auth/cloud-identity.groups"
71+
GROUPS_READONLY_SCOPE = (
72+
"https://www.googleapis.com/auth/cloud-identity.groups.readonly"
73+
)
74+
6975
# Google Custom Search API scope
7076
CUSTOM_SEARCH_SCOPE = "https://www.googleapis.com/auth/cse"
7177

@@ -98,6 +104,7 @@
98104
SLIDES_SCOPE: {SLIDES_READONLY_SCOPE},
99105
TASKS_SCOPE: {TASKS_READONLY_SCOPE},
100106
CONTACTS_SCOPE: {CONTACTS_READONLY_SCOPE},
107+
GROUPS_SCOPE: {GROUPS_READONLY_SCOPE},
101108
CHAT_WRITE_SCOPE: {CHAT_READONLY_SCOPE},
102109
CHAT_SPACES_SCOPE: {CHAT_SPACES_READONLY_SCOPE},
103110
FORMS_BODY_SCOPE: {FORMS_BODY_READONLY_SCOPE},
@@ -173,6 +180,8 @@ def has_required_scopes(available_scopes, required_scopes):
173180

174181
CONTACTS_SCOPES = [CONTACTS_SCOPE, CONTACTS_READONLY_SCOPE]
175182

183+
GROUPS_SCOPES = [GROUPS_SCOPE, GROUPS_READONLY_SCOPE]
184+
176185
CUSTOM_SEARCH_SCOPES = [CUSTOM_SEARCH_SCOPE]
177186

178187
SCRIPT_SCOPES = [
@@ -197,6 +206,7 @@ def has_required_scopes(available_scopes, required_scopes):
197206
"slides": SLIDES_SCOPES,
198207
"tasks": TASKS_SCOPES,
199208
"contacts": CONTACTS_SCOPES,
209+
"groups": GROUPS_SCOPES,
200210
"search": CUSTOM_SEARCH_SCOPES,
201211
"appscript": SCRIPT_SCOPES,
202212
}
@@ -213,6 +223,7 @@ def has_required_scopes(available_scopes, required_scopes):
213223
"slides": [SLIDES_READONLY_SCOPE],
214224
"tasks": [TASKS_READONLY_SCOPE],
215225
"contacts": [CONTACTS_READONLY_SCOPE],
226+
"groups": [GROUPS_READONLY_SCOPE],
216227
"search": CUSTOM_SEARCH_SCOPES,
217228
"appscript": [
218229
SCRIPT_PROJECTS_READONLY_SCOPE,

auth/service_decorator.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
TASKS_READONLY_SCOPE,
5151
CONTACTS_SCOPE,
5252
CONTACTS_READONLY_SCOPE,
53+
GROUPS_SCOPE,
54+
GROUPS_READONLY_SCOPE,
5355
CUSTOM_SEARCH_SCOPE,
5456
SCRIPT_PROJECTS_SCOPE,
5557
SCRIPT_PROJECTS_READONLY_SCOPE,
@@ -414,6 +416,7 @@ def _remove_user_email_arg_from_docstring(docstring: str) -> str:
414416
"people": {"service": "people", "version": "v1"},
415417
"customsearch": {"service": "customsearch", "version": "v1"},
416418
"script": {"service": "script", "version": "v1"},
419+
"cloudidentity": {"service": "cloudidentity", "version": "v1"},
417420
}
418421

419422

@@ -457,6 +460,9 @@ def _remove_user_email_arg_from_docstring(docstring: str) -> str:
457460
# Contacts scopes
458461
"contacts": CONTACTS_SCOPE,
459462
"contacts_read": CONTACTS_READONLY_SCOPE,
463+
# Groups (Cloud Identity) scopes
464+
"groups": GROUPS_SCOPE,
465+
"groups_read": GROUPS_READONLY_SCOPE,
460466
# Custom Search scope
461467
"customsearch": CUSTOM_SEARCH_SCOPE,
462468
# Apps Script scopes

core/tool_tiers.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,18 @@ contacts:
144144
- manage_contacts_batch
145145
- manage_contact_group
146146

147+
groups:
148+
core:
149+
- search_groups
150+
- get_group
151+
- list_group_members
152+
- manage_group
153+
extended:
154+
- manage_group_members
155+
complete:
156+
- list_groups
157+
- lookup_group
158+
147159
search:
148160
core:
149161
- search_custom

fastmcp_server.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ def format(self, record):
148148
import gforms.forms_tools
149149
import gslides.slides_tools
150150
import gtasks.tasks_tools
151+
import ggroups.groups_tools
151152
import gsearch.search_tools
152153

153154
# Configure tool registration
@@ -164,6 +165,7 @@ def format(self, record):
164165
"forms",
165166
"slides",
166167
"tasks",
168+
"groups",
167169
"search",
168170
]
169171
set_enabled_tools(all_services) # Set enabled services for scopes

ggroups/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"""
2+
Google Groups MCP Integration (Cloud Identity API)
3+
4+
This module provides MCP tools for interacting with Google Groups
5+
via the Cloud Identity Groups API.
6+
"""

0 commit comments

Comments
 (0)