gdocs-mcp-noapi
Reads and edits real Google Docs through a signed-in Chrome tab, with tools for reading text, writing and replacing content, formatting, tables, images, comments, headers and footers, exports, and Apps Script.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
gdocs-mcp-noapi
An MCP server that reads and edits real Google Docs by driving a signed-in Chrome tab over the DevTools Protocol.
No Google Cloud project. No OAuth client. No service account. No API key. If you can use Google Docs in a browser, this server can use it too — including accounts on school or work tenants that block third-party API access.
40 tools: read, write, format, tables, images, comments, headers, exports, Apps Script.
Every write goes through a per-tab mutex, so parallel tool calls cannot interleave keystrokes.
The document stays the source of truth: text is read from the DOM, from the clipboard, or from Google's own HTML export.
Works with any MCP client: OpenCode, Claude Desktop, Cursor, Windsurf, or a hand-rolled client.
Requirements
Thing | Why |
Node.js 20 or newer | the server and the bundle |
Google Chrome or Chromium | the tab the server drives |
A Google account signed in to that browser | Docs needs a session |
A document you can open in that account | obviously |
The server never sees your password. It attaches to a Chrome instance that you signed in to yourself.
Related MCP server: A1 Google Docs MCP
Install
git clone https://github.com/jekooo2814/gdocs-mcp-noapi.git
cd gdocs-mcp-noapi
npm install
npm run buildnpm run build bundles src/google-docs.mjs into dist/google-docs.mjs with esbuild. The bundle is what the MCP client runs; dist/ is committed so you can skip the build if you trust the source.
Start Chrome with the debugging port
npm run launchThis opens Chrome with a dedicated profile in ~/.gdocs-mcp/profile and remote debugging on port 9222. Sign in to Google once in that window. The profile persists, so you only do this once.
Already have Chrome running with a debugging port? Skip launch and set GDOCS_PORT to that port.
Variable | Default | Meaning |
|
| DevTools port to attach to |
|
| Chrome profile used by |
Wire it into an MCP client
Any client that speaks MCP over stdio works. The command is node and the argument is the absolute path to the bundle.
OpenCode
opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"google-docs": {
"type": "local",
"command": ["node", "/absolute/path/to/gdocs-mcp-noapi/dist/google-docs.mjs"],
"enabled": true
}
}
}Claude Desktop
claude_desktop_config.json:
{
"mcpServers": {
"google-docs": {
"command": "node",
"args": ["/absolute/path/to/gdocs-mcp-noapi/dist/google-docs.mjs"]
}
}
}Anything else
Spawn node /absolute/path/to/dist/google-docs.mjs and speak MCP on stdin/stdout. No flags, no ports of its own, no HTTP.
Windows paths go in as C:\\Users\\you\\gdocs-mcp-noapi\\dist\\google-docs.mjs.
First run
launch— Chrome opens with the dedicated profile.Sign in to Google in that window.
openwith a document URL or a bare document id.read— you get the text with line numbers.
open is only needed once per document. Every later call reattaches from ~/.gdocs-mcp/state.json, so a fresh MCP process still knows which tab and which document you meant. forget clears that record.
If status says signedIn: false, the Chrome window is not signed in or the tab is not on a document. Fix that in the browser, then call open again.
Tools
help returns this same catalog as JSON, plus the shortest recipe for each common job. Call it first when a client is unsure which tool to use.
Document lifecycle
Tool | What it does |
| attach to a document by URL or id |
| tab, account, line count, remembered document, queue state |
| drop the remembered document |
| start Chrome with the debugging port and dedicated profile |
Reading
Tool | What it does |
| text with line numbers; |
| exact formatting of a text match, or the caret's toolbar state |
| headings with level and text |
| words, characters, lines, paragraphs |
| what the live page actually exposes — use it when a selector fails |
read source:"export_html" is the fast full read: Google's HTML export fetched inside the page with your cookies, no clipboard, no caret movement, roughly 300 ms. It returns markdown with **bold**, *italic*, ++underline++, ~~strike~~, <sup>, <sub>.
Writing
Tool | What it does |
| type at the caret |
| type at the end of the document |
| find a match, type over it; empty replacement deletes |
| bulk find/replace through Docs' own dialog; returns the count |
| find and delete |
| write a whole document from markdown or HTML, with |
| replace everything with one HTML paste |
| paste HTML at the caret |
| local file: text pastes, binary uploads |
| undo, redo |
| save the text to |
Formatting
Tool | What it does |
| any combination in one call: bold, italic, underline, strike, sup/sub, heading, font, size, color, background, align, line spacing, list, indent, link, clear, uppercase |
| select the nth match and leave it selected |
| turn the selection into a link |
| page break, horizontal line, footnote, bookmark |
| editing, suggesting, viewing |
format takes find to select exactly what to style, so one call does the whole job:
{ "find": "Chapter 1", "bold": true, "size": 18, "color": "red", "align": "center" }Structure
Tool | What it does |
| insert or refresh the table of contents |
| empty table at the caret |
| add/delete rows and columns, merge, unmerge, fill |
| header, footer, page numbers |
| add, list, reply, resolve |
| upload a local image |
| download and upload an image from a URL |
Escape hatches
The named tools cover the common paths. These cover everything else, which means the server can do anything the UI can do.
Tool | What it does |
| click any menu path, e.g. |
| send a key chord, e.g. |
| type into whatever has focus |
| click by CSS selector or visible text |
| fill a visible field by label or placeholder |
| bound Apps Script: check, open, run code with |
| docx, pdf, txt, epub, rtf, odt, html to disk |
| PNG of the tab |
Recipes
Write a document from scratch
{ "tool": "build", "args": { "markdown": "# Report\n\nText with **bold** and a [link](https://example.com).\n\n- one\n- two", "replace": true } }Read it back fast
{ "tool": "read", "args": { "source": "export_html" } }Find and edit one paragraph
{ "tool": "find", "args": { "text": "old sentence" } }
{ "tool": "replace", "args": { "find": "old sentence", "replacement": "new sentence" } }Style a heading
{ "tool": "format", "args": { "find": "Results", "heading": "h1", "bold": true, "color": "blue" } }Verify what actually landed
{ "tool": "styles", "args": { "text": "Results" } }Table with content
{ "tool": "insert_table", "args": { "rows": 3, "columns": 2 } }
{ "tool": "table", "args": { "action": "fill", "rows": [["Name","Score"],["Ana","10"],["Luis","9"]] } }Header, footer, page numbers
{ "tool": "headers_footers", "args": { "header": "Internal report", "footer": "Confidential", "page_numbers": true } }Comment on a phrase
{ "tool": "find", "args": { "text": "revenue" } }
{ "tool": "comments", "args": { "action": "add", "text": "Check this number" } }Anything the tools do not cover
{ "tool": "menu", "args": { "path": ["Format", "Columns", "2"] } }How it works
MCP client ──stdio──▶ server ──WebSocket──▶ Chrome DevTools Protocol ──▶ docs.google.comThe server lists Chrome targets and finds the Docs tab.
It attaches with
Target.attachToTargetand sendsRuntime.evaluateandInput.*commands.Text is read three ways: the DOM mirror Docs keeps for accessibility, the clipboard's HTML flavor, or Google's own export endpoint fetched from inside the page.
Writes go through a mutex per tab. Two tools never type at the same time.
Every mutating tool clears the export cache, so a read after a write sees the new state.
Nothing is stored in the cloud. The only local state is ~/.gdocs-mcp/: the remembered document, the Apps Script project map, backups and downloaded images.
Limitations
These are real, and the notes say what to do about them.
Export rate limit. Google returns HTTP 429 when the HTML export is hit in bursts. The server caches exports for 1.5 s and retries with backoff, but rapid alternating reads and writes can still hit it. Wait a second and retry.
Drive file picker. On some accounts the Drive picker never raises its file chooser, so
import_file mode:"picker"cannot complete. Usedropwith a local path, orinsert_imagefor images.Image width. Google does not expose a stable control for exact image width through the toolbar; width is best-effort and not reported.
Autosave lag. The export reflects what Google has autosaved.
styleswaits ~250 ms after a mutation before reading; a very large document may need a moment more.One tab at a time. The mutex is per tab. Two documents in two tabs are fine; two agents on the same tab queue up.
Localized UI. Menu paths are matched in English and Spanish. A different UI language needs new aliases in
BUTTONSandMENU_ALIASESinsrc/google-docs.mjs.
Troubleshooting
Symptom | Fix |
| a modal is open — call |
|
|
| sign in to Google in the Chrome window, then |
| the text has different spacing or is not saved yet; |
A tool reports | the menu path failed and a keyboard shortcut was used instead; verify with |
| wait a second, or use |
Development
npm test # selftest: parsers, HTML to markdown, style resolution
npm run build # rebuild dist/google-docs.mjs
npm run probe # open a URL and dump what the page exposes
npm run format # biome
npm run lintsrc/google-docs.mjs is the whole server: CDP client, gate, document helpers, tools, selftest. dist/google-docs.mjs is generated — edit the source and rebuild.
Add a tool with the tool(name, description, schema, handler) helper. Handlers that mutate must not be marked readOnly, because that flag controls the export cache and the mutex reporting.
Guía rápida en español
git clone https://github.com/jekooo2814/gdocs-mcp-noapi.git
cd gdocs-mcp-noapi
npm install
npm run build
npm run launch # abre Chrome con el perfil dedicado, inicia sesión una vezConfiguración para OpenCode:
{
"mcp": {
"google-docs": {
"type": "local",
"command": ["node", "/ruta/absoluta/a/gdocs-mcp-noapi/dist/google-docs.mjs"]
}
}
}Uso típico:
opencon la URL del documento.readpara leerlo con números de línea.buildpara escribir un documento entero desde markdown.find+replacepara cambiar un texto concreto.formatconfindpara aplicar negrita, tamaño, color, alineación o estilo de párrafo en una sola llamada.stylescontextpara comprobar que el formato se aplicó de verdad.exportpara descargar en docx, pdf o txt.
La UI de Docs se maneja en español o en inglés; las rutas de menú están traducidas para ambos. Si usas otro idioma, añade los alias en src/google-docs.mjs.
License
MIT. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Google Docs MCP Pack — read, create, and edit Google Docs via OAuth. Reuses the google_sheets…
Provides tools for searching Google Workspace documentation and much more.
Overleaf MCP server for ChatGPT, Claude and any AI agent: list projects, read file, edit file, compile project, add comment, reply to comment, accept tracked change and invite collaborator in your own Overleaf account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Overleaf yourself; Cotlet does not store your password and you need no Overleaf API key. About the official Overleaf API: Overleaf has no public API to read or change existing projects (checked 5 Nov 2026). Its only API, Open in Overleaf, sends LaTeX in one direction to create a new project. Setup and FAQ: https://cotlet.dev/integrations/overleaf-api-mcp-server
Convert, create and edit Word, PowerPoint, Excel and PDF documents from any AI agent.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables reading, editing, and rewriting Google Docs documents with tools that support full content replacement, appending, heading-based insertion, and style-preserving rewrites.-
- AlicenseAqualityBmaintenanceLets AI apps read and edit Google Docs in plain language, including reading as text or Markdown, making precise range-based edits, styling, working with comments, and exporting to PDF, DOCX, and other formats.27126 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables reading and editing Google Docs via the Docs API, including structure/outline retrieval, text export, section/range/table editing, text replacement, document creation, and raw batch updates, with dry-run previews before destructive changes.MIT
- AlicenseBqualityCmaintenanceEnables agents to read, write, format, fill, and export Google Docs and Slides as the signed-in user through a real Chrome browser, without API keys or OAuth.271MIT