Skip to content
MCP server

Google Docs MCP

Read, edit and export Google Docs from an AI app, by exact index range

Runs locallyStatus and history
Install
Pricing
Open source
Platforms
self-hosted
Runs
Locally
Version
1.1.2
Listing updated
today

Similar MCP servers

About Google Docs MCP

Google Docs MCP is an open-source MCP server for files and documents. It runs locally on your machine and is started by your AI client.

Edits are addressed by UTF-16 index ranges inside a document tab, and every insert or delete shifts the indexes that follow. The server therefore steers the assistant to re-read the text before each change and to work from the end of the document backwards, so a single paragraph can be replaced without disturbing the rest.

It is deliberately open about what the Docs API cannot do. Tabs can be read and targeted but not created, renamed or reordered. New comments cannot be anchored to a text range, so they attach at document level and can quote the passage they refer to. Replacing a whole body from Markdown is a separate, explicitly destructive step that drops comment anchors, headers, footers and extra tabs.

Exports to PDF, DOCX or Markdown are capped at 10 MB and leave out comments and suggestions. Inline images are fetched by Google from a public URL, so there is no way to upload an image file. The package runs locally over stdio with Node.js 20 or newer.

Install

Run in a terminal

claude mcp add mcp-google-docs --env GOOGLE_DOCS_CLIENT_SECRET='<GOOGLE_DOCS_CLIENT_SECRET>' --env GOOGLE_DOCS_REFRESH_TOKEN='<GOOGLE_DOCS_REFRESH_TOKEN>' --env GOOGLE_DOCS_ACCESS_TOKEN='<GOOGLE_DOCS_ACCESS_TOKEN>' -- npx -y @a1-x-tech/mcp-google-docs

Add to claude_desktop_config.json

{
  "mcpServers": {
    "mcp-google-docs": {
      "command": "npx",
      "args": [
        "-y",
        "@a1-x-tech/mcp-google-docs"
      ],
      "env": {
        "GOOGLE_DOCS_CLIENT_SECRET": "<GOOGLE_DOCS_CLIENT_SECRET>",
        "GOOGLE_DOCS_REFRESH_TOKEN": "<GOOGLE_DOCS_REFRESH_TOKEN>",
        "GOOGLE_DOCS_ACCESS_TOKEN": "<GOOGLE_DOCS_ACCESS_TOKEN>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "mcp-google-docs": {
      "command": "npx",
      "args": [
        "-y",
        "@a1-x-tech/mcp-google-docs"
      ],
      "env": {
        "GOOGLE_DOCS_CLIENT_SECRET": "<GOOGLE_DOCS_CLIENT_SECRET>",
        "GOOGLE_DOCS_REFRESH_TOKEN": "<GOOGLE_DOCS_REFRESH_TOKEN>",
        "GOOGLE_DOCS_ACCESS_TOKEN": "<GOOGLE_DOCS_ACCESS_TOKEN>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "mcp-google-docs": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@a1-x-tech/mcp-google-docs"
      ],
      "env": {
        "GOOGLE_DOCS_CLIENT_SECRET": "<GOOGLE_DOCS_CLIENT_SECRET>",
        "GOOGLE_DOCS_REFRESH_TOKEN": "<GOOGLE_DOCS_REFRESH_TOKEN>",
        "GOOGLE_DOCS_ACCESS_TOKEN": "<GOOGLE_DOCS_ACCESS_TOKEN>"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "mcp-google-docs": {
      "command": "npx",
      "args": [
        "-y",
        "@a1-x-tech/mcp-google-docs"
      ],
      "env": {
        "GOOGLE_DOCS_CLIENT_SECRET": "<GOOGLE_DOCS_CLIENT_SECRET>",
        "GOOGLE_DOCS_REFRESH_TOKEN": "<GOOGLE_DOCS_REFRESH_TOKEN>",
        "GOOGLE_DOCS_ACCESS_TOKEN": "<GOOGLE_DOCS_ACCESS_TOKEN>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "mcp-google-docs": {
      "command": "npx",
      "args": [
        "-y",
        "@a1-x-tech/mcp-google-docs"
      ],
      "env": {
        "GOOGLE_DOCS_CLIENT_SECRET": "<GOOGLE_DOCS_CLIENT_SECRET>",
        "GOOGLE_DOCS_REFRESH_TOKEN": "<GOOGLE_DOCS_REFRESH_TOKEN>",
        "GOOGLE_DOCS_ACCESS_TOKEN": "<GOOGLE_DOCS_ACCESS_TOKEN>"
      }
    }
  }
}

Using several servers? Build one config file with the MCP config generator.

Configuration

  • GOOGLE_DOCS_CLIENT_IDGoogle OAuth2 client id (refresh-token flow).
  • GOOGLE_DOCS_CLIENT_SECRETGoogle OAuth2 client secret (refresh-token flow). Treat it as a secret.
  • GOOGLE_DOCS_REFRESH_TOKENGoogle OAuth2 refresh token, exchanged for access tokens automatically. Treat it as a secret.
  • GOOGLE_DOCS_ACCESS_TOKENStatic OAuth2 access token (~1h lifetime) — alternative to the refresh-token trio, mostly for testing.
  • GOOGLE_DOCS_OAUTH_PORTFixed port for the loopback listener of the in-chat login (127.0.0.1 + PKCE). Set it when the client runs over SSH port forwarding; otherwise a free port is picked per login.
  • GOOGLE_DOCS_API_BASEDocs API root override.
  • GOOGLE_DOCS_DRIVE_API_BASEDrive API root override (markdown import/export, document export, comments).
  • GOOGLE_DOCS_TIMEOUT_MSPer-request timeout in milliseconds.
  • GOOGLE_DOCS_MAX_RETRIESRetries on transient errors (429 always; 5xx/network for reads).

Tools this server provides (3)

Taken from the project documentation; the running server may differ.

create_document
Creates an empty document or one converted from Markdown.
read_document_text
Reads the document text with fresh indexes for editing.
import_markdown
Replaces the entire document body from Markdown.

What it does

27 document tools
Read as text, structure or Markdown, edit ranges, style text, manage lists, tables, breaks and images.
Comment threads
List, reply to, resolve and add document-level comments.
Markdown both ways
Create a document from Markdown or export to Markdown, PDF and DOCX.
Connect from chat
An in-chat OAuth login with PKCE on 127.0.0.1 stores the tokens itself.
No general Drive access
Drive endpoints are used only for export, conversion and comments.

Good for

  • Summarize a document together with its open comment threads
  • Replace one paragraph without touching the rest of the file
  • Create meeting notes from Markdown
  • Export a spec to PDF or DOCX
  • Insert a table and fill in its header row

Pricing

Open source

Runs locally from npm; you supply your own Google OAuth client

Google Docs MCP FAQ

Can it create or rename tabs?

No. Tabs can be read and targeted, but the Docs API cannot create, rename, delete or reorder them.

Does it expose general Drive access?

No. It uses Drive endpoints internally for export, Markdown conversion and comments, but offers no general-purpose Drive tool.

What does a Markdown import do to an existing document?

It replaces the entire body, so comment anchors, positioned objects, headers, footers and extra tabs do not survive.

How do I sign in to Google?

You can say "connect" in the chat and the server walks you through creating an OAuth client and approving access, or you can supply a client id, client secret and refresh token as environment variables.

Is Google Docs MCP free?

Yes. Google Docs MCP is open source, so you can use and self-host it for free.

How do I add Google Docs MCP to Claude Code?

Run this command in your terminal: claude mcp add mcp-google-docs --env GOOGLE_DOCS_CLIENT_SECRET='<GOOGLE_DOCS_CLIENT_SECRET>' --env GOOGLE_DOCS_REFRESH_TOKEN='<GOOGLE_DOCS_REFRESH_TOKEN>' --env GOOGLE_DOCS_ACCESS_TOKEN='<GOOGLE_DOCS_ACCESS_TOKEN>' -- npx -y @a1-x-tech/mcp-google-docs

What are the best alternatives to Google Docs MCP?

The closest alternatives to Google Docs MCP are Ha MCP, Concord MCP, note1, SSRS2 and Csv.

Where this comes from

  • Description: written from the project's README.
  • Install steps: from the official MCP Registry entry.

How AIPoweredBot checks servers