workspace-admin-mcp
An admin-oriented Model Context Protocol server for Google Workspace that lets LLMs perform directory and user lifecycle operations with safety guardrails and audit logging.
README
workspace-admin-mcp
An admin-oriented Model Context Protocol server for Google Workspace. It lets an LLM (Claude, or any MCP client) perform directory/admin operations — user lifecycle and group management — through natural language, with safety guardrails and full audit logging.
Most Workspace MCP servers are end-user focused (my Gmail, my Drive). This one is built for the admin — the person who onboards, offboards, and manages groups for the whole domain via the Admin SDK.
Why
Running Workspace admin at scale means living in the Admin SDK and tools like GAM: bulk operations, offboarding runbooks, group cleanups. Those are exactly the tasks an LLM is good at describing — but you can't hand an assistant the keys to suspend accounts without guardrails. This server is the safe middle layer:
- Read-only by default. Write tools refuse unless you explicitly opt in.
- Dry-run by default. Even with writes enabled, actions are simulated until you pass
dry_run=false. - Audited. Every call — read, refused, simulated, or applied — emits a structured JSON audit line.
Tools
| Tool | Type | Description |
|---|---|---|
workspace_list_users |
read | List users; supports Admin SDK search (isSuspended=true, orgUnitPath=/Sales, …) |
workspace_get_user |
read | Get one user's directory profile |
workspace_list_groups |
read | List groups, or the groups a user belongs to |
workspace_list_group_members |
read | List a group's members |
workspace_suspend_user |
guarded write | Suspend/restore a user (core offboarding step) |
workspace_add_group_member |
guarded write | Add a member to a group |
workspace_remove_group_member |
guarded write | Remove a member from a group |
Architecture
Claude / MCP client ──MCP──▶ workspace-admin-mcp ──▶ Google Admin SDK ──▶ Workspace
│
guardrails ──▶ audit log (JSON, stderr)
Full diagram and design notes in docs/architecture.md.
Quickstart (local)
git clone https://github.com/pizzacrustreviewer/GWS-MCP.git
cd workspace-admin-mcp
pip install -e ".[dev]"
pytest -q # tests run with no credentials (in-memory fake client)
Run it against a real tenant
You need a Google Cloud service account with domain-wide delegation authorized for the directory scopes, and a Workspace admin to impersonate. Use a personal or developer tenant — never production/corporate.
cp .env.example .env # fill in the values, then:
export $(grep -v '^#' .env | xargs)
workspace-admin-mcp # starts on stdio for a local MCP client
Connect from Claude Desktop
{
"mcpServers": {
"workspace-admin": {
"command": "workspace-admin-mcp",
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "/absolute/path/service-account.json",
"WORKSPACE_ADMIN_SUBJECT": "admin@yourdomain.com",
"WORKSPACE_READ_ONLY": "true"
}
}
}
}
Configuration
| Env var | Default | Meaning |
|---|---|---|
GOOGLE_APPLICATION_CREDENTIALS |
— | Path to the DWD service-account key JSON |
WORKSPACE_ADMIN_SUBJECT |
— | Admin user to impersonate |
WORKSPACE_CUSTOMER_ID |
my_customer |
Resolves to the admin's own domain |
WORKSPACE_READ_ONLY |
true |
When true, all writes are refused |
WORKSPACE_DRY_RUN |
true |
When true, enabled writes are simulated |
MCP_TRANSPORT |
stdio |
stdio locally, streamable-http on Cloud Run |
Deploy (optional)
The repo ships a Dockerfile and reference Terraform for Cloud Run (private ingress, least-privilege runtime SA, key mounted from Secret Manager). See terraform/. This is reference IaC — it only runs if you apply it against a project you own.
docker build -t workspace-admin-mcp .
Security
- Writes off by default; dry-run by default; explicit opt-in for both.
- Least-privilege scopes (read scopes only unless writes are enabled).
- No credentials in the image or repo;
.gitignoreblocks key files. - Structured audit trail suitable for shipping to Cloud Logging.
Roadmap & limitations
This is v0.1 — the logic is complete and unit-tested; the live Admin SDK layer, pagination, and HTTP-transport auth are the next steps. See ROADMAP.md.
License
MIT — see LICENSE.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.