Connector guide4-minute read7 MCP tools7 languages

Google Docs to MCP: Drive Google Docs from any AI Agent

Let your AI work with Google Docs: read a document as plain text or as headings and paragraphs with positions, create new documents, append or insert text and replace text everywhere, for example to fill a template. Personal Google accounts and Google Workspace.

HCBy HelpCode teamUpdated 4 min read Open-source on GitHub

No credit card · 7-day trial · Self-host alternative available

Google Docs

Google Docs

Let your AI work with Google Docs: read a document as plain text or as headings and paragraphs with positions, create new documents, append or insert text and replace text everywhere, for example to fill a template. Personal Google accounts and Google Workspace.

tools

7

Region

INTL

Category

Productivity

Authentication

OAuth 2.0

Required env vars

GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRET
Install in one click on Cloud

7-day free trial · No credit card

  • 7-day free trial
    No credit card required
  • GDPR & SOC 2 ready
    EU data residency, audit logs
  • Open-source on GitHub
    Open source · AGPL-3.0
  • Works with ChatGPT, Claude, Gemini
    Any MCP-compatible client

Skip the install. Get this working in under 2 minutes.

Start a free trial on cloud.anythingmcp.com, add the Google Docs in one click, then point your AI client (Claude, ChatGPT, Copilot or Cursor) at the generated MCP endpoint. No Docker, no git clone, zero engineering experience required.

Start free trial

Summary

Let your AI work with Google Docs: read a document as plain text or as headings and paragraphs with positions, create new documents, append or insert text and replace text everywhere, for example to fill a template. Personal Google accounts and Google Workspace.

Try asking

Example prompts for Google Docs

Click any prompt to copy it. Paste into Claude, ChatGPT, Cursor, Gemini, Copilot or OpenClaw to run it against this connector.

Google Docs · live via MCP
Share
Opus 4.7

Claude is AI and can make mistakes. Please double-check responses.

💡 No install? Use cloud.anythingmcp.com directly. Sign in, click Connectors → Google Docs, paste your credentials, mint an MCP API key and you're done. No Docker, no git clone, no local server.

Google Docs

Let your AI work with Google Docs: read a document as plain text or as headings and paragraphs with positions, create new documents, append or insert text and replace text everywhere, for example to fill a template. Personal Google accounts and Google Workspace.

Setup

  1. Open console.cloud.google.com, pick or create a project, then go to APIs & Services → Library and enable the Google Docs API.
  2. Open APIs & Services → OAuth consent screen. Choose Internal if you are on Google Workspace (the simplest option), otherwise External. For External, set the publishing status to In production: while the app is in Testing, Google revokes its refresh tokens after 7 days and the connector stops working every week. For your own account you can click through the "unverified app" warning.
  3. Open APIs & Services → Credentials → Create credentials → OAuth client ID, choose the application type Web application and add the authorized redirect URI https://cloud.anythingmcp.com/api/mcp-oauth/callback. If you host AnythingMCP yourself, enter https://your-anythingmcp-host/api/mcp-oauth/callback instead.
  4. Paste the client ID into GOOGLE_CLIENT_ID and the client secret into GOOGLE_CLIENT_SECRET, then install the connector.
  5. On the connector page, click Authorize with Provider and sign in with the Google account whose documents the AI should use. The refresh token is stored encrypted and access tokens are renewed automatically.

One Google client for all Google connectors: the same Cloud project and OAuth client can serve every Google connector: Gmail, Google Calendar, Google Drive, Google Sheets, Google Docs, Google Tasks, Search Console, Analytics and Ads. Enable each API in that project, reuse the same client ID and secret, and authorize each connector once. Each one asks only for its own permissions.

Finding a document: paste the document's link into the chat; its id is the long string in https://docs.google.com/document/d/<id>/edit. To find documents by name, add the Google Drive connector as well. The connector reads a document's first tab; very long documents or documents with several tabs read better through the Google Drive connector. Replacing text everywhere is the reliable way to fill a template with placeholders such as [Customer name].

Permissions: the connector asks for https://www.googleapis.com/auth/documents: read and edit every document your account can open. It does not include Google Drive, so the connector cannot list, search, share or delete documents.

Read-only setup: change the scope in the connector's OAuth settings to https://www.googleapis.com/auth/documents.readonly, authorize again and disable gdocs_create_document, gdocs_append_text, gdocs_insert_text and gdocs_replace_all_text.

Switched off at install: gdocs_batch_update, which accepts any Docs API request, including deleting content. Turn it on only if the AI needs it.

Common errors: 401 means the authorization expired or was revoked (always after 7 days while the consent screen is in Testing): click Authorize with Provider again. 403 PERMISSION_DENIED means the account cannot open or edit that document, or the scope is read-only; 403 "Docs API has not been used in project" means the Google Docs API is not enabled in the Cloud project. 404 means the id is wrong or belongs to another file type, such as a Sheet or a Word file uploaded to Drive.

The connector does not handle comments and suggestions, does not share, move or delete documents (the Google Drive connector does that) and does not edit Word files stored in Drive.

Prerequisites: GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET

Install the connector locally

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

Open http://localhost:3000/connectors/store, pick Google Docs and paste in the env vars listed under Prerequisites.

Available tools

ToolWhat it does
gdocs_get_document_textRead a Google Doc as plain text: documentId, title, revisionId, endIndex and text, the body's paragraphs and table cells in order (images…
gdocs_get_document_structureRead a Google Doc as a list of blocks with their positions, for precise edits: each paragraph or table with startIndex, endIndex, type…
gdocs_create_documentCreate a new, empty Google Doc with a title, in the root of the user's My Drive
gdocs_append_textAppend text at the end of a document's body
gdocs_insert_textInsert text at a position in the body. index counts UTF-16 code units from 1 (the very start of the body) and must fall inside a paragraph…
gdocs_replace_all_textReplace every occurrence of a text in the document (all tabs, headers and footers included) with another text; an empty replace_with…
gdocs_batch_updateRun Docs API batchUpdate requests for edits the other tools do not cover: deleting ranges (deleteContentRange), styling text or paragraphs…

Example prompts

  • "Read these meeting notes and list every action item with its owner."
  • "Fill in the contract template: replace [Customer name] with Acme GmbH and [Start date] with 1 November 2026."
  • "Add a Next steps section at the end of the project brief."
  • "Create a new document called Onboarding checklist and write a first draft in it."

Next steps

Was this guide helpful?

Your Google Docs agent is one click away.

Install the connector, paste the key, prompt your AI client. Free for 7 days, no credit card.

Related guides

Connectors

How to Connect Google Docs to ChatGPT via MCP

Let your AI work with Google Docs: read a document as plain text or as headings and paragraphs with positions, create new documents, append or insert text and replace text everywhere, for example to fill a template. Personal Google accounts and Google Workspace.

Connectors

How to Connect Google Docs to Claude via MCP

Let your AI work with Google Docs: read a document as plain text or as headings and paragraphs with positions, create new documents, append or insert text and replace text everywhere, for example to fill a template. Personal Google accounts and Google Workspace.

Connectors

How to Connect Google Docs to Cursor via MCP

Let your AI work with Google Docs: read a document as plain text or as headings and paragraphs with positions, create new documents, append or insert text and replace text everywhere, for example to fill a template. Personal Google accounts and Google Workspace.

Connectors

How to Connect Google Docs to Gemini via MCP

Let your AI work with Google Docs: read a document as plain text or as headings and paragraphs with positions, create new documents, append or insert text and replace text everywhere, for example to fill a template. Personal Google accounts and Google Workspace.

Connectors

How to Connect Google Docs to Meta Muse via MCP

Let your AI work with Google Docs: read a document as plain text or as headings and paragraphs with positions, create new documents, append or insert text and replace text everywhere, for example to fill a template. Personal Google accounts and Google Workspace.

Connectors

Google Calendar to MCP: Drive Google Calendar from any AI Agent

Let your AI work with Google Calendar: see the calendars you have, list and search events in any time range, read event details and guests, create and reschedule meetings with guests and Google Meet links, answer invitations, add events from a sentence and check when people are free. Personal Google accounts and Google Workspace.