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.

7 дней бесплатно · без карты · EU-хостинг

Спроси Google что угодно

Попробуй реальный промпт против Google Docs via AnythingMCP — Claude вызывает tools, возвращает ответ. Нажми Enter на своём сообщении, чтобы установить в Cloud.

Установить Google в Cloud
Google Docs · live via MCP
Поделиться
Opus 4.7

Claude — это AI, он может ошибаться. Проверяйте ответы.

Настройка за 2 минуты

  1. 1Запусти free trial на cloud.anythingmcp.com.
  2. 2Нажми Google Docs в коннектор-сторе. Вставь учётные данные.
  3. 3Выпусти MCP API ключ и направьте AI-клиент на MCP URL.
Установить Google Docs сейчас

Гиды по Google

Пошаговая настройка для основных AI-клиентов.

Настройка Google Docs

Прямо из определения коннектора: где взять учётные данные, какие права им нужны и с каким API работает этот адаптер. Предоставлено автором коннектора на английском языке.

Google Docs

This connector reads and edits Google Docs through the Google Docs API v1 (https://docs.googleapis.com/v1): it reads a document as plain text or as positioned blocks, creates documents, appends and inserts text and replaces text everywhere in a document. It works with personal Google accounts and Google Workspace, on every document the authorizing Google account can open.

Setup (one-time, about 10 minutes)

  1. Open https://console.cloud.google.com, pick or create a project, then APIs & Services → Library → enable Google Docs API.
  2. APIs & Services → OAuth consent screen: choose Internal if you are on Google Workspace (simplest), otherwise External. For External, set the publishing status to In production: while an app is in Testing, Google revokes its refresh tokens after 7 days and the connector stops working every week. For your own use, the "unverified app" warning can be clicked through.
  3. APIs & Services → Credentials → Create credentials → OAuth client ID → application type Web application → add the authorized redirect URI <your AnythingMCP URL>/api/mcp-oauth/callback (on AnythingMCP Cloud: https://cloud.anythingmcp.com/api/mcp-oauth/callback).
  4. Paste the client ID and secret into GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET and 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, Ads). Enable each API in that project, reuse the same GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET, and authorize each connector once: each one asks only for its own scopes.

Scope: the connector asks for https://www.googleapis.com/auth/documents (read and edit every document the user can open). It does not include Google Drive, so it cannot list, search, share or delete documents. For a read-only setup, change the scope to https://www.googleapis.com/auth/documents.readonly in the connector's OAuth settings, 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 per tool if the AI needs it.

Finding a document: the id is the long string in the link, https://docs.google.com/document/d/<id>/edit. To find one by name, use the Google Drive connector's gdrive_search_files with mimeType = 'application/vnd.google-apps.document' and name contains '...', or ask the user for the link.

Reading

  • gdocs_get_document_text returns title, revisionId and text: the body as plain text, paragraphs and table cells in order. Images, drawings, footnotes, headers, footers and formatting are left out.
  • gdocs_get_document_structure returns blocks, one per paragraph or table, with startIndex, endIndex, type, the paragraph style (TITLE, HEADING_1 to HEADING_6, NORMAL_TEXT) and its text. Use it to find where to insert.
  • Both read the document's first tab only and are cut at 200 KB. A document with several tabs, or a very long one, reads better through the Google Drive connector: gdrive_export_file with text/markdown or text/plain.

Editing

  • gdocs_append_text adds text at the end of the body; \n separates paragraphs (begin with \n to start a new paragraph).
  • gdocs_insert_text inserts at an index. Indexes count UTF-16 code units (an emoji counts 2) from 1, the start of the body; each paragraph ends with a newline that belongs to it. Insert before a block at its startIndex, or at the end of a paragraph at endIndex - 1. An index inside a table's structure, rather than inside a cell's paragraph, is refused. After an insert, later indexes shift by the inserted length: read the structure again before the next index-based edit, or work from the end of the document backwards.
  • gdocs_replace_all_text replaces every occurrence of a literal text, in every tab, header and footer; replace_with: "" deletes them. It is the reliable way to fill templates ([Customer name], <date>) and returns occurrencesChanged.
  • gdocs_batch_update (switched off) takes raw Docs API requests, e.g. deleteContentRange, updateTextStyle, updateParagraphStyle, createParagraphBullets, insertTable, insertPageBreak. Pass write_control {"requiredRevisionId": "<revisionId>"} from the last read to fail instead of editing a document someone changed in between.
  • gdocs_create_document takes only a title; the API ignores content on creation. The file lands in the root of My Drive.

Quotas: Google allows about 300 read and 60 write requests per minute per user (3,000 and 600 per project). Over the limit it answers 429 RESOURCE_EXHAUSTED: wait a minute and retry. Several edits in one gdocs_batch_update count as one write.

Common errors

  • 401: 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: the account cannot open (or cannot edit) that document, or the scope is read-only. 403 "Docs API has not been used in project": enable the Google Docs API in the Cloud project.
  • 404: the document id is wrong, or the id belongs to another file type (a Sheet or a Word file uploaded to Drive).
  • 400 Index N must be less than the end index of the referenced segment or must be inside the bounds of an existing paragraph: read the structure again and pick an index inside a paragraph.

Out of scope here: comments and suggestions, sharing, moving and deleting documents (Google Drive connector), and editing Word files stored in Drive.

Твой AI в двух кликах от Google Docs.

Установи коннектор, вставь учётные данные, спроси AI. 7 дней бесплатно, без карты.