连接器指南阅读约 8 分钟45 个 MCP 工具7 种语言

如何通过 MCP 将 Google Workspace Admin 连接到 ChatGPT

面向 AI 智能体的 Google Workspace 管理:用户(创建、更新、暂停、退出登录)、别名、群组和成员、组织部门、管理员角色和分配、ChromeOS 与移动设备、域名,以及审核日志和使用情况报告。通过 OAuth2 和管理员账户使用 Admin SDK;删除用户、群组、成员、别名和角色分配在安装时关闭。

HC作者:HelpCode 团队更新于 8 分钟阅读 在 GitHub 开源

无需信用卡 · 7 天试用 · 提供自托管方案

Google Workspace Admin

Google Workspace Admin

Google Workspace administration for AI agents: users (create, update, suspend, sign out), aliases, groups and members, organizational units, admin roles and assignments, ChromeOS and mobile devices, domains, plus audit logs and usage reports. Admin SDK, OAuth2, admin account required.

个工具

45

区域

INTL

类别

效率工具

身份验证

OAuth 2.0

所需环境变量

GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRET
在 Cloud 上一键安装

7 天免费试用 · 无需信用卡

  • 7 天免费试用
    无需信用卡
  • 符合 GDPR,SOC 2 就绪
    数据驻留欧盟,审计日志
  • 在 GitHub 开源
    开源 · AGPL-3.0
  • 支持 ChatGPT、Claude、Gemini
    任何兼容 MCP 的客户端

跳过安装。2 分钟内即可运行。

在 cloud.anythingmcp.com 开始免费试用,一键添加 Google Workspace Admin,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。

开始免费试用

摘要

面向 AI 智能体的 Google Workspace 管理:用户(创建、更新、暂停、退出登录)、别名、群组和成员、组织部门、管理员角色和分配、ChromeOS 与移动设备、域名,以及审核日志和使用情况报告。通过 OAuth2 和管理员账户使用 Admin SDK;删除用户、群组、成员、别名和角色分配在安装时关闭。

试试这样问

Google Workspace Admin 的示例提示

点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。

Google Workspace Admin · 通过 MCP 实时
分享
Opus 4.7

Claude 是 AI,可能会出错。请核对回答。

💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Google Workspace Admin、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无 git clone、无本地服务器。

Google Workspace Admin + ChatGPT

面向 AI 智能体的 Google Workspace 管理:用户(创建、更新、暂停、退出登录)、别名、群组和成员、组织部门、管理员角色和分配、ChromeOS 与移动设备、域名,以及审核日志和使用情况报告。通过 OAuth2 和管理员账户使用 Admin SDK;删除用户、群组、成员、别名和角色分配在安装时关闭。

前提条件

完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:

GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET

步骤 1 — 获取凭证

设置大约需要 10 分钟。授权连接器的 Google 账户必须是某个 Google Workspace 或 Cloud Identity 账户的 Workspace 管理员;连接器始终在该账户(my_customer)上工作。

  1. 打开 https://console.cloud.google.com,选择或创建一个项目,进入 APIs & Services → Library,启用 Admin SDK API(它涵盖 Directory API 和 Reports API)。
  2. 打开 APIs & Services → OAuth consent screen,选择 Internal;项目必须属于同一个 Google Workspace 组织。如果选 External,请把发布状态设为 In production:应用处于 Testing 状态时,Google 会在 7 天后撤销其刷新令牌,连接器每周都会停止工作。
  3. 打开 APIs & Services → Credentials → Create credentials → OAuth client ID,应用类型选 Web application,添加已授权的重定向 URI <your AnythingMCP URL>/api/mcp-oauth/callback,在 AnythingMCP Cloud 上为 https://cloud.anythingmcp.com/api/mcp-oauth/callback。
  4. 把客户端 ID 粘贴到 GOOGLE_CLIENT_ID,客户端密钥粘贴到 GOOGLE_CLIENT_SECRET,然后安装连接器。
  5. 在连接器页面点击 Authorize with Provider,用管理员账户登录。刷新令牌加密保存,访问令牌会自动续期。
  6. 如果管理控制台限制了第三方应用(Security → Access and data control → API controls),请把这个 OAuth 客户端标记为 Trusted;否则登录会以 admin_policy_enforced 结束。
  7. 运行 google_admin_get_customer:它会显示客户 ID 和主域名,并确认连接正常。

一个 Google 客户端服务所有 Google 连接器:同一个 Cloud 项目和 OAuth 客户端可以服务所有 Google 连接器(Gmail、Google Calendar、Google Drive、Google Sheets、Search Console、Analytics、Ads、Admin)。在该项目中启用各个 API,复用 GOOGLE_CLIENT_ID 和 GOOGLE_CLIENT_SECRET,并为每个连接器授权一次;每个连接器只请求自己的 scope。

使用哪个管理员账户:超级管理员(Super Admin)可以使用所有工具。委派管理员可以在其角色覆盖的范围内使用,前提是该角色也具有相应的 Admin API privileges(管理控制台 → Account → Admin roles → 该角色 → Privileges → Admin API):用户和别名工具需要 Users,群组和成员需要 Groups,组织部门需要 Organization Units,审核和使用情况需要 Reports,设备需要 Services → Chrome OS 和 Mobile Device Management,域名需要 Domain Settings。角色和角色分配需要 Super Admin 或 Roles Management 权限。普通用户的每次调用都会得到 403 Not Authorized to access this resource/api。请使用一个专用管理员账户,并赋予能覆盖工作所需的最小角色。

Scope:admin.directory.user、admin.directory.user.security(退出登录)、admin.directory.group、admin.directory.orgunit 和 admin.directory.rolemanagement,ChromeOS 设备、移动设备、域名和客户的只读 scope,以及 admin.reports.audit.readonly 和 admin.reports.usage.readonly。如需只读设置,在连接器的 OAuth 设置中把前五个换成 admin.directory.user.readonly、admin.directory.group.readonly、admin.directory.orgunit.readonly 和 admin.directory.rolemanagement.readonly,去掉 admin.directory.user.security,重新授权,并停用所有创建、更新、添加、分配、暂停、退出登录和恢复类工具。

读取的内容:账户本身、其域名和别名域名。用户及其组织部门、是否为管理员、暂停状态、两步验证、上次登录、别名、职位、部门和经理,可用 isSuspended=true、orgUnitPath='/Sales'、isEnrolledIn2Sv=false、isAdmin=true 或 email:anna* 等查询搜索。群组及其成员、某个用户所属的群组,以及用户是直接还是通过嵌套群组成为成员。组织部门树。管理员角色及其权限,以及谁拥有哪个角色。受管理的 ChromeOS 和移动设备,可用 status:provisioned、user:[email protected] 或 sync:..2026-06-01(自该日起未同步)搜索。按应用划分的审核日志(login、admin、drive、token、groups、mobile、meet、gmail、calendar、chrome、saml、user_accounts 等),可按用户、时间和事件(如 login_failure 或 suspicious_login)筛选。账户整体和每个用户的每日使用统计,例如 accounts:last_login_time、accounts:used_quota_in_mb 或 gmail:num_emails_sent。

写入的内容:使用初始密码和 change_password_at_next_login 创建用户,更新其字段、密码、组织部门和经理,暂停和恢复用户,让用户退出所有网页和设备会话,恢复过去 20 天内删除的用户(仅限 Super Admin),以及添加别名(每个用户最多 30 个)。创建和更新群组,把用户、群组或外部地址添加为成员,并更改成员的角色或邮件接收设置。创建、重命名和移动组织部门。为用户或群组分配管理员角色,范围可以是整个账户或某个组织部门;只有 Super Admin 才能分配 Super Admin 角色。

安装时关闭:google_admin_delete_user、google_admin_delete_group、google_admin_remove_group_member、google_admin_delete_user_alias 和 google_admin_delete_role_assignment。这些操作无法撤销(删除的用户只能在 20 天内恢复,群组则永远无法恢复),所以由管理员在团队需要时开启。

数据格式:user_key 接受主邮箱、别名或不可变的 id。在工具路径中,组织部门写作不带前导斜杠的形式(Sales/EMEA)或 id:<orgUnitId>;在 org_unit_path 等用户字段中则带斜杠(/Sales/EMEA)。google_admin_assign_role 和 google_admin_undelete_user 需要不可变 ID,而不是邮箱。google_admin_update_user 只修改发送的字段,但 organizations、phones 和 relations 等列表会被整体替换,所以 AI 会先读取该用户。时间为 UTC 的 RFC 3339 格式,lastLoginTime 为 1970-01-01T00:00:00.000Z 表示从未登录;域名的 creationTime 是纪元毫秒数。使用情况报告的 date 采用太平洋时间的 YYYY-MM-DD,数据会延迟 1-3 天:日期太近时会返回 PARTIAL_DATA_AVAILABLE 或 DATA_NOT_AVAILABLE,此时往前推一天。

分页和限制:列表类工具返回 nextPageToken;AI 会带上 page_token 再次调用,直到它不再出现。每页最多 500 个用户、200 个群组或成员、300 台 ChromeOS 设备、100 台移动设备,以及 1,000 条活动或用户使用记录。审核日志从新到旧返回,多数可追溯约 6 个月,事件需要几分钟到几小时才会出现。Google 按项目和用户限制每分钟的查询数:返回 403 quotaExceeded、rateLimitExceeded 或 429 时,请等一分钟后重试。新建的用户和群组可能需要几分钟才可见。

常见错误:401 表示授权已过期或被撤销(同意屏幕处于 Testing 时每 7 天必然发生):再次点击 Authorize with Provider。403 Not Authorized to access this resource/api 表示登录的账户不是管理员,或其角色缺少该领域的 Admin API 权限。403 Request had insufficient authentication scopes 表示更改 scope 后需要重新授权。403 "Admin SDK API has not been used in project" 表示 API 未启用(第 1 步)。404 Resource Not Found: userKey 表示用户、别名或 ID 不存在。409 Entity already exists 表示邮箱、别名或成员已被占用。400 Invalid Input 通常表示邮箱域名不属于该账户,或密码过短或过长(8-100 个字符)。

该连接器不读取 Gmail 或云端硬盘内容(由 Gmail 和 Google Drive 连接器负责),不更改谁可以发帖或加入等群组设置(Groups Settings API),不管理许可证,不锁定或清除设备,也不在员工离职时转移数据。删除用户会同时删除其邮件和文件,除非事先已在管理控制台中转移。

步骤 2 — 安装 adapter

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

步骤 3 — 在 ChatGPT 中添加连接器

你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(https://cloud.anythingmcp.com/mcp/…)。本指南中出现 YOUR_SERVER_ID 的地方都用它替换。

ChatGPT 在网页版的 Plugins 页面把 MCP 服务器添加为插件,仅付费套餐可用,不再需要开发者模式。在 Business 工作区中只有管理员和所有者可以添加;在 Enterprise 和 Edu 中,管理员可以授予 Create plugins with MCPs 权限。

  1. 前往 chatgpt.com/plugins,点击 Add,然后选择 Add custom MCP server。
  2. 填写名称,例如 Name: Google Workspace Admin。
  3. 在 Connection 下的 Server URL 中填入 https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID,Authentication 保持为 OAuth。
  4. 选择 I understand and want to continue,然后点击 Create as a plugin。ChatGPT 提示时,登录 AnythingMCP 并允许访问。
  5. 在个人插件中安装这个新插件,然后在对话中输入 @ 并选择它。

可用工具

ToolWhat it does
google_admin_get_customerRead the Google Workspace account itself: customer id (starts with C), primary domain, organization name and postal address, language…
google_admin_list_domainsList the domains of the Workspace account: the primary domain and every secondary domain, each with verified, isPrimary, creationTime…
google_admin_get_domainRead one domain of the account: whether it is verified and primary, when it was added, and its domain aliases
google_admin_list_domain_aliasesList domain aliases (domains that mirror another domain, so every user also receives mail at user@alias-domain), with their parent domain…
google_admin_list_usersList or search the users of the Workspace account (up to 500 per page): primaryEmail, name, id, orgUnitPath, isAdmin, suspended, archived…
google_admin_get_userRead one user's full admin view: name, primaryEmail, aliases, orgUnitPath, suspended and suspensionReason, isAdmin, isDelegatedAdmin…
google_admin_create_userCreate a user account in Google Workspace
google_admin_update_userChange fields of an existing user; fields left out stay as they are
google_admin_suspend_userSuspend a user: they can no longer sign in and stop receiving mail, but the account, its data and licenses stay
google_admin_unsuspend_userReactivate a suspended user so they can sign in again
google_admin_sign_out_userSign a user out of every web and device session and reset their sign-in cookies, e.g. after a lost laptop or a suspected compromise
google_admin_undelete_userRestore a user deleted in the last 20 days (super admin only)
google_admin_delete_userDelete a user account
google_admin_list_user_aliasesList a user's email aliases (extra addresses that deliver to the same mailbox)
google_admin_add_user_aliasAdd an email alias to a user, e.g. "[email protected]"
google_admin_delete_user_aliasRemove an email alias from a user; mail to that address bounces afterwards
google_admin_list_groupsList or search the groups of the Workspace account (up to 200 per page): email, name, description, directMembersCount, aliases, id
google_admin_list_user_groupsList the groups one user (or one group) is a direct member of
google_admin_get_groupRead one group: email, name, description, aliases, directMembersCount and whether an admin created it
google_admin_create_groupCreate a group (mailing list and access group) with an email on one of the account's domains
google_admin_update_groupChange a group's email, name or description; fields left out stay as they are
google_admin_delete_groupDelete a group with its membership list and archive; access granted through it to Drive files, calendars or apps ends
google_admin_list_group_membersList the members of a group (up to 200 per page): email, role (OWNER, MANAGER, MEMBER), type (USER, GROUP, CUSTOMER, EXTERNAL), status and…
google_admin_get_group_memberRead one member of a group: role, type, status and delivery setting. 404 means the address is not a direct member
google_admin_has_group_memberCheck whether a user is a member of a group, directly or through nested groups
google_admin_add_group_memberAdd a user, another group or an external address to a group. 409 "Member already exists" means it is already in
google_admin_update_group_memberChange a group member's role (OWNER, MANAGER, MEMBER) or their mail delivery setting
google_admin_remove_group_memberRemove a member from a group; access granted through the group ends at once
google_admin_list_org_unitsList organizational units (the tree that settings and policies apply to): name, orgUnitPath, orgUnitId, parentOrgUnitPath, description
google_admin_get_org_unitRead one organizational unit: name, path, id, parent and description
google_admin_create_org_unitCreate an organizational unit under a parent unit, e.g. "EMEA" under "/Sales"
google_admin_update_org_unitRename an organizational unit, change its description or move it under another parent (its users and sub-units move with it)
google_admin_list_rolesList the admin roles of the account, prebuilt (Super Admin, Groups Admin, User Management Admin, Help Desk Admin...) and custom: roleId…
google_admin_get_roleRead one admin role with its full list of privileges (serviceId and privilegeName)
google_admin_list_role_assignmentsList who holds which admin role: roleAssignmentId, roleId, assignedTo (a user or group id), assigneeType, scopeType (CUSTOMER = whole…
google_admin_get_role_assignmentRead one admin role assignment by its id: role, assignee id and type, scope and org unit
google_admin_assign_roleGive a user or group an admin role, for the whole account or one organizational unit. assigned_to is the user's or group's immutable id…
google_admin_delete_role_assignmentTake an admin role away from a user or group by deleting the role assignment
google_admin_list_chromeos_devicesList managed ChromeOS devices (Chromebooks, Chromeboxes, kiosks; up to 300 per page): deviceId, serialNumber, model, status (ACTIVE…
google_admin_get_chromeos_deviceRead one ChromeOS device by its deviceId: hardware, OS and firmware versions, enrolment, last sync and user, network addresses, auto-update…
google_admin_list_mobile_devicesList mobile devices (Android and iOS phones and tablets) that sync with Google Workspace (up to 100 per page): resourceId, email, name…
google_admin_get_mobile_deviceRead one mobile device by its resourceId: owner, model, OS version, status, compromised status, encryption, first and last sync and the…
google_admin_list_activitiesAudit log: who did what and when in one Google Workspace application, newest first (up to 1,000 per page)
google_admin_get_customer_usageAccount-wide usage statistics for one day: active users, licenses, Gmail volume, Drive storage, Meet minutes, 2SV adoption, etc
google_admin_get_user_usagePer-user usage statistics for one day: last login, emails sent and received, Drive storage used, 2SV enrolment, Meet calls, etc. user_key…

示例提示

  • “哪些用户还没有启用两步验证?按组织部门分组列出。”
  • “在 /Sales/EMEA 中为 Jane Doe 创建 [email protected],设置临时密码,并把她加入 [email protected]。”
  • “现在谁拥有管理员角色?分别是什么角色?”
  • “显示最近 7 天内登录失败和可疑登录的记录。”
  • “暂停 [email protected],并让他退出所有会话。”

FAQ

ChatGPT 免费套餐能用自定义 MCP 服务器吗? OpenAI 只为付费套餐提供自定义 MCP 服务器的说明,Free 套餐不在其列。

下一步

这份指南对你有帮助吗?

你的 Google Workspace Admin 智能体只差一次点击。

安装连接器,粘贴密钥,向 ChatGPT 提问。免费试用 7 天,无需信用卡。

相关指南

连接器

如何通过 MCP 将 Google Workspace Admin 连接到 Claude

面向 AI 智能体的 Google Workspace 管理:用户(创建、更新、暂停、退出登录)、别名、群组和成员、组织部门、管理员角色和分配、ChromeOS 与移动设备、域名,以及审核日志和使用情况报告。通过 OAuth2 和管理员账户使用 Admin SDK;删除用户、群组、成员、别名和角色分配在安装时关闭。

连接器

如何通过 MCP 将 Google Workspace Admin 连接到 Cursor

面向 AI 智能体的 Google Workspace 管理:用户(创建、更新、暂停、退出登录)、别名、群组和成员、组织部门、管理员角色和分配、ChromeOS 与移动设备、域名,以及审核日志和使用情况报告。通过 OAuth2 和管理员账户使用 Admin SDK;删除用户、群组、成员、别名和角色分配在安装时关闭。

连接器

如何通过 MCP 将 Google Workspace Admin 连接到 Gemini

面向 AI 智能体的 Google Workspace 管理:用户(创建、更新、暂停、退出登录)、别名、群组和成员、组织部门、管理员角色和分配、ChromeOS 与移动设备、域名,以及审核日志和使用情况报告。通过 OAuth2 和管理员账户使用 Admin SDK;删除用户、群组、成员、别名和角色分配在安装时关闭。

连接器

如何通过 MCP 将 Google Workspace Admin 连接到 Meta Muse

面向 AI 智能体的 Google Workspace 管理:用户(创建、更新、暂停、退出登录)、别名、群组和成员、组织部门、管理员角色和分配、ChromeOS 与移动设备、域名,以及审核日志和使用情况报告。通过 OAuth2 和管理员账户使用 Admin SDK;删除用户、群组、成员、别名和角色分配在安装时关闭。

连接器

Google Workspace Admin 接入 MCP:在任意 AI 智能体中管理用户、群组、组织部门、管理员角色、设备和审核日志

面向 AI 智能体的 Google Workspace 管理:用户(创建、更新、暂停、退出登录)、别名、群组和成员、组织部门、管理员角色和分配、ChromeOS 与移动设备、域名,以及审核日志和使用情况报告。通过 OAuth2 和管理员账户使用 Admin SDK;删除用户、群组、成员、别名和角色分配在安装时关闭。

连接器

如何通过 MCP 将 Google Workspace Admin 连接到 Microsoft Copilot

面向 AI 智能体的 Google Workspace 管理:用户(创建、更新、暂停、退出登录)、别名、群组和成员、组织部门、管理员角色和分配、ChromeOS 与移动设备、域名,以及审核日志和使用情况报告。通过 OAuth2 和管理员账户使用 Admin SDK;删除用户、群组、成员、别名和角色分配在安装时关闭。