Google Workspace MCP Server
Search Gmail, retrieve email content, and list labels.
List calendars, search events, get event details, and query free/busy status.
Get full text content and heading outline of Google Docs.
Search files, read file content, and get file metadata.
Get spreadsheet metadata and read cell ranges, including batch reads.
Search presentations, get presentation metadata and slide overview, and retrieve slide content.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Google Workspace MCP Serverlist my unread emails from today"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Google Workspace MCP Server
A read-only MCP server that provides access to Google Workspace APIs — Gmail, Drive, Sheets, Docs, Slides, Calendar, and Admin Directory. It uses a GCP service account with domain-wide delegation to impersonate workspace users.
Prerequisites
Node.js 18+
A Google Cloud project with a service account that has domain-wide delegation enabled
The service account's JSON key file downloaded locally
Required API Scopes
When configuring domain-wide delegation in your Google Workspace Admin Console, grant the service account these scopes:
https://www.googleapis.com/auth/gmail.readonly
https://www.googleapis.com/auth/drive.readonly
https://www.googleapis.com/auth/admin.directory.user.readonly
https://www.googleapis.com/auth/spreadsheets.readonly
https://www.googleapis.com/auth/documents.readonly
https://www.googleapis.com/auth/calendar.readonly
https://www.googleapis.com/auth/presentations.readonlyRelated MCP server: Google Drive MCP Server
Google Cloud Setup
1. Create a GCP Project
Go to the Google Cloud Console
Click Select a project > New Project
Name it (e.g.,
workspace-mcp-server) and click CreateSelect the newly created project
2. Enable APIs
Enable the following APIs in APIs & Services > Library (or click the links below):
For each one, click Enable.
3. Create a Service Account
Go to IAM & Admin > Service Accounts
Click Create Service Account
Give it a name (e.g.,
workspace-mcp) and click Create and ContinueSkip the optional "Grant this service account access" and "Grant users access" steps — click Done
Click on the newly created service account
Go to the Keys tab
Click Add Key > Create new key > JSON and click Create
Save the downloaded JSON key file somewhere secure (e.g.,
~/.config/gcp/service-account-key.json)
Warning: This key file grants access to your Workspace data. Never commit it to version control.
4. Enable Domain-Wide Delegation
On the service account details page, click Show Advanced Settings
Under Domain-wide delegation, click Enable Google Workspace Domain-wide Delegation
Note the Client ID (a numeric string) — you'll need it in the next step
5. Grant Scopes in Google Workspace Admin
Go to the Google Workspace Admin Console
Navigate to Security > Access and data control > API controls
Click Manage Domain Wide Delegation
Click Add new
Enter the Client ID from step 4
In the OAuth scopes field, paste all seven scopes (comma-separated):
https://www.googleapis.com/auth/gmail.readonly,https://www.googleapis.com/auth/drive.readonly,https://www.googleapis.com/auth/admin.directory.user.readonly,https://www.googleapis.com/auth/spreadsheets.readonly,https://www.googleapis.com/auth/documents.readonly,https://www.googleapis.com/auth/calendar.readonly,https://www.googleapis.com/auth/presentations.readonlyClick Authorize
Note: The
admin.directory.user.readonlyscope requires the impersonated user to be a Workspace admin. The other scopes work for any user in the domain.
Installation
git clone git@github.com:obe711/google-workspace-mcp.git
cd google-workspace-mcp
npm install
npm run buildConfiguration
Copy the example environment file:
cp .env.example .envEdit
.envand set:GOOGLE_SERVICE_ACCOUNT_KEY_PATH— Absolute path to your service account JSON key fileGW_USER_EMAIL— The default Google Workspace email to impersonate whenuserEmailis not passed to a tool (e.g.,you@yourdomain.com)
GOOGLE_SERVICE_ACCOUNT_KEY_PATH=/Users/me/keys/service-account-key.json GW_USER_EMAIL=you@yourdomain.com
Note:
.envis git-ignored and will not be committed. Never commit your service account key file.
Usage with Claude Code
1. Register the MCP server
Add the server to your Claude Code MCP config (project-level .mcp.json or global ~/.claude/mcp.json):
{
"mcpServers": {
"google-workspace": {
"command": "node",
"args": ["build/index.js"],
"cwd": "/absolute/path/to/google-workspace-mcp"
}
}
}The server reads all configuration from the .env file — no env overrides are needed in the MCP config.
2. Use the /gw skill
Once configured, use the /gw slash command in Claude Code:
/gw search my recent emails about project updates
/gw find spreadsheets modified this week
/gw read the Q4 budget document
/gw list workspace usersAvailable Tools
Tool | Description |
| Search Gmail using Gmail query syntax |
| Get full content of an email by message ID |
| List all Gmail labels |
| Search Google Drive files |
| Read the content of a Drive file |
| Get metadata for a Drive file |
| Get spreadsheet metadata (sheets, dimensions) |
| Read cell values from a spreadsheet range |
| Read multiple spreadsheet ranges at once |
| Get full text content of a Google Doc |
| Get heading outline of a Google Doc |
| List Google Workspace users (requires admin) |
| List all calendars a user has access to |
| Search/list calendar events in a date range |
| Get full details of a calendar event |
| Query free/busy status for one or more users |
| Search for Google Slides presentations |
| Get presentation metadata and slide overview |
| Get full text content of a single slide |
Development
npm run dev # Watch mode — recompiles on changes
npm run build # One-time build
npm start # Run the serverThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/obe711/google-workspace-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server