Skip to main content
Glama
README.md
# gdocs-mcp-server

An MCP (Model Context Protocol) server for reading and editing Google Docs.

## Tools

- `read_document` — read the full text content of a Google Doc
- `edit_document` — replace the full content of a Google Doc
- `append_to_document` — add content to the end of a Google Doc
- `insert_after_heading` — insert content after a named heading
- `style_preserving_rewrite` — rewrite a doc's content while preserving its existing paragraph/text styles
- `debug_styles` — dump the raw, unprocessed per-paragraph style data for a doc, straight from the Docs API

## Setup

1. Create a Google Cloud project, enable the Google Docs API, and create an OAuth 2.0 Client ID
   (Desktop app type). Download the client secret JSON and save it in this directory as
   `credentials.json`.
2. Install dependencies into a virtualenv:
   ```
   python3 -m venv venv
   ./venv/bin/pip install -r requirements.txt
   ```
3. Run the one-time auth flow to generate `token.json`:
   ```
   ./venv/bin/python auth.py
   ```
4. Point your MCP client at `server.py` (e.g. via `./venv/bin/python server.py`).

`credentials.json` and `token.json` are gitignored — never commit them, they grant access to
your Google account.