Get the FREE Ultimate OpenClaw Setup Guide →

google-docs

Google Docs MCP server with full tab support — service account auth, domain-wide delegation, markdown extraction

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio gigabrainobserver-google-docs-mcp-server uvx google-docs-mcp-server \
  --env SUBJECT_EMAIL="Email of the Workspace user to impersonate" \
  --env SERVICE_ACCOUNT_PATH="Path to the service account JSON key file"

How to use

This MCP server provides a Google Docs integration with full tab support, enabling you to interact with documents at the level of individual tabs and their content. Core tools include list_tabs (to enumerate all tabs, including nested ones), read_document (to extract a tab or the entire document as Markdown with proper heading structure), get_document_info (to fetch lightweight metadata such as title, ID, link, and tab list), create_document (to create a new document with optional initial text), and editing tools like append_text, insert_text, and replace_text. For more advanced formatting and structure changes, batch_update exposes the Google Docs API’s batchUpdate capabilities, while list_documents lets you search Drive for documents by name. All tab-targeting tools accept either tab_id or tab_title, case-insensitive, and batch_update will auto-inject tabId into requests.

How to install

Prerequisites:

  • Python 3.11+
  • Access to a Google Cloud project with Google Docs API and Google Drive API enabled
  • A Google Cloud service account with domain-wide delegation (and a JSON key)

Install the MCP server package from PyPI:

pip install google-docs-mcp-server

Or run directly with uv:

uvx google-docs-mcp-server

Configure the MCP client to run this server (example shown in the README):

{
  "mcpServers": {
    "google-docs": {
      "command": "uvx",
      "args": ["google-docs-mcp-server"],
      "env": {
        "SERVICE_ACCOUNT_PATH": "/path/to/your-service-account-key.json",
        "SUBJECT_EMAIL": "you@yourdomain.com"
      }
    }
  }
}

Ensure you have the prerequisites set up (see the README) before starting the server.

Additional notes

Environment considerations:

Common issues:

  • Incorrect service account permissions or missing domain-wide delegation results in authorization errors.
  • If tabs content is not visible, ensure you’re using includeTabsContent in the requests on the client side and that the API supports tab content for the document version you’re targeting.
  • When running under uvx, ensure the path to the server executable aligns with your installed package and entry point.

Configuration tips:

  • Keep SERVICE_ACCOUNT_PATH and SUBJECT_EMAIL secure; do not commit to version control.
  • You can store configuration in MCP client files (e.g., ~/.claude/mcp.json) as shown in the README example.

Related MCP Servers

Sponsor this space

Reach thousands of developers