agentleFS
a-bonusa-bonus/google-docs-mcp/claude.md

google-docs-mcp

CLAUDE.md680 starsChanged 24 days agoMITView on GitHub

FastMCP server with 129 tools for Google Docs, Sheets, Drive, Gmail, Calendar, and Apps Script. appendTableRows is registered in both Docs and Sheets variants under the same name. The server supports Google Shared Drives. All Drive file operations (files.list, files.get, files.create, files.update, files.copy, files.delete, permissions.create) use supportsAllDrives: true and includeItemsFromAllDrives: true (for list operations), enabling agents to query, create, and update documents in shared drives.

The file

We split this claude.md into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Text targeting: Use textToFind + matchInstance OR startIndex/endIndex

    line 38
  2. Very specific:

    Retrieve: Use readGoogleDoc with format='markdown' to get document content as markdown

    line 48
  3. Very specific:

    Apply: Use replaceDocumentWithMarkdown or appendMarkdownToGoogleDoc to write changes back

    line 50

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
claude.md

Google Docs MCP Server

FastMCP server with 129 tools for Google Docs, Sheets, Drive, Gmail, Calendar, and Apps Script.

Tool Categories

CategoryCountExamples
Docs42readDocument, insertText, modifyText, applyTextStyle, insertTable, listComments, listSuggestions, manageSuggestions, ...
Drive19createDocument, searchDriveFiles, moveFile, createMarkdownFile, readMarkdownFile, updateMarkdownFile, ...
Sheets44readSpreadsheet, writeSpreadsheet, createTable, protectRange, addConditionalFormatting, insertChart, ...
Gmail13listMessages, getMessage, sendEmail, trashMessage, modifyMessageLabels, listLabels, createDraft, listDrafts, triageInbox
Calendar5listEvents, createEvent, updateEvent, deleteEvent, quickAddEvent
Apps Script3createAppsScriptProject, getAppsScriptContent, updateAppsScriptContent
Utils3appendMarkdown, replaceDocumentWithMarkdown, replaceRangeWithMarkdown

appendTableRows is registered in both Docs and Sheets variants under the same name.

Shared Drives Support

The server supports Google Shared Drives. All Drive file operations (files.list, files.get, files.create, files.update, files.copy, files.delete, permissions.create) use supportsAllDrives: true and includeItemsFromAllDrives: true (for list operations), enabling agents to query, create, and update documents in shared drives.

Known Limitations

  • Comment anchoring: Programmatically created comments appear in "All Comments" but aren't visibly anchored to text in the UI
  • Resolved status: May not persist in Google Docs UI (Drive API limitation)
  • fixListFormatting: Experimental, may not work reliably
  • Gmail hard delete: trashMessage only moves to Trash (reversible). Permanent deletion requires the full https://mail.google.com/ scope, which is not requested.
  • Gmail attachments: getMessage exposes attachment metadata only — no download of attachment bytes yet.
  • Gmail draft attachments: createDraft and updateDraft attach local files only from the directories in GMAIL_ATTACHMENT_ROOTS. Unset means every attachment is refused.
  • Gmail send format: sendEmail is plain-text only. HTML bodies are delivered as literal text.
  • Calendar scope: calendar.events covers event CRUD only. Cannot create or delete entire calendars.
  • Calendar recurring events: updateEvent and deleteEvent operate on the entire series unless you target a specific instance ID from listEvents with singleEvents=true.

Parameter Patterns

  • Document ID: Extract from URL: docs.google.com/document/d/DOCUMENT_ID/edit
  • Text targeting: Use textToFind + matchInstance OR startIndex/endIndex
  • Colors: Hex format #RRGGBB or #RGB
  • Alignment: START, END, CENTER, JUSTIFIED (not LEFT/RIGHT)
  • Indices: 1-based, ranges are [start, end)
  • Tabs: Optional tabId parameter (defaults to first tab)

Markdown Support

Workflow

  1. Retrieve: Use readGoogleDoc with format='markdown' to get document content as markdown
  2. Edit: Modify markdown locally using your preferred editor
  3. Apply: Use replaceDocumentWithMarkdown or appendMarkdownToGoogleDoc to write changes back

Supported Markdown Features

  • Headings: # H1 through ###### H6
  • Bold: **bold** or __bold__
  • Italic: *italic* or _italic_
  • Strikethrough: ~~strikethrough~~
  • Links: [text](url)
  • Lists: Bullet (-, *) and numbered (1., 2.)
  • Code blocks: Fenced code blocks (```) rendered as styled 1x1 tables (matching Google Docs' native Code Block building block)
  • Inline code: Backtick code rendered with monospace font + green color + gray background
  • Nested formatting: ***bold italic***, **bold [link](url)**

Markdown Tools

replaceDocumentWithMarkdown

Replaces entire document content with markdown-formatted content.

Parameters:

  • documentId: The document ID
  • markdown: The markdown content to apply
  • preserveTitle (optional): If true, preserves the first heading/title
  • firstHeadingAsTitle (optional, default: false): If true, the first # H1 is styled as a Google Docs Title instead of Heading 1
  • tabId (optional): Target a specific tab

Example:

# My Document

This is **bold** text with a [link](https://example.com).

- List item 1
- List item 2
  - Nested item

## Section 2

More content with _italic_ and ~~strikethrough~~.

appendMarkdownToGoogleDoc

Appends markdown content to the end of a document with full formatting.

Parameters:

  • documentId: The document ID
  • markdown: The markdown content to append
  • addNewlineIfNeeded (optional, default: true): Add spacing before appended content
  • firstHeadingAsTitle (optional, default: false): If true, the first # H1 is styled as a Google Docs Title instead of Heading 1
  • tabId (optional): Target a specific tab

Known Limitations for Markdown

  • Tables not yet supported in markdown-to-docs conversion
  • Images not yet supported in markdown-to-docs conversion
  • Complex nested lists (3+ levels) may have formatting quirks
  • Maximum practical document size: ~10,000 words (due to Google Docs API batch limits)

Source Files (for implementation details)

FileContains
src/types.tsZod schemas, hex color validation, style parameter definitions
src/googleDocsApiHelpers.tsfindTextRange, executeBatchUpdate, executeBatchUpdateWithSplitting, style request builders
src/googleSheetsApiHelpers.tsA1 notation parsing, range/format operations, protected-range helpers, table helpers
src/markdown-transformer/markdownToDocs.tsMarkdown-to-Google-Docs conversion logic
src/markdown-transformer/docsToMarkdown.tsGoogle-Docs-to-Markdown conversion logic
src/markdown-transformer/index.tsMarkdown-it configuration and public API
src/index.tsEntry point, CLI handling, and MCP server startup

See Also

  • README.md - Setup instructions and usage examples
  • SAMPLE_TASKS.md - 15 example workflows

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.