gdocs-mcp
This server lets an AI agent work with Google Docs like local files, supporting reading, editing, styling, and managing documents, suggestions, comments, tabs, sharing, and Drive folders across multiple Google accounts.
Document content & structure
Read a Google Doc as markdown + inline HTML, with modes for clean, tracked (
<ins>/<del>), accepted, or rejected changes, and selectable segments (body, header, footer).Edit content by replacing unique text snippets; overwrite an entire doc/tab body; insert content at top, end, or after an anchor.
Create new docs from markdown, rename/move, copy, and export to PDF, DOCX, ODT, RTF, TXT, HTML, EPUB, MD.
Styling & layout
Style text (bold, italic, underline, strikethrough, color, font size/family, link, alignment, paragraph spacing) for selections or whole documents/tabs.
Read computed style; get/set page setup (margins, page size, orientation).
Tables & images
Insert tables with data, column widths, header shading; edit rows/columns; style and inspect tables.
Insert images from URL or local file with sizing/alignment; download embedded images locally.
Suggestions & comments
List pending suggestions as before→after diffs; accept/reject one or more atomically.
List, add, reply to, resolve, or reopen comments.
Tabs
List, add, rename, delete tabs; most content tools can target a specific tab.
Drive, sharing & configuration
List folders, search Drive, create folders.
List permissions, share with people or via link, revoke access.
List authorized accounts; set/get project defaults for account/folder.
Allows treating Google Docs like local files, with capabilities for reading, editing, managing suggestions and comments, handling tabs, and sharing documents.
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-mcpshow suggestions on the project proposal"
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.
@dasasian/gdocs-mcp
An MCP server that lets an AI agent (like Claude Code) treat a Google Doc like a local file — read it, edit it by content, review and resolve suggestions, manage comments, and work across tabs and multiple Google accounts.
Status: beta. The tool surface is complete and every change is verified against the live API, not just unit tests. Markdown code blocks are the one construct still to render (see Roadmap).
Why this exists
Most Google Docs MCP servers treat a doc as flat text. This one fills the gap nobody else does:
Suggestions as diffs you can act on.
list_suggestionsshows pending tracked-changes asbefore → after;apply_suggestionsaccepts/rejects one or more cleanly.read_doccan render them inline as<ins>/<del>.File-like editing.
edit_docmatches a unique snippet of text (like a localEdit) and rewrites it — indices are never exposed.Comments. Read threads (author, quoted text, replies, resolved status), reply, resolve, add.
Tabs as sub-files. Full create/rename/delete, and every read/edit tool can target a specific tab.
Multiple accounts. Authorize several Google accounts; pick a default per project.
Related MCP server: LLM2Docs (Unofficial)
What you can ask for
You don't call tools. You ask in plain language and the agent drives them.
Fill a template without rebuilding it
"Copy the Proposal Template into /Clients/Acme, name it 'Acme Q3 Proposal', then fill in the client name, the dates, and the pricing table."
The copy keeps the letterhead, the logo at its exact size, the fonts and the page setup — everything a markdown round-trip cannot rebuild. Then only the words that change are edited. The alternative is retyping a document you already have.
A whole review pass in one instruction
"Show me the pending suggestions as a diff, accept the typo fixes, reject anything that changes meaning, then reply to the open comments and resolve the ones that are settled."
Four tools, one sentence, and the judgement in the middle is the part you wanted help with. Most Docs integrations cannot see tracked changes at all, let alone act on them safely.
More: publishing a folder of markdown as a Drive tree, auditing many docs for style drift, pulling a doc back into your repo with its images → docs/recipes.md.
Install
npm install -g @dasasian/gdocs-mcpOr from source:
git clone https://github.com/dasasian/gdocs-mcp && cd gdocs-mcp
npm install && npm run build
npm link # makes `gdocs-mcp` available globally, same as the published packageThen follow the setup below exactly as an installed user would. (npm link symlinks the
gdocs-mcp binary to your build; see CONTRIBUTING.md for the dev workflow.)
Setup
You need a Google Cloud OAuth client (one-time). Each user creates their own — this keeps your credentials yours and avoids Google app-verification for the restricted Drive scope.
Create a project + enable APIs (or use the setup guide):
gcloud projects create my-gdocs-mcp gcloud config set project my-gdocs-mcp gcloud services enable docs.googleapis.com drive.googleapis.comOAuth consent screen (Cloud Console → APIs & Services → OAuth consent screen): User type External, add yourself as a Test user. For long-lived tokens, set publishing status to In production (avoids the 7-day refresh-token expiry).
OAuth client → Create credentials → OAuth client ID → Desktop app. Download the JSON and save it as
~/.config/gdocs-mcp/client_secret.json.Authorize an account (opens a browser):
gdocs-mcp add-accountRepeat for each Google account you want to use.
Configure your MCP client
In a project's .mcp.json (Claude Code) or equivalent:
{
"mcpServers": {
"gdocs": {
"command": "gdocs-mcp",
"env": { "GDOCS_DEFAULT_ACCOUNT": "you@example.com" }
}
}
}GDOCS_DEFAULT_ACCOUNT sets which authorized account this project uses by default — so a work project and a personal project can point at different accounts without re-authorizing. Any tool call can override it with an account argument.
Prefer it available in every project? Register once at user scope: claude mcp add gdocs -s user -e GDOCS_DEFAULT_ACCOUNT=you@example.com -- gdocs-mcp. Then a project can pin its own defaults with a .gdocs-mcp.json — both the account and a default folder for new docs:
{ "account": "work@company.com", "folder": "https://drive.google.com/drive/folders/…" }With a folder set, create_doc files new docs there automatically (an explicit folder argument still overrides). See docs/setup.md for the full resolution order.
You don't have to edit that file by hand — just tell the agent "make damithsc@gmail.com my default account for this project" or "make my Manuscripts folder the default here," and it writes the .gdocs-mcp.json for you via set_project_default (searching for the folder by name if needed).
Tools
The table below is the reference. For what to actually ask for, see What you can ask for above, or the full set in docs/recipes.md.
Tool | Description |
| Read as markdown + inline HTML — text color/size/font come back as |
| Replace a unique text snippet (string-anchored, markup-tolerant; new text supports inline markdown) |
| Style existing text in place — like selecting in Docs and applying formatting: a |
| Read / set document-level page setup: margins, page size (preset or explicit), orientation (File > Page setup) |
| Read the computed (inherited-resolved) style at a text anchor — paragraph spacing, alignment, fonts, colors that markdown can't show (read counterpart to |
| Replace a doc/tab body with markdown-rendered content — guarded against orphaning comments/suggestions |
| Insert new markdown content at a position — |
| Export a doc to a local file — pdf (default), docx, odt, rtf, txt, html, epub, md (rendered server-side by Google) |
| Create a doc from markdown, optionally in a folder |
| Pending suggestions as |
| Accept or reject one or more suggestions atomically — required for overlapping/adjacent "clusters"; |
| Insert an inline image from a URL or a local file — position, size, left/center/right align. |
| Download a doc’s embedded images to a local folder (pairs with |
| Insert a rows×columns table — data fill (cells accept inline markdown), per-column |
| Table structure ops — insert/delete a row or column (surgical — locate the table by cell text); |
| Style an existing table (located by cell text): cell padding, background, cell borders ( |
| Read a table's style (located by cell text): column widths, pinned header rows, and the matched cell's padding, background and per-side borders — the read counterpart to |
| Comment threads ( |
| Tab structure |
| Drive as a filesystem: |
| Sharing ( |
| Authorized Google accounts |
| Set/show this project’s default account + folder (writes |
Every doc tool accepts an optional account (override the default) and, where relevant, a tab (target a tab by id or title).
Drive as a filesystem
Drive navigation is one tool speaking shell, because the model already knows shell. Arguments are positional and differ per command, exactly as they do in a terminal.
{ "cmd": "ls", "args": ["/Work/2026"] }
{ "cmd": "find", "args": ["quarterly report", "-type", "d"] }
{ "cmd": "mkdir", "args": ["-p", "/Work/2027/Q1"] }
{ "cmd": "cp", "args": ["/Work/Template", "/Work/2027/Q1/Report"] }
{ "cmd": "mv", "args": ["/Work/Roof", "/Archive"], "expectName": "Roof" }path | is |
| My Drive |
| a shared drive |
| files others shared with you, which you never filed |
| files you own that are in no folder — see below |
anything else | a Drive id or URL, so ids from any other tool paste straight in |
Flags and operands parse in any order (cp -r a b, cp a b -r, cp a -r b), and -- ends the options.
Three places Drive is not a filesystem. The vocabulary is borrowed only where it is honest, and refuses where it is not:
Two files may share a name in one folder, and matching folds case. No filesystem the model learned from does either, so it would not think to check. A path matching more than one thing is refused with the candidates listed, never guessed — and
cp/mvrefuse to create that state too, rather than manufacturing an ambiguity the resolver would then decline to resolve.cp -rdoes not exist. Drive'sfiles.copyrefuses folders (its own web UI cannot copy one either), socpon a folder explains that rather than half-working.mvinto/shared/…gives the file away. Shellmvacross filesystems leaves you owning the file; moving into a shared drive transfers ownership to that organization and cannot be undone from your side. It requiresacceptOwnershipTransfer: true.
Paths see less than find does. A file with no parent still opens and still turns up in a search, but no path can name it — nothing that browses the tree will ever show it. find is the complete view; /lost+found is where those files surface.
There is no rm. See #47.
Known limitations
These are Google-API constraints, not bugs — the highlights are below; the complete reference (with the API reason and the workaround for each) is in docs/limitations.md.
Can't create suggestions. No API writes in suggestion mode — every edit is direct (live text).
apply_suggestionsonly resolves existing ones. Tools that write say so.No suggestion attribution (author/timestamp) — suggestions are listed in document order.
Comments created via the API aren't anchored to text, and Drive returns author name only (no email).
Images are inline only (no floating/x,y positioning), and Google downscales/re-encodes embedded images, so pulled copies aren't byte-identical.
Headers and footers are separate content trees — not part of the body. Every content tool (
read_doc,edit_doc,set_style,get_style,insert_content,insert_image,insert_table,edit_table,set_table_style,list_suggestions,apply_suggestions) takessegment: "header" | "footer"to reach them, andpagewhen a doc defines more than one.Markdown can't express computed style (spacing, fonts, colors) or deep table styling — read it with
get_style, set it withset_style/set_table_style. Code blocks aren't rendered from markdown yet (roadmap).
See docs/limitations.md for the full table, including how each is mitigated or surfaced.
Roadmap
Code blocks in the markdown writer — the remaining Tier-2 block type (tables and images already render; standalone
insert_table/insert_imagetools exist too).
Suggestion attribution (author/timestamp) is not on the roadmap — it has no API path for typical suggestions (see docs/limitations.md).
The "manuscript sync" use case (chapter files ⇄ tabs, reviewing suggestions, merging) is intentionally not a server feature — an AI agent orchestrates it over these primitives. See DESIGN.md §10b.
Development
npm install
npm run build # tsc
npm test # vitest
npm run typecheckSee DESIGN.md for the full architecture and the empirical findings behind it.
Acknowledgements
Architecture and approach informed by prior open-source Google Docs MCP servers — notably @a-bonus/google-docs-mcp and taylorwilsdon/google_workspace_mcp.
License
MIT © Dasasian
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP (Multi-Agent Conversation Protocol) Server that enables AI agents to interact with Google Docs via natural language, automatically generated using AG2's MCP builder.
- AlicenseNot gradedqualityDmaintenanceAn unofficial MCP server for Google Docs that lets large language models securely access, read, and interact with documents, enabling smarter workflows and AI-assisted editing.12MIT
- AlicenseNot gradedqualityDmaintenanceA powerful Model Context Protocol (MCP) server implementation for seamless Google Docs API integration, enabling AI assistants to create, read, update, and manage Google Docs.12MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI assistants to interact with Google Docs, Sheets, and Drive using the user's own Google account.
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/dasasian/gdocs-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server