Google Workspace MCP Server
Enables management of Google Workspace users, groups, aliases, and organizational units via natural language through the Model Context Protocol.
README
🔧 Google Workspace MCP Server
<!-- mcp-name: io.github.aringad/google-workspace-mcp -->
🇮🇹 Italiano | 🇬🇧 English
Italiano
Server MCP (Model Context Protocol) per gestire Google Workspace tramite Claude AI e altri assistenti compatibili. Permette di amministrare utenti, gruppi, alias e unità organizzative tramite conversazione naturale.
✨ Funzionalità
| Tool | Descrizione |
|---|---|
gw_list_users |
Lista utenti con ricerca e filtri |
gw_get_user |
Dettaglio completo di un utente |
gw_create_user |
Crea nuovo utente con password auto-generata |
gw_delete_user |
Elimina utente (con conferma obbligatoria) |
gw_suspend_user |
Sospendi o riattiva un utente |
gw_reset_password |
Reset password con generazione automatica |
gw_manage_alias |
Aggiungi, rimuovi, elenca alias email |
gw_list_groups |
Lista gruppi del dominio o di un utente |
gw_manage_group_member |
Aggiungi/rimuovi membri dai gruppi |
gw_list_org_units |
Lista unità organizzative |
gw_move_user_org |
Sposta utente tra unità organizzative |
📋 Prerequisiti
- Python 3.10+
- Account Google Workspace con accesso admin
- Progetto Google Cloud con Admin SDK API abilitata
- Claude Desktop o altro client MCP
🚀 Installazione
pip install google-workspace-mcp
Oppure da sorgente:
git clone https://github.com/aringad/google-workspace-mcp.git
cd google-workspace-mcp
pip install -r requirements.txt
🔑 Configurazione Google Cloud
1. Crea progetto e abilita API
- Vai su console.cloud.google.com
- Crea un nuovo progetto (o usa quello esistente)
- Vai su API e servizi → Libreria
- Cerca e abilita: Admin SDK API
2. Crea Service Account
- Vai su API e servizi → Credenziali
- Crea credenziali → Account di servizio
- Dai un nome (es.
mcp-workspace-admin) - Vai nel Service Account → Chiavi → Aggiungi chiave → JSON
- Scarica il file JSON (queste sono le tue credenziali)
- Annota il Client ID (numero lungo nei dettagli del Service Account)
⚠️ Non serve assegnare ruoli IAM al Service Account. I permessi vengono dalla delega domain-wide.
3. Delega Domain-Wide
- Vai su admin.google.com
- Sicurezza → Accesso e controllo dati → Controlli API → Gestisci delega a livello di dominio
- Clicca Aggiungi nuovo
- Inserisci il Client ID del Service Account
- Come ambiti OAuth, inserisci:
https://www.googleapis.com/auth/admin.directory.user,https://www.googleapis.com/auth/admin.directory.group,https://www.googleapis.com/auth/admin.directory.orgunit,https://www.googleapis.com/auth/admin.directory.user.alias
- Autorizza
⚙️ Variabili d'ambiente
| Variabile | Descrizione | Default |
|---|---|---|
GOOGLE_SERVICE_ACCOUNT_FILE |
Path al file JSON delle credenziali | ./credentials.json |
GOOGLE_ADMIN_EMAIL |
Email del super admin con delega | (obbligatorio) |
GOOGLE_CUSTOMER_ID |
Customer ID del dominio | my_customer |
🔌 Configurazione Claude Desktop
Aggiungi al file di configurazione:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"google_workspace": {
"command": "/percorso/completo/google-workspace-mcp/venv/bin/python",
"args": ["/percorso/completo/google-workspace-mcp/server.py"],
"env": {
"GOOGLE_SERVICE_ACCOUNT_FILE": "/percorso/completo/credentials.json",
"GOOGLE_ADMIN_EMAIL": "admin@tuodominio.it"
}
}
}
}
Chiudi completamente Claude Desktop (Cmd+Q su Mac) e riaprilo.
🏢 Configurazione multi-cliente
Puoi gestire più domini aggiungendo istanze separate:
{
"mcpServers": {
"gw_cliente_alfa": {
"command": "/percorso/venv/bin/python",
"args": ["server.py"],
"env": {
"GOOGLE_SERVICE_ACCOUNT_FILE": "/percorso/credentials-alfa.json",
"GOOGLE_ADMIN_EMAIL": "admin@alfa.it"
}
},
"gw_cliente_beta": {
"command": "/percorso/venv/bin/python",
"args": ["server.py"],
"env": {
"GOOGLE_SERVICE_ACCOUNT_FILE": "/percorso/credentials-beta.json",
"GOOGLE_ADMIN_EMAIL": "admin@beta.it"
}
}
}
}
💬 Esempi d'uso
Una volta configurato, puoi dire a Claude:
- "Mostrami tutti gli utenti del dominio"
- "Crea un nuovo utente mario.rossi@dominio.it, nome Mario Rossi"
- "Sospendi l'utente luigi@dominio.it"
- "Resetta la password di marco@dominio.it"
- "Aggiungi l'alias info@dominio.it all'utente segreteria@dominio.it"
- "Aggiungi mario@dominio.it al gruppo vendite@dominio.it"
- "In che unità organizzative è diviso il dominio?"
Puoi anche copiare direttamente l'email del cliente con la richiesta e Claude interpreterà automaticamente le operazioni da eseguire.
🔒 Sicurezza
- Le credenziali del Service Account non vanno mai committate nel repository
- Le password temporanee generate sono di 16 caratteri con lettere, numeri e simboli
- Le operazioni distruttive (eliminazione) richiedono conferma esplicita
- Il Service Account opera con i soli permessi strettamente necessari
- Nessun dato viene memorizzato dal server MCP
🧪 Test
# Verifica che il server parta
python server.py --help
# Test con MCP Inspector
npx @modelcontextprotocol/inspector python server.py
English
<a name="english"></a>
MCP (Model Context Protocol) Server to integrate Google Workspace Admin with Claude AI and other compatible assistants. Manage users, groups, aliases and organizational units through natural conversation.
✨ Features
| Tool | Description |
|---|---|
gw_list_users |
List users with search and filters |
gw_get_user |
Full user details |
gw_create_user |
Create new user with auto-generated password |
gw_delete_user |
Delete user (requires explicit confirmation) |
gw_suspend_user |
Suspend or reactivate a user |
gw_reset_password |
Reset password with automatic generation |
gw_manage_alias |
Add, remove, list email aliases |
gw_list_groups |
List domain or user groups |
gw_manage_group_member |
Add/remove group members |
gw_list_org_units |
List organizational units |
gw_move_user_org |
Move user between organizational units |
📋 Prerequisites
- Python 3.10+
- Google Workspace account with admin access
- Google Cloud project with Admin SDK API enabled
- Claude Desktop or another MCP client
🚀 Installation
pip install google-workspace-mcp
Or from source:
git clone https://github.com/aringad/google-workspace-mcp.git
cd google-workspace-mcp
pip install -r requirements.txt
🔑 Google Cloud Setup
1. Create project and enable API
- Go to console.cloud.google.com
- Create a new project (or use existing one)
- Go to APIs & Services → Library
- Search and enable: Admin SDK API
2. Create Service Account
- Go to APIs & Services → Credentials
- Create Credentials → Service Account
- Name it (e.g.,
mcp-workspace-admin) - Go to the Service Account → Keys → Add Key → JSON
- Download the JSON file (these are your credentials)
- Note the Client ID (long number in Service Account details)
⚠️ No IAM roles needed on the Service Account. Permissions come from domain-wide delegation.
3. Domain-Wide Delegation
- Go to admin.google.com
- Security → Access and data control → API controls → Manage Domain Wide Delegation
- Click Add new
- Enter the Service Account Client ID
- For OAuth scopes, enter:
https://www.googleapis.com/auth/admin.directory.user,https://www.googleapis.com/auth/admin.directory.group,https://www.googleapis.com/auth/admin.directory.orgunit,https://www.googleapis.com/auth/admin.directory.user.alias
- Authorize
⚙️ Environment Variables
| Variable | Description | Default |
|---|---|---|
GOOGLE_SERVICE_ACCOUNT_FILE |
Path to credentials JSON file | ./credentials.json |
GOOGLE_ADMIN_EMAIL |
Super admin email with delegation | (required) |
GOOGLE_CUSTOMER_ID |
Domain customer ID | my_customer |
🔌 Claude Desktop Configuration
Add to config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"google_workspace": {
"command": "/full/path/to/google-workspace-mcp/venv/bin/python",
"args": ["/full/path/to/google-workspace-mcp/server.py"],
"env": {
"GOOGLE_SERVICE_ACCOUNT_FILE": "/full/path/to/credentials.json",
"GOOGLE_ADMIN_EMAIL": "admin@yourdomain.com"
}
}
}
}
Fully quit Claude Desktop (Cmd+Q on Mac) and reopen it.
💬 Usage Examples
Once configured, you can tell Claude:
- "Show me all domain users"
- "Create a new user john.doe@domain.com, name John Doe"
- "Suspend user jane@domain.com"
- "Reset the password for mark@domain.com"
- "Add the alias info@domain.com to user secretary@domain.com"
- "Add john@domain.com to the sales@domain.com group"
- "What organizational units does the domain have?"
You can also paste client emails with requests directly — Claude will automatically interpret the operations to perform.
🔒 Security
- Service Account credentials must never be committed to the repository
- Temporary passwords are 16 characters with letters, numbers, and symbols
- Destructive operations (deletion) require explicit confirmation
- The Service Account operates with minimum necessary permissions
- No data is stored by the MCP server
🧪 Testing
# Verify server starts
python server.py --help
# Test with MCP Inspector
npx @modelcontextprotocol/inspector python server.py
📄 License
MIT License — See LICENSE for details.
👨💻 Author
Developed by Mediaform s.c.r.l. — Genova, Italy
Built with MCP and Google Admin SDK
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。