gdocs-mcp
Provides a tool to execute functions in a deployed Google Apps Script project.
Provides tools for reading, creating, updating, styling, and exporting Google Docs, as well as managing comments and inserting images, tables, links, and page breaks.
Provides tools for searching, copying, deleting, and exporting Google Drive files, as well as managing comments on documents.
Provides a tool to list charts in a Google Sheets spreadsheet.
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., "@gdocs-mcplist 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.
gdocs-mcp
Open-source MCP server for Google Docs and Sheets. Give Claude (or any MCP-compatible AI) the ability to read, create, edit, style, export, and collaborate on your Google Docs — with OAuth tokens that never leave your machine.
Open-source. Self-hosted. Your tokens never leave your machine.
Quick Start
1. Set up Google Cloud credentials (one-time)
Go to Google Cloud Console
Create a project (or use an existing one)
Enable the Google Docs API, Google Sheets API, and Google Drive API
Go to Google Auth Platform > Audience, set to External, add yourself as a test user
Go to Credentials > Create Credentials > OAuth client ID > Desktop app
Download the JSON file
2. Authenticate
npx gdocs-mcp auth ~/Downloads/client_secret_*.jsonThis opens your browser for Google sign-in, saves the token to ~/.gdocs-mcp/, and prints the MCP config.
3. Add to Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"gdocs": {
"command": "npx",
"args": ["gdocs-mcp"]
}
}
}Restart Claude Desktop. Ask Claude: "List my recent Google Docs" to verify.
Add to Claude Code
claude mcp add gdocs -- npx gdocs-mcpRelated MCP server: Google Workspace MCP Server
Tools (28)
Google Docs — Read & Write
Tool | Description |
| Read the full content of a Google Doc |
| Search Google Drive for documents by name, content, or date |
| Create a new Google Doc with optional Markdown content |
| Find and replace all occurrences of text in a document |
| Replace an existing image with a new image from a URI |
| Replace the entire document body with Markdown |
| Insert or replace a section by index with Markdown |
| Update page size, margins, text direction |
| Raw batchUpdate with 35+ request types |
| Unmerge previously merged table cells |
Content Insertion
Tool | Description |
| Insert an image from a URL with optional width/height sizing |
| Create a table with specified rows (1-20) and columns (1-20) |
| Insert a page break at a specific position |
| Add a hyperlink to an existing text range |
Document Management
Tool | Description |
| Export as PDF, DOCX, TXT, or HTML. Save to file or return base64 |
| Duplicate a doc with a new title. Great for templates |
| Move to trash. Requires exact title confirmation to prevent accidents |
Comments
Tool | Description |
| List comments with author, content, resolved status, and replies |
| Add a comment anchored to specific text in the document |
Style Presets
Define how your documents look once, apply everywhere.
Tool | Description |
| Extract styles from a reference Google Doc and save as a reusable preset |
| Apply a style preset to any document — fonts, colors, spacing, tables |
| List all available presets (4 built-in + your custom presets) |
| Set the default preset for new documents |
| Delete a custom preset |
Formatting
Tool | Description |
| Create or update header/footer content and styling |
| Apply bullet, numbered, or remove list formatting (6 glyph presets) |
Google Sheets
Tool | Description |
| List all charts in a spreadsheet with IDs and specs |
Automation
Tool | Description |
| Run a function in a deployed Google Apps Script project |
Style Presets
Built-in Presets
Preset | Font | Headings | Body |
| Inter | Dark charcoal, 22/16/13pt | 11pt, 1.5x spacing |
| Arial | Dark grey, conservative | 11pt, 1.4x spacing |
| Georgia + Garamond | Dark blue, serif | 11pt, 1.4x spacing |
| Roboto | Black, light weight | 10.5pt, 1.5x spacing |
Extract + Apply Workflow
Point to a Google Doc that already looks the way you want:
You: "Extract styles from my brand doc and save as 'brand'"
→ extract_document_styles(documentId, saveAs: "brand")
You: "Apply brand styles to this report"
→ apply_style_preset(documentId, presetName: "brand")One-step capture, one-step apply. No JSON editing needed.
Style Properties
Presets support every text and paragraph property the Google Docs API exposes:
Text: font family, font size, bold, italic, underline, strikethrough, small caps, text color, background color, baseline offset
Paragraph: alignment (left/center/right/justified), line spacing, space above/below, first line indent, start/end indent, keep lines together, keep with next, direction (LTR/RTL), paragraph borders
Document: page margins, page size
Tables: header row background and text color, bold headers, border color and width, cell padding, alternating row backgrounds
Only properties you specify are applied. Omitted properties are left unchanged. Config stored at ~/.gdocs-mcp/styles.json.
Upgrading to v0.4
v0.4 expands the Drive scope from drive.readonly to drive (needed for export, copy, delete, and comments). You must re-authenticate:
npx gdocs-mcp authIf you don't need the new tools and want to keep the old scope:
GDOCS_MCP_READONLY=1 npx gdocs-mcpScope Justification
Scope | Tools |
| read, create, replace, update, insert image/table/link/page break, style presets, header/footer, format list |
| get_charts |
| search, export, copy, delete, get/add comments |
Limitations
These are Google Docs API limitations, not gdocs-mcp limitations:
Table of Contents styling is not controllable — TOC entries mirror heading styles
Custom named styles cannot be created — only the 9 built-in types (Title, Subtitle, Heading 1-6, Normal Text)
Conditional formatting does not exist in Google Docs
Multi-column layout is not exposed via the API
Table header detection assumes row 0 is the header — multi-row headers are not detected
Suggested edits (propose mode) are not yet supported
Comment replies are not yet supported — only top-level comments
Image URLs are passed directly to Google's API — the MCP server does not fetch them
Performance Logging
Every tool call logs latency to stderr:
[gdocs-mcp] read_document: 342ms (api: 298ms)
[gdocs-mcp] apply_style_preset: 1247ms (api: 1102ms, 1593 requests)
[gdocs-mcp] list_style_presets: 2ms (local)Disable with GDOCS_MCP_QUIET=1.
Security
OAuth tokens stored locally at
~/.gdocs-mcp/token.jsonwith600permissionsCredentials stored at
~/.gdocs-mcp/credentials.jsonwith600permissionsStyle presets stored at
~/.gdocs-mcp/styles.jsonNo telemetry, no data collection, no third-party token storage
Tokens refresh automatically; if refresh fails, run
npx gdocs-mcp authagaindelete_documentrequires exact title match — not a boolean flag
Configuration
Credentials and tokens stored in ~/.gdocs-mcp/ by default. Override with:
GDOCS_CREDENTIALS=/path/to/credentials.json npx gdocs-mcpEnvironment variables:
Variable | Effect |
| Override credentials.json path |
| Set to |
| Set to |
For faster startup, install globally:
npm install -g gdocs-mcpRequirements
Node.js 18+
A Google Cloud project with Docs, Sheets, and Drive APIs enabled
License
MIT
This 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/apurwa/gdocs-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server