.docx files. Tools that accept a google_doc_id parameter open and operate on a live Google Doc instead of a file on disk.
Optional dependency
Google Docs support is provided by the optional peer dependency@usejunior/google-docs-core. It is loaded dynamically at runtime — if the package is not installed, tools will fall back to DOCX-only behavior. No startup error is thrown.
Providing a Google Doc ID
You can pass either the raw document ID or the full URL:/d/ and the next /.
Supported tools
The following MCP tools acceptgoogle_doc_id as an alternative to file_path:
| Tool | Description |
|---|---|
read_file | Read document content |
grep | Search paragraphs with regex |
replace_text | Replace text in a paragraph, preserving formatting |
insert_paragraph | Insert a paragraph before/after an anchor |
save | Checkpoint or snapshot the document |
format_layout | Apply layout controls (paragraph spacing only — see below) |
get_file_status | Get session metadata and edit counts |
close_file | Close the session |
file_path (such as compare_documents, add_comment, accept_changes) operate on DOCX files only.
save behavior for Google Docs
Thesave tool behaves differently for Google Docs:
Checkpoint (default) — when save_to_local_path is not provided:
- Edits are already persisted to Google Docs in real time; no additional write is performed
- Returns
save_mode: 'checkpoint'and the currentrevision_id - Use this to confirm the current revision after a batch of edits
save_to_local_path is provided:
- Exports the Google Doc as a DOCX file to the specified local path
- Returns
save_mode: 'snapshot',revision_id, andsaved_topath
format_layout for Google Docs
When usingformat_layout with a google_doc_id, only paragraph_spacing is supported. Attempting to pass row_height or cell_padding returns an UNSUPPORTED_FOR_PROVIDER error:
| OOXML parameter | Google Docs API field |
|---|---|
before_twips | spaceAbove (twips ÷ 20 = points) |
after_twips | spaceBelow (twips ÷ 20 = points) |
line_twips | lineSpacing (twips ÷ 240 × 100 = percentage) |

