google-workspace-mcp-server
Read and manage Gmail messages, threads, labels, and drafts, including listing, fetching, and creating emails.
Read-only access to Google Calendar events, calendars, and free/busy availability information.
Read, create, and edit Google Docs documents, including inserting and formatting text, images, and tables.
Manage Google Drive files: list, search, copy, and download files, as well as manage comments and replies.
Read, write, create, and format Google Sheets spreadsheets, including cell values, ranges, and sheet operations.
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-servercreate a new Google Doc titled 'Meeting Notes'"
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
MCP server for Google Workspace APIs - Docs, Sheets, Drive, Gmail, and Calendar. Use it with Claude Code to read, create, and edit Google Docs and Sheets, manage comments, read emails, and view calendar events.
Quick Start
Get your Google credentials (see Setup below)
Add to your Claude Code config (
~/.claude.json):
{
"mcpServers": {
"google-workspace": {
"type": "stdio",
"command": "npx",
"args": ["google-workspace-mcp-server"],
"env": {
"GOOGLE_CLIENT_ID": "your-client-id",
"GOOGLE_CLIENT_SECRET": "your-client-secret",
"GOOGLE_REFRESH_TOKEN": "your-refresh-token"
}
}
}
}Restart Claude Code
Setup
Step 1: Create a Google Cloud Project
Go to Google Cloud Console
Click the project dropdown (top left) → New Project
Name it something like "MCP Server" → Create
Wait for the project to be created, then select it
Step 2: Enable the APIs
Go to APIs & Services → Library (or click here)
Search for and enable each of these APIs:
Google Docs API → Click → Enable
Google Sheets API → Click → Enable
Google Drive API → Click → Enable
Gmail API → Click → Enable
Google Calendar API → Click → Enable
Step 3: Configure OAuth Consent Screen
Go to APIs & Services → OAuth consent screen
Select user type:
Internal (only if you have Google Workspace) - simpler, no test user setup needed
External (for personal Gmail accounts) - requires adding yourself as a test user
Click Create
Fill in the required fields:
App name: "MCP Server" (or anything)
User support email: your email
Developer contact email: your email
Click Save and Continue
On Scopes page, click Save and Continue (no changes needed)
On Test users page (External only): click Add Users → add your Google email → Save and Continue
Click Back to Dashboard
Step 4: Create OAuth Credentials
Go to APIs & Services → Credentials
Click Create Credentials → OAuth client ID
Application type: Web application
Name: "MCP Server" (or anything)
Under Authorized redirect URIs, click Add URI and enter:
https://developers.google.com/oauthplaygroundClick Create
Copy and save your Client ID and Client Secret - you'll need these!
Step 5: Get Your Refresh Token
Go to OAuth 2.0 Playground
Click the gear icon (⚙️) in the top right corner
Check "Use your own OAuth credentials"
Enter your Client ID and Client Secret from Step 4
Close the settings
In the left panel, find and select these scopes:
Google Docs API v1 →
https://www.googleapis.com/auth/documentsGoogle Sheets API v4 →
https://www.googleapis.com/auth/spreadsheetsGoogle Drive API v3 →
https://www.googleapis.com/auth/driveGmail API v1 →
https://www.googleapis.com/auth/gmail.readonlyGmail API v1 →
https://www.googleapis.com/auth/gmail.compose(for creating drafts)Google Calendar API v3 →
https://www.googleapis.com/auth/calendar.readonly
Click Authorize APIs
Sign in with your Google account and grant permissions
If you see "Google hasn't verified this app", click Advanced → Go to MCP Server (unsafe)
Click Continue to grant permissions
Click Exchange authorization code for tokens
Copy the Refresh Token (not the Access Token!) - this is what you need!
Step 6: Configure Claude Code
Add the MCP server to your Claude Code settings. Edit ~/.claude.json:
{
"mcpServers": {
"google-workspace": {
"type": "stdio",
"command": "npx",
"args": ["google-workspace-mcp-server"],
"env": {
"GOOGLE_CLIENT_ID": "123456789-abcdefg.apps.googleusercontent.com",
"GOOGLE_CLIENT_SECRET": "GOCSPX-xxxxxxxxxxxxx",
"GOOGLE_REFRESH_TOKEN": "1//04xxxxxxxxxxxxx"
}
}
}
}Replace the values with your actual credentials from Steps 4 and 5.
Step 7: Restart Claude Code
Restart Claude Code to load the new MCP server. You should now be able to use Google Workspace tools!
Tools
Google Docs API
Tool | Description |
| Get document content by ID |
| Create a new document |
| Insert/update/delete text, formatting, images, tables |
Google Sheets API
Tool | Description |
| Get spreadsheet metadata |
| Read cell values from a range |
| Read from multiple ranges |
| Write values to a range |
| Append rows to a table |
| Create a new spreadsheet |
| Apply formatting, charts, filters |
| Clear cell values from a range |
| Duplicate a sheet within a spreadsheet |
Google Drive API
Tool | Description |
| Download file content (PDFs, images, etc.) |
| List files in your Drive |
| Search for files by name or content |
| Create a copy of a file |
| List comments on a document |
| Add a comment (anchored or unanchored) |
| Reply to an existing comment |
| Mark comment as resolved |
| Delete a comment |
Gmail API
Tool | Description |
| List messages with optional search filters |
| Get full content of a specific message |
| List conversation threads |
| Get all messages in a thread |
| List all Gmail labels (folders) |
| Create an email draft (not sent automatically) |
| List attachments in a message |
| Download an attachment |
Google Calendar API (Read-Only)
Tool | Description |
| List all accessible calendars |
| List events with time range and search filters |
| Get detailed event information |
| Check free/busy availability for calendars |
Usage Examples
Once configured, you can ask Claude Code things like:
"Read my Google Doc at https://docs.google.com/document/d/abc123/edit"
"Read this PDF from my Drive: https://drive.google.com/file/d/xyz789/view"
"Create a new Google Doc with meeting notes from today"
"Add a row to my spreadsheet with today's data"
"Search my Drive for files about project planning"
"Show me the comments on this document"
"Reply to John's comment saying I'll fix it tomorrow"
"Show me my unread emails"
"Find emails from notifications@github.com"
"What's on my calendar today?"
"Show me my meetings for this week"
"Get the details of that standup meeting"
Troubleshooting
"Access token expired" errors
The MCP server automatically refreshes tokens using your refresh token. If you see this error, your refresh token may have been revoked. Go through Step 5 again to get a new one.
"App not verified" warning
This is normal for personal projects. Click Advanced → Go to [App Name] (unsafe) to proceed.
"Insufficient permissions" errors
Make sure you enabled all five APIs (Docs, Sheets, Drive, Gmail, Calendar) in Step 2, and selected all five scopes in Step 5.
Environment Variables
Variable | Description |
| OAuth 2.0 Client ID from Google Cloud Console |
| OAuth 2.0 Client Secret |
| Refresh token from OAuth Playground |
Development
# Clone the repo
git clone https://github.com/nityeshaga/google-workspace-mcp-server.git
cd google-workspace-mcp-server
# Install dependencies
npm install
# Build
npm run build
# Run locally
npm startLicense
MIT
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
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/EveryInc/google-workspace-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server