productivity
Google Docs MCP, CLI, and Lua Integration for AI Agents
Google Docs integration docs for AI agents: MCP gateway setup, Google Docs CLI commands, Lua API reference, credentials, and function schemas.
14 functions 11 read 3 write OAuth browser flow auth
Google Docs for agents
OAuth can be configured in web hosts through redirect and in CLI hosts through local/device authorization; runtime works with stored tokens.
Use this integration from Lua code mode, the headless integrations CLI, or the KosmoKrator MCP gateway. The same package metadata powers all three surfaces.
Machine-Readable Metadata
- integration_slug
google_docs- route_slug
google/google-docs- package
google- auth_strategy
oauth2_authorization_codeOAuth browser flow- cli_setup_supported
true- cli_runtime_supported
true- mcp_gateway_supported
true- lua_supported
true- supports_multi_account
false
Quick Links
Lua APIAgent-facing namespace and function reference. Google Docs CLIHeadless setup and direct function calls. Google Docs MCPMCP gateway setup for external clients. Submit feedbackReport missing tools, auth problems, wrong docs, or runtime issues. ContributeAdd tools or improve metadata in the integrations repo.
Google Docs MCP Client Matrix
Use these pages when a specific agent client or framework needs copy-pasteable MCP setup for Google Docs.
Claude Code Google Docs MCP setup for Claude Code. Cursor Google Docs MCP setup for Cursor. Codex Google Docs MCP setup for Codex. OpenAI Agents Google Docs MCP setup for OpenAI Agents SDK. Claude Agent SDK Google Docs MCP setup for Claude Agent SDK. Vercel AI SDK Google Docs MCP setup for Vercel AI SDK. LangChain Google Docs MCP setup for LangChain. LangGraph Google Docs MCP setup for LangGraph. CrewAI Google Docs MCP setup for CrewAI. MCP clients Google Docs MCP setup for Generic MCP Clients.
Google Docs CLI Matrix
Use these pages for direct Google Docs CLI workflows in scripts, CI, cron, and agent wrappers.
CI Google Docs CLI for CI. Cron Jobs Google Docs CLI for cron jobs. Shell Scripts Google Docs CLI for shell scripts. Headless Automation Google Docs CLI for headless automation. Coding Agents Google Docs CLI for coding agents.
Function Catalog
| Function | Type | Parameters | Description |
|---|---|---|---|
google_docs.google_docs_add_bullets | Write write | 4 | Add bullet or numbered list formatting to a range in a Google Docs document. Default preset is BULLET_DISC_CIRCLE_SQUARE. Use NUMBERED_DECIMAL_ALPHA_ROMAN for numbered lists. |
google_docs.google_docs_create | Read read | 1 | Create a new blank Google Docs document. Returns the document ID and URL. |
google_docs.google_docs_delete_range | Write write | 3 | Delete content in a Google Docs document by index range. Use google_docs_get_structure first to find the correct indexes. |
google_docs.google_docs_format_text | Read read | 11 | Apply formatting to a text range in a Google Docs document. Supports bold, italic, underline, strikethrough, fontSize (points), fontFamily, foregroundColor (hex like "#FF0000"), and link (URL). |
google_docs.google_docs_get | Read read | 2 | Get the content of a Google Docs document. Returns plain text by default, or a structured outline with character indexes when format is "structured". The document ID is the long string in the URL: docs.google.com/document/d/{documentId}/edit |
google_docs.google_docs_get_structure | Read read | 1 | Get a simplified structure of a Google Docs document showing heading hierarchy, paragraph indexes, and table positions. Essential before performing index-based editing operations. The document ID is the long string in the URL: docs.google.com/document/d/{documentId}/edit |
google_docs.google_docs_insert_image | Read read | 5 | Insert an image from a URL into a Google Docs document. Supports PNG, JPEG, and GIF. Optionally specify width and height in points. |
google_docs.google_docs_insert_page_break | Read read | 2 | Insert a page break into a Google Docs document. Omit index or set to -1 to insert at end. |
google_docs.google_docs_insert_table | Read read | 4 | Insert a table into a Google Docs document. Specify rows and columns. Omit index or set to -1 to insert at end. |
google_docs.google_docs_insert_text | Read read | 3 | Insert text into a Google Docs document at a specific position or at the end. Omit index or set to -1 to append at end. |
google_docs.google_docs_remove_bullets | Write write | 3 | Remove bullet or numbered list formatting from a range in a Google Docs document. |
google_docs.google_docs_replace_all | Read read | 4 | Find and replace all occurrences of text in a Google Docs document. No indexes needed — this is the simplest way to edit text. |
google_docs.google_docs_search_text | Read read | 3 | Find all occurrences of text in a Google Docs document with their start/end indexes. Useful before format_text or delete_range operations. The document ID is the long string in the URL: docs.google.com/document/d/{documentId}/edit |
google_docs.google_docs_set_heading | Read read | 4 | Set paragraph style (heading level) for a range in a Google Docs document. Valid styles: HEADING_1 through HEADING_6, TITLE, SUBTITLE, NORMAL_TEXT. |