# google-docs

Lets your coding agent work with Google Docs: read, create, edit, delete and export files, authorized through OAuth2 or a Workspace service account.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 81
- Author: pulsemcp
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/pulsemcp/mcp-servers/tree/HEAD/experimental/google-docs
- Updated: 2026-10-09
- HTML: https://affpapa.org/en/nevibecode/mcp/google-docs

## What it does

The server talks to Google Docs through the Docs and Drive APIs. An agent can pull a document's full body or only its heading outline, given an ID or a shareable link. It can start a new doc with seeded text, append to the end, insert at a chosen index, swap every occurrence of a string, or send raw `documents.batchUpdate` calls when you need structural changes. Deleting is available too: to Drive trash by default, permanently when you say so.

Export covers Markdown, HTML, plain text, PDF, DOCX, ODT, RTF and EPUB. Sharing is gated behind its own tool group.

Two auth paths. A personal `@gmail.com` account needs OAuth2 credentials of the Desktop app kind, created after you publish the consent screen, plus a refresh token from `npx google-docs-workspace-mcp-server oauth-setup <client_id> <client_secret>`. Inside Google Workspace, a service account with domain-wide delegation and the `documents` and `drive` scopes does the job. Leaving the consent screen unpublished caps the refresh token at seven days, so you redo the setup; editing tool access goes through `GOOGLE_DOCS_ENABLED_TOOLGROUPS`.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `GOOGLE_DOCS_OAUTH_CLIENT_ID`, `GOOGLE_DOCS_OAUTH_CLIENT_SECRET`, `GOOGLE_DOCS_OAUTH_REFRESH_TOKEN`, `GOOGLE_DOCS_SERVICE_ACCOUNT_CLIENT_EMAIL`, `GOOGLE_DOCS_SERVICE_ACCOUNT_PRIVATE_KEY`, `GOOGLE_DOCS_IMPERSONATE_EMAIL`, `GOOGLE_DOCS_ENABLED_TOOLGROUPS` — keys and tokens: ask the human for the values, never commit them or put them in shared files.
- Works with: Google Workspace

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env GOOGLE_DOCS_OAUTH_CLIENT_ID=<GOOGLE_DOCS_OAUTH_CLIENT_ID> --env GOOGLE_DOCS_OAUTH_CLIENT_SECRET=<GOOGLE_DOCS_OAUTH_CLIENT_SECRET> --env GOOGLE_DOCS_OAUTH_REFRESH_TOKEN=<GOOGLE_DOCS_OAUTH_REFRESH_TOKEN> --env GOOGLE_DOCS_SERVICE_ACCOUNT_CLIENT_EMAIL=<GOOGLE_DOCS_SERVICE_ACCOUNT_CLIENT_EMAIL> --env GOOGLE_DOCS_SERVICE_ACCOUNT_PRIVATE_KEY=<GOOGLE_DOCS_SERVICE_ACCOUNT_PRIVATE_KEY> --transport stdio google-docs -- npx -y google-docs-workspace-mcp-server
```
Replace <…> with your own values. 2 more environment variables are in the server README

### Codex

**Platform CLI**
```bash
codex mcp add google-docs --env GOOGLE_DOCS_OAUTH_CLIENT_ID=<GOOGLE_DOCS_OAUTH_CLIENT_ID> --env GOOGLE_DOCS_OAUTH_CLIENT_SECRET=<GOOGLE_DOCS_OAUTH_CLIENT_SECRET> --env GOOGLE_DOCS_OAUTH_REFRESH_TOKEN=<GOOGLE_DOCS_OAUTH_REFRESH_TOKEN> --env GOOGLE_DOCS_SERVICE_ACCOUNT_CLIENT_EMAIL=<GOOGLE_DOCS_SERVICE_ACCOUNT_CLIENT_EMAIL> --env GOOGLE_DOCS_SERVICE_ACCOUNT_PRIVATE_KEY=<GOOGLE_DOCS_SERVICE_ACCOUNT_PRIVATE_KEY> -- npx -y google-docs-workspace-mcp-server
```
Replace <…> with your own values. 2 more environment variables are in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "google-docs": {
            "command": "npx",
            "args": [
                "-y",
                "google-docs-workspace-mcp-server"
            ],
            "env": {
                "GOOGLE_DOCS_OAUTH_CLIENT_ID": "<GOOGLE_DOCS_OAUTH_CLIENT_ID>",
                "GOOGLE_DOCS_OAUTH_CLIENT_SECRET": "<GOOGLE_DOCS_OAUTH_CLIENT_SECRET>",
                "GOOGLE_DOCS_OAUTH_REFRESH_TOKEN": "<GOOGLE_DOCS_OAUTH_REFRESH_TOKEN>",
                "GOOGLE_DOCS_SERVICE_ACCOUNT_CLIENT_EMAIL": "<GOOGLE_DOCS_SERVICE_ACCOUNT_CLIENT_EMAIL>",
                "GOOGLE_DOCS_SERVICE_ACCOUNT_PRIVATE_KEY": "<GOOGLE_DOCS_SERVICE_ACCOUNT_PRIVATE_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values. 2 more environment variables are in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "google-docs": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "google-docs-workspace-mcp-server"
            ],
            "env": {
                "GOOGLE_DOCS_OAUTH_CLIENT_ID": "<GOOGLE_DOCS_OAUTH_CLIENT_ID>",
                "GOOGLE_DOCS_OAUTH_CLIENT_SECRET": "<GOOGLE_DOCS_OAUTH_CLIENT_SECRET>",
                "GOOGLE_DOCS_OAUTH_REFRESH_TOKEN": "<GOOGLE_DOCS_OAUTH_REFRESH_TOKEN>",
                "GOOGLE_DOCS_SERVICE_ACCOUNT_CLIENT_EMAIL": "<GOOGLE_DOCS_SERVICE_ACCOUNT_CLIENT_EMAIL>",
                "GOOGLE_DOCS_SERVICE_ACCOUNT_PRIVATE_KEY": "<GOOGLE_DOCS_SERVICE_ACCOUNT_PRIVATE_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values. 2 more environment variables are in the server README

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e GOOGLE_DOCS_OAUTH_CLIENT_ID=<GOOGLE_DOCS_OAUTH_CLIENT_ID> -e GOOGLE_DOCS_OAUTH_CLIENT_SECRET=<GOOGLE_DOCS_OAUTH_CLIENT_SECRET> -e GOOGLE_DOCS_OAUTH_REFRESH_TOKEN=<GOOGLE_DOCS_OAUTH_REFRESH_TOKEN> -e GOOGLE_DOCS_SERVICE_ACCOUNT_CLIENT_EMAIL=<GOOGLE_DOCS_SERVICE_ACCOUNT_CLIENT_EMAIL> -e GOOGLE_DOCS_SERVICE_ACCOUNT_PRIVATE_KEY=<GOOGLE_DOCS_SERVICE_ACCOUNT_PRIVATE_KEY> google-docs npx -y google-docs-workspace-mcp-server
```
Replace <…> with your own values. 2 more environment variables are in the server README

## When to use it
- pull a Google Doc's text or outline from a link
- create a doc and append a draft to it
- swap every occurrence of a string in a doc
- export a doc to Markdown or PDF
- give a teammate or group access to a doc

## Example prompts
- Read the outline of the doc at this link and show me its structure
- Create a Google Doc with these release notes and export it to Markdown
- Replace every mention of the old product name in that document

## Similar
- [Excel MCP Server](https://affpapa.org/en/nevibecode/mcp/excel-mcp-server.md) — MCP server · ★ 4259
- [kordoc](https://affpapa.org/en/nevibecode/mcp/kordoc.md) — MCP server · ★ 2726
- [Power BI Authoring MCP Server (Local)](https://affpapa.org/en/nevibecode/mcp/power-bi-authoring-mcp-server-local.md) — MCP server · ★ 1247
- [Microsoft 365 MCP Server](https://affpapa.org/en/nevibecode/mcp/microsoft-365-mcp-server.md) — MCP server · ★ 1074
- [anymd](https://affpapa.org/en/nevibecode/mcp/anymd.md) — MCP server · ★ 1051
- [Docling MCP](https://affpapa.org/en/nevibecode/mcp/docling-mcp.md) — MCP server · ★ 777

From the same set: [pulsemcp/mcp-servers](https://affpapa.org/en/nevibecode/by/pulsemcp/mcp-servers.md) — 9 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
