MCPcopy Index your code
hub / github.com/a-bonus/google-docs-mcp

github.com/a-bonus/google-docs-mcp @v1.11.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.11.0 ↗ · + Follow
391 symbols 1,293 edges 175 files 7 documented · 2% updated 10d agov1.11.0 · 2026-06-10★ 60514 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Google Docs, Sheets, Drive, Gmail & Calendar MCP Server

Demo Animation

Connect Claude Desktop, Cursor, or any MCP client to your Google Docs, Google Sheets, Google Drive, Gmail, and Google Calendar.


Quick Start

1. Create a Google Cloud OAuth Client

  1. Go to the Google Cloud Console
  2. Create or select a project
  3. Enable the Google Docs API, Google Sheets API, Google Drive API, Gmail API, and Google Calendar API
  4. Configure the OAuth consent screen (External, add your email as a test user, and add the gmail.modify and calendar.events scopes alongside the Docs/Sheets/Drive scopes)
  5. Create an OAuth client ID (Desktop app type)
  6. Copy the Client ID and Client Secret from the confirmation screen

Need more detail? See step-by-step instructions at the bottom of this page.

2. Authorize

GOOGLE_CLIENT_ID="your-client-id" \
GOOGLE_CLIENT_SECRET="your-client-secret" \
npx -y @a-bonus/google-docs-mcp auth

This opens your browser for Google authorization. After you approve, the refresh token is saved to ~/.config/google-docs-mcp/token.json.

3. Add to Your MCP Client

Claude Desktop / Cursor / Windsurf:

{
  "mcpServers": {
    "google-docs": {
      "command": "npx",
      "args": ["-y", "@a-bonus/google-docs-mcp"],
      "env": {
        "GOOGLE_CLIENT_ID": "your-client-id",
        "GOOGLE_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}

The server starts automatically when your MCP client needs it.

Remote Deployment (Cloud Run)

Deploy once for your team -- no local installs required. The server uses MCP OAuth 2.1 so your MCP client handles authentication automatically.

gcloud run deploy google-docs-mcp \
  --source . \
  --region europe-west3 \
  --port 8080 \
  --allow-unauthenticated \
  --set-env-vars "^|^MCP_TRANSPORT=httpStream|BASE_URL=https://your-service.run.app|GOOGLE_CLIENT_ID=...|GOOGLE_CLIENT_SECRET=...|TOKEN_STORE=firestore|JWT_SIGNING_KEY=your-secret-key"

Then each user just adds the URL to their MCP client -- no npx, no tokens, no local setup:

{
  "mcpServers": {
    "google-docs": {
      "type": "streamableHttp",
      "url": "https://your-service.run.app/mcp"
    }
  }
}

Your MCP client will prompt for Google sign-in on first connection. See Remote Deployment for details.


What Can It Do?

Tools across Google Docs, Sheets, and Drive:

Google Docs

Tool Description
readDocument Read content as plain text, JSON, or markdown
appendText Append text to a document
insertText Insert text at a specific position
deleteRange Remove content by index range
modifyText Replace, prepend, or transform text in a document
findAndReplace Find and replace text across a document
listTabs List all tabs in a multi-tab document
addTab Add a new tab to a document
renameTab Rename a document tab
replaceDocumentWithMarkdown Replace entire document content from markdown
replaceRangeWithMarkdown Replace a specific range with markdown content
appendMarkdown Append markdown-formatted content
applyTextStyle Bold, italic, colors, font size, links
applyParagraphStyle Alignment, spacing, indentation
insertTable Create an empty table
insertTableWithData Create a table pre-filled with data
insertPageBreak Insert page breaks
insertSectionBreak Insert section break (NEXT_PAGE or CONTINUOUS)
updateSectionStyle Update section style: flip orientation, margins
insertImage Insert images from URLs or local files

Comments

Tool Description
listComments View all comments with author and date
getComment Get a specific comment with replies
addComment Create a comment anchored to text
replyToComment Reply to an existing comment
resolveComment Mark a comment as resolved
deleteComment Remove a comment

Google Sheets

Tool Description
readSpreadsheet Read data from a range (A1 notation)
writeSpreadsheet Write data to a range
batchWrite Write to multiple ranges in one call
appendRows Add rows to a sheet
clearRange Clear cell values
createSpreadsheet Create a new spreadsheet
addSheet Add a sheet/tab
deleteSheet Remove a sheet/tab
duplicateSheet Duplicate a sheet within the same spreadsheet
copySheetTo Copy a sheet into another spreadsheet
renameSheet Rename a sheet/tab
getSpreadsheetInfo Get metadata and sheet list
listSpreadsheets Find spreadsheets
formatCells Bold, colors, alignment, vertical alignment, wrap strategy on ranges
copyFormatting Copy formatting from one range to another
readCellFormat Read formatting details of a cell range
setCellBorders Set per-side borders (top/bottom/left/right/inner) with style & color
freezeRowsAndColumns Pin header rows/columns
setDropdownValidation Add/remove dropdown lists on cells
setColumnWidths Set column widths in pixels
setRowHeights Set row heights in pixels
autoResizeColumns Auto-fit column widths to content
autoResizeRows Auto-fit row heights to content
protectRange Lock a range or entire sheet (warning-only or fully locked)
addConditionalFormatting Add a conditional formatting rule
getConditionalFormatting List conditional formatting rules with their index (JSON)
deleteConditionalFormatting Delete conditional formatting rules by index
groupRows Group rows for collapsible sections
ungroupAllRows Remove all row groupings
createSheetsComment Create a spreadsheet comment, optionally with a direct cell link
createSheetsCellNote Create a native cell note attached to a cell or range
insertChart Create a chart from data
deleteChart Remove a chart

Google Sheets Tables

Tool Description
createTable Create a new named table with column types
listTables List all tables in a spreadsheet or sheet
getTable Get detailed table metadata by name or ID
deleteTable Delete a table (optionally clear data)
updateTableRange Modify table dimensions (add/remove rows/cols)
appendTableRows Append rows to a table (table-aware insertion)

Google Drive

Tool Description
listDocuments List documents, optionally filtered by date
searchDocuments Search by name or content
getDocumentInfo Get document metadata
createDocument Create a new document
createDocumentFromTemplate Create from an existing template
createFolder Create a folder
listFolderContents List folder contents
getFolderInfo Get folder metadata
moveFile Move a file to another folder
copyFile Duplicate a file
renameFile Rename a file
deleteFile Move to trash or permanently delete
listDriveFiles List any file type in Drive with filters
searchDriveFiles Search all Drive files by name or content
downloadFile Download a file's content

Gmail

Tool Description
listMessages List or search messages using Gmail query syntax (is:unread, from:, newer_than:, etc.)
getMessage Fetch a single message with decoded headers, plain-text body, HTML body, and attachment metadata
sendEmail Send a plain-text email. Supports cc/bcc and threaded replies via replyToMessageId
trashMessage Move a message to Trash (reversible, same as clicking Delete in the Gmail UI)
modifyMessageLabels Add or remove labels on a message — use to star, archive (remove INBOX), mark read (remove UNREAD)
listLabels List all system and custom labels with their IDs
createDraft Compose a draft instead of sending immediately — for compose/review/send workflows
listDrafts List existing drafts with recipient, subject, and snippet
getDraft Fetch a single draft with full headers and body
updateDraft Replace the contents of an existing draft (full replace, not patch)
sendDraft Send an existing draft by ID
deleteDraft Permanently delete a draft (not moved to Trash — gone)
triageInbox Composite: fetch unread messages with content + heuristic flags (newsletter, meeting, action) for one-shot inbox triage

Google Calendar

Tool Description
listEvents List or search events with q, timeMin, timeMax, maxResults (defaults to primary calendar)
createEvent Create an event with title, start/end, description, location, attendees, optional Google Meet link
updateEvent PATCH-style update — only the fields you pass change. Use to reschedule, retitle, change attendees
deleteEvent Permanently delete an event. Optional sendUpdates emails cancellations to attendees
quickAddEvent Natural-language event creation: "Lunch with Sarah tomorrow 12pm" — Google parses the rest

Usage Examples

Google Docs

``` "Read document ABC123 as markdown" "Append 'Meeting notes for today' to document ABC123" "Make the text 'Importan

Extension points exported contracts — how you extend this code

BatchUpdateMetadata (Interface)
(no doc)
src/googleDocsApiHelpers.ts
PendingDownload (Interface)
(no doc)
src/downloadProxy.ts
RequestClients (Interface)
(no doc)
src/remoteWrapper.ts
MimeMessageOptions (Interface)
(no doc)
src/tools/gmail/helpers.ts
ExtractOptions (Interface)
(no doc)
src/markdown-transformer/index.ts
TabWithLevel (Interface)
(no doc)
src/googleDocsApiHelpers.ts
DraftRequestArgs (Interface)
(no doc)
src/tools/gmail/helpers.ts
InsertOptions (Interface)
(no doc)
src/markdown-transformer/index.ts

Core symbols most depended-on inside this repo

get
called by 71
src/firestoreTokenStorage.ts
convertMarkdownToRequests
called by 64
src/markdown-transformer/markdownToDocs.ts
getSheetsClient
called by 41
src/clients.ts
getDocsClient
called by 40
src/clients.ts
findHeaderValue
called by 29
src/tools/gmail/helpers.ts
docsJsonToMarkdown
called by 28
src/markdown-transformer/docsToMarkdown.ts
getDriveClient
called by 24
src/clients.ts
escapeDriveQuery
called by 20
src/driveQueryUtils.ts

Shape

Function 346
Interface 32
Method 7
Class 6

Languages

TypeScript100%

Modules by API surface

src/googleDocsApiHelpers.ts35 symbols
src/markdown-transformer/markdownToDocs.ts34 symbols
src/googleSheetsApiHelpers.ts26 symbols
src/tools/docs/structureHelpers.ts19 symbols
src/tools/gmail/helpers.ts12 symbols
src/markdown-transformer/docsToMarkdown.ts12 symbols
src/auth.ts11 symbols
src/tools/sheets/comments/createSheetsComment.ts9 symbols
src/types.ts8 symbols
src/firestoreTokenStorage.ts8 symbols
src/clients.ts8 symbols
src/logger.ts7 symbols

For agents

$ claude mcp add google-docs-mcp \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page