Google Workspace MCP Server
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 recent Google Docs"
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
English | Simplified Chinese | Traditional Chinese
A comprehensive MCP (Model Context Protocol) server providing full Google Workspace integration - including Google Docs, Sheets, Drive, Gmail, Calendar, and Apps Script APIs. Compatible with Claude Code CLI, Cursor IDE, and other MCP-compatible clients.
Unique Feature: This is the only Google Workspace MCP server that supports Apps Script API - enabling AI-driven automation of Google Sheets, Docs, and other Workspace products.

Features
This server provides 72 tools across 6 Google Workspace services:
Service | Tools | Description |
Google Docs | 15 | Read, write, format, style, images, tables, comments |
Google Sheets | 14 | Read, write, format, create spreadsheets, manage sheets |
Google Drive | 16 | List, search, create, move, copy, delete files and folders |
Gmail | 15 | Search, read, send, drafts, labels, filters, threads |
Google Calendar | 8 | List calendars, events, create, update, delete, free/busy |
Apps Script | 4 | Create and manage bound scripts for automation |
Google Docs (15 tools)
Document Operations:
readGoogleDoc,appendToGoogleDoc,insertText,deleteRange,listDocumentTabsFormatting:
applyTextStyle,applyParagraphStyle,formatMatchingText,fixListFormattingStructure:
insertTable,editTableCell,insertPageBreak,findElementImages:
insertImageFromUrl,insertLocalImage
Google Docs Comments (6 tools)
Comment Management:
listComments,getComment,addComment,replyToComment,resolveComment,deleteComment
Google Sheets (14 tools)
Data Operations:
readSpreadsheet,writeSpreadsheet,appendSpreadsheetRows,clearSpreadsheetRangeSheet Management:
getSpreadsheetInfo,addSpreadsheetSheet,createSpreadsheet,listGoogleSheetsFormatting:
formatSpreadsheetCells,setBasicFilter,clearBasicFilter
Google Drive (16 tools)
Discovery:
listGoogleDocs,searchGoogleDocs,getRecentGoogleDocs,getDocumentInfoFolders:
createFolder,listFolderContents,getFolderInfoFile Operations:
moveFile,copyFile,renameFile,deleteFileCreation:
createDocument,createFromTemplate
Apps Script (4 tools)
Script Management:
createBoundScript,updateScriptContent,getScriptContent,getScriptProjects
Gmail (15 tools)
Messages:
searchGmailMessages,getGmailMessage,getGmailMessagesBatch,getGmailAttachmentSend & Draft:
sendGmailMessage,createGmailDraftThreads:
getGmailThreadLabels:
listGmailLabels,createGmailLabel,deleteGmailLabel,modifyGmailMessageLabelsFilters:
listGmailFilters,createGmailFilter,deleteGmailFilterManagement:
trashGmailMessage
Google Calendar (8 tools)
Calendars:
listCalendarsEvents:
getCalendarEvents,getCalendarEvent,createCalendarEvent,updateCalendarEvent,deleteCalendarEventQuick Actions:
quickAddCalendarEventAvailability:
getCalendarFreeBusy
Prerequisites
Node.js v18+ with npm
Git for cloning the repository
Google Account with access to Google Workspace
MCP-compatible client: Claude Code CLI, Cursor IDE, or other MCP clients
Quick Start
Option A: Interactive Setup Wizard (Recommended)
git clone https://github.com/sputnicyoji/google-docs-mcp-for-claudecode.git
cd google-docs-mcp-for-claudecode
npm install
npm run setupThe setup wizard will:
Check your environment (Node.js, npm, build)
Auto-build TypeScript if needed
Guide you through credential setup
Run OAuth authorization
Generate and optionally auto-update Claude Code CLI config
Option B: Manual Setup
1. Clone and Install
git clone https://github.com/sputnicyoji/google-docs-mcp-for-claudecode.git
cd google-docs-mcp-for-claudecode
npm install
npm run build2. Google Cloud Setup
Go to Google Cloud Console
Create a new project or select an existing one
Enable the following APIs:
Google Docs API
Google Sheets API
Google Drive API
Apps Script API
Gmail API
Google Calendar API
Configure OAuth consent screen:
Select "External" user type
Add required scopes:
documents,spreadsheets,drive.file,script.projects,gmail,calendarAdd your email as a test user
Create OAuth credentials:
Go to Credentials > Create Credentials > OAuth client ID
Select "Desktop app"
Download the JSON file and save as
credentials.jsonin the project root
3. Authenticate
node ./dist/server.jsFollow the URL in the terminal to authorize access. After authorization, a token.json will be created.
4. Configure Claude Code CLI
Add to your Claude Code MCP configuration:
Windows (%APPDATA%\Claude\mcp_config.json):
{
"mcpServers": {
"google-workspace": {
"command": "node",
"args": ["C:\\path\\to\\google-docs-mcp-for-claudecode\\dist\\server.js"]
}
}
}macOS/Linux (~/.config/Claude/mcp_config.json):
{
"mcpServers": {
"google-workspace": {
"command": "node",
"args": ["/path/to/google-docs-mcp-for-claudecode/dist/server.js"]
}
}
}5. Configure Cursor IDE (Alternative)
This MCP server is fully compatible with Cursor IDE.
Project-Level Configuration - Create .cursor/mcp.json in your project root:
{
"mcpServers": {
"google-workspace": {
"command": "node",
"args": ["/path/to/google-docs-mcp-for-claudecode/dist/server.js"]
}
}
}Global Configuration - Or configure via Cursor Settings > MCP.
Note: Cursor must be in Agent Mode (not Ask Mode) to access MCP tools.
Service Account Authentication (Alternative)
For automated/server environments, you can use a service account:
Create a service account in Google Cloud Console
Download the JSON key file
Set environment variable:
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.jsonShare your Google Docs/Sheets with the service account email
Usage Examples
Google Docs
Read document 1abc...xyz and return as markdown
Append "Meeting Notes" to document 1abc...xyz
Apply bold formatting to text "Important" in document 1abc...xyz
Insert a 3x4 table at index 100 in document 1abc...xyzGoogle Sheets
Read range A1:D10 from spreadsheet 1abc...xyz
Write data to range A1:B5 in spreadsheet 1abc...xyz
Create a new spreadsheet titled "Sales Report 2024"
Add a new sheet named "Summary" to spreadsheet 1abc...xyzGoogle Drive
List all Google Docs in my Drive
Search for documents containing "Project Alpha"
Create a new folder named "2024 Reports"
Move file 1abc...xyz to folder 2def...uvwApps Script
Create a bound script for spreadsheet 1abc...xyz
Update script content with custom functions
Get content of script project 1abc...xyzGmail
Search for unread emails from john@example.com
Read email message with ID abc123
Send an email to jane@example.com with subject "Meeting"
Create a draft reply to thread xyz789
List all Gmail labels
Create a filter to label emails from support@example.comGoogle Calendar
List all my calendars
Get events for this week from my primary calendar
Create a meeting titled "Team Standup" tomorrow at 10am
Quick add event "Lunch with Sarah on Friday at noon"
Check free/busy times for next Monday
Delete event abc123 from my calendarProject Structure
google-docs-mcp-for-claudecode/
src/
server.ts # Main MCP server (tool definitions)
clients.ts # Google API client management
auth.ts # OAuth 2.0 / Service Account authentication
types.ts # TypeScript type definitions
helpers/
markdown.ts # Docs to Markdown conversion
index.ts # Helper re-exports
tools/
scriptTools.ts # Apps Script tools
gmailTools.ts # Gmail tools
calendarTools.ts # Calendar tools
index.ts # Tool registry
googleDocsApiHelpers.ts # Docs API helpers
googleSheetsApiHelpers.ts # Sheets API helpers
gmailApiHelpers.ts # Gmail API helpers
calendarApiHelpers.ts # Calendar API helpers
dist/ # Compiled JavaScript
credentials.json # OAuth credentials (not committed)
token.json # Auth token (not committed)Security Notes
Never commit
credentials.jsonortoken.jsonto version controlThe
.gitignorefile is configured to exclude sensitive filesFor production, consider using secret management services
Service account keys should be stored securely
Known Limitations
Comment Anchoring: Programmatically created comments may show "original content deleted" instead of anchoring to specific text
Converted Documents: Some documents converted from other formats (e.g., Word) may not support all API operations
Quota Limits: Google APIs have usage quotas - check Google Cloud Console for limits
Troubleshooting
Connection Issues
Verify the path in
mcp_config.jsonis absolute and correctEnsure
npm run buildcompleted successfullyTest manually:
node ./dist/server.js
Authentication Errors
Verify all required APIs are enabled
Check that your email is added as a test user
Delete
token.jsonand re-authenticate if scopes changed
Tab/Sheet Errors
Use
listDocumentTabsorgetSpreadsheetInfoto verify IDsEnsure you're using correct ID formats
Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Submit a pull request
Credits
Based on a-bonus/google-docs-mcp with additional enhancements:
Google Apps Script API integration
Gmail and Google Calendar API integration
Service Account authentication support
Modular code architecture
Multi-language documentation
License
MIT License - see LICENSE for details.
This server cannot be installed
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/sputnicyoji/google-workspace-mcp-with-script'
If you have feedback or need assistance with the MCP directory API, please join our Discord server