mcp-gdocs
Provides tools for reading, writing, formatting, and managing Google Docs documents, including text, tables, images, tabs, headers/footers, footnotes, named ranges, comments (list, add, reply, resolve, delete), and batch operations via the Google Docs API.
Provides tools for file and folder management, search, creation (including from templates and Markdown), copying, moving, renaming, deleting, sharing, permissions, revisions, shared drives, and export to various formats via the Google Drive API.
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., "@mcp-gdocslist my 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.
mcp-gdocs
MCP server for Google Docs, Google Drive, and Comments with flexible authentication.
Connect Cursor, Claude Desktop, or any MCP client to your Google Docs and Drive.
Start with a single command: npx -y mcp-gdocs.
Quick Start
1. Google Cloud Setup
Go to Google Cloud Console
Create or select a project
Enable Google Docs API and Google Drive API
Choose authentication method (see Authentication below)
2. Add to Cursor / MCP Client
Service Account — share documents with the SA email, then:
{
"mcpServers": {
"mcp-gdocs": {
"command": "npx",
"args": ["-y", "mcp-gdocs"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "/path/to/service-account.json"
}
}
}
}OAuth — run npx -y mcp-gdocs auth first, then:
{
"mcpServers": {
"mcp-gdocs": {
"command": "npx",
"args": ["-y", "mcp-gdocs"],
"env": {
"GOOGLE_CLIENT_ID": "your-client-id",
"GOOGLE_CLIENT_SECRET": "your-client-secret"
}
}
}
}The server starts automatically when the MCP client connects.
Related MCP server: @node2flow/google-docs-mcp
What Can It Do?
Most write operations accept an items array for bulk execution in a single call. All tools support an optional tabId parameter for multi-tab documents.
Google Docs
Tool | Description |
| Read as text, JSON, markdown, or summary; optional |
| Document metadata (title, ID, revision) |
| List all tabs in a multi-tab document |
| Insert text at one or multiple positions |
| Append text to the end |
| Remove content by index ranges |
| Replace all occurrences of patterns |
| Replace entire document content |
| Insert page breaks |
| Rename a document tab |
| Update header content |
| Update footer content |
| Create footnotes at a position |
| Add a new document tab |
| Bold, italic, underline, colors, font, links |
| Alignment, spacing, indentation |
| Heading styles (H1–H6) |
| Find text and apply formatting without knowing indices |
| Add row to table |
| Add column to table |
| Delete row from table |
| Delete column from table |
| Update cell content |
| Cell background color |
| Create a table pre-filled with data |
| Insert images from URL |
| Insert images from local files (upload + insert) |
| Replace from Markdown (native Google conversion) |
| Replace from Markdown file (native conversion) |
| Batch multiple operations in one API call (30 request types) |
| Create a named range |
| Delete a named range |
| Replace text inside a named range |
Comments
Tool | Description |
| List all comments with author and date |
| Get a specific comment with replies |
| Create comments anchored to text |
| Reply to comments |
| Mark comments as resolved |
| Remove comments |
Google Drive
Tool | Description |
| List documents, optionally filtered |
| Full-text search across documents |
| Create new documents |
| Create documents from a template |
| Create a new Doc from inline Markdown |
| Create a new Doc from a local |
| Create folders |
| List folder contents |
| Get folder metadata |
| Move files to another folder |
| Duplicate files |
| Rename files |
| Move files to trash |
| Export document as PDF (optional |
| Export to markdown, PDF, DOCX, and other MIME types |
| Share a file (user, group, domain, anyone) |
| List ACLs on a file |
| Change role on an existing permission |
| Revoke a permission |
| List revision history |
| Fetch metadata or content of one revision |
| List shared drives (Team Drives) |
Prompts
Prompt | Description |
| Create or reformat a Doc from Markdown; cleanup batch for rules, spacing, tables |
| Document structure and styles aligned with GOST 19.106-78 |
| Fill a template using placeholders / named ranges |
| Export a Google Doc to Markdown via Drive API |
| Pin headers, column widths, and cell styles for a Doc table |
| List permissions, then share with a user |
Resources
URI | Description |
| JSON list of recently modified Google Docs |
Batch Operations
docs_batch_update combines multiple heterogeneous operations into a single API request (30 request types). Large arrays are automatically split into chunks. Rate limiting uses a shared API semaphore.
Authentication
The server supports multiple authentication methods. If several variables are set, the first found is used: OAuth → SERVICE_ACCOUNT_PATH → CREDENTIALS_CONFIG → GOOGLE_APPLICATION_CREDENTIALS.
Criteria | Service Account | OAuth |
Document access | Only shared with SA | All your documents |
Drive operations | Only in shared folders | Full access to your Drive |
Best for | CI/CD, servers, automation | Personal use, Cursor, Claude Desktop |
Setup | Download JSON key, share documents | OAuth flow in browser |
Google Workspace | Impersonation — full access as user | Not needed |
Enterprise (Google Workspace): with domain-wide delegation, SA can act on behalf of any domain user via
GOOGLE_IMPERSONATE_USER.
Recommendation: use OAuth for personal work in Cursor/Claude Desktop. Use Service Account with impersonation for enterprise automation.
Method A: Service Account
Headless, secure, ideal for server environments.
Steps:
GCP Console → IAM & Admin → Service Accounts → Create
Download JSON key
Share documents/folders with SA email (Editor)
Three ways to provide credentials:
{
"mcpServers": {
"mcp-gdocs": {
"command": "npx",
"args": ["-y", "mcp-gdocs"],
"env": {
"SERVICE_ACCOUNT_PATH": "/path/to/service-account-key.json",
"GOOGLE_IMPERSONATE_USER": "user@yourdomain.com"
}
}
}
}base64 -w 0 service-account.json # Linux
base64 -i service-account.json | tr -d '\n' # macOS{
"mcpServers": {
"mcp-gdocs": {
"command": "npx",
"args": ["-y", "mcp-gdocs"],
"env": {
"CREDENTIALS_CONFIG": "ewogICJ0eXBlIjogInNlcnZpY2VfYWNjb3VudCIs..."
}
}
}
}{
"mcpServers": {
"mcp-gdocs": {
"command": "npx",
"args": ["-y", "mcp-gdocs"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "/path/to/service-account.json"
}
}
}
}Method B: OAuth 2.0
For personal use with interactive browser login.
Google Cloud Console → APIs & Services → Credentials
Create OAuth client ID → Desktop app
Copy Client ID and Client Secret
OAuth consent screen → add your email as Test User
Authorize:
GOOGLE_CLIENT_ID="..." GOOGLE_CLIENT_SECRET="..." npx -y mcp-gdocs auth
{
"mcpServers": {
"mcp-gdocs": {
"command": "npx",
"args": ["-y", "mcp-gdocs"],
"env": {
"GOOGLE_CLIENT_ID": "your-client-id",
"GOOGLE_CLIENT_SECRET": "your-client-secret"
}
}
}
}OAuth refresh tokens are stored in ~/.config/mcp-gdocs/token.json (respects XDG_CONFIG_HOME). To re-authorize, delete the token file and run auth again.
Multiple Google Accounts
GOOGLE_MCP_PROFILE isolates token storage per profile:
~/.config/mcp-gdocs/
├── token.json # default (no profile)
├── work/token.json # GOOGLE_MCP_PROFILE=work
└── personal/token.json # GOOGLE_MCP_PROFILE=personalEnvironment Variables
Variable | Method | Description |
| SA | Path to SA JSON key (+ impersonation support) |
| SA | Email for impersonation (optional) |
| SA | Base64-encoded SA JSON (Docker/CI) |
| SA | Path to SA JSON key (standard Google variable) |
| OAuth | OAuth client ID |
| OAuth | OAuth client secret |
| OAuth | Profile name for isolated token storage |
Known Limitations
SA without Workspace: Service account without Google Workspace license has Drive quota = 0 and cannot create files. Use OAuth or impersonation.
Comment anchoring: Programmatically created comments may not be anchored to text in Google Docs UI (Drive API limitation).
Deeply nested lists: Lists with 3+ nesting levels may have formatting artifacts when converting Markdown.
Paragraph style safe range: paragraph and heading style tools automatically adjust ranges to prevent styles from bleeding into adjacent paragraphs.
Troubleshooting
Server won't start: check that environment variables are set in the MCP config
envblock.Authorization errors: make sure Docs and Drive APIs are enabled in Google Cloud Console. For OAuth — check that your email is added as Test User.
Re-authorization: delete
~/.config/mcp-gdocs/token.jsonand runnpx -y mcp-gdocs authagain.
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/iamtemazhe/mcp-gdocs'
If you have feedback or need assistance with the MCP directory API, please join our Discord server