Skip to main content

Stdio-first Google Docs and Drive MCP server with local browser OAuth and 100 tools

Project description

Google Docs MCP Server

An open-source, stdio-first MCP server exposing 100 Google Docs and Drive tools.

User experience

End users do not need their own Google Cloud project. The published package uses this project's public Desktop OAuth client identity. Each user signs into their own Google account and stores a separate token only on their own machine.

User prompt → AI client → local stdio MCP server
            → user's local OAuth token → user's Google Docs

The publisher does not receive user tokens or document content in local stdio mode.

Install and authenticate

After publication:

uvx --from google-docs-mcp-server-ahmedlaminou google-docs-mcp-auth login

The browser consent flow stores the token in:

  • Windows: %APPDATA%\GoogleDocsMCP\token.json
  • macOS: ~/Library/Application Support/GoogleDocsMCP/token.json
  • Linux: ~/.config/google-docs-mcp/token.json

Useful commands:

google-docs-mcp-auth status
google-docs-mcp-auth logout

Optional reliability settings:

$env:GOOGLE_DOCS_MCP_HTTP_TIMEOUT = "60"
$env:GOOGLE_DOCS_MCP_API_RETRIES = "2"

MCP client

{
  "mcpServers": {
    "google-docs": {
      "command": "uvx",
      "args": [
        "--from",
        "google-docs-mcp-server-ahmedlaminou",
        "google-docs-mcp-server"
      ]
    }
  }
}

The VS Code extension registers this stdio server automatically.

Permission profiles

The public/default profile requests:

  • documents — read and edit Google Docs.
  • drive.file — Drive operations for files created by or explicitly opened with the app.

This avoids the restricted full-Drive scope. Broad Drive listing/search and permission operations therefore only see files available to drive.file.

Self-hosters can intentionally opt into restricted full-Drive access:

$env:GOOGLE_DOCS_MCP_SCOPE_PROFILE = "full"
google-docs-mcp-auth login --full-drive

Developer setup

python -m venv venv
.\venv\Scripts\Activate.ps1
pip install -e .
google-docs-mcp-auth login
google-docs-mcp-server

Before a public release, the maintainer must create a Google OAuth client of type Desktop app and save its downloaded JSON as:

google_docs_mcp_server/oauth_client.json

Desktop OAuth clients are public clients: their client identifier and nominal client secret cannot be kept confidential in a distributed/open-source desktop application. User refresh tokens remain private on each user's machine.

Self-hosters can instead put their own OAuth JSON at %APPDATA%\GoogleDocsMCP\oauth_client.json or set GOOGLE_CREDENTIALS_FILE.

Optional hosted mode

FastAPI/SSE remains available:

google-docs-mcp-web

It is not the default public architecture because true multi-user hosting requires per-user sessions and secure server-side token storage.

Capabilities

  • Document creation, rename, copy, trash/restore, metadata, folders, permissions, revisions, and multi-format export.
  • Reading text, ranges, headings, footnotes, links, tables, images, structure, named ranges, and document tabs.
  • Text, lists, links, images, headers, footers, footnotes, sections, tables, table rows/columns, and tab insertion.
  • Rich formatting, comments/replies, named ranges, page setup, and raw batch updates.

Image generation remains provider-neutral: an AI client may generate an image with any capable model or service, then pass its public URL to insert_external_image or replace_image.

See docs/TOOLS_REFERENCE.md.

Verification

python -m unittest discover -s tests -v
python -m compileall google_docs_mcp_server
python tests/smoke_stdio.py

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

google_docs_mcp_server_ahmedlaminou-0.3.0.tar.gz (26.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file google_docs_mcp_server_ahmedlaminou-0.3.0.tar.gz.

File metadata

File hashes

Hashes for google_docs_mcp_server_ahmedlaminou-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e350166fdd654d8b0a794b7db9f2b492ebc92242b8d664129ad072d2f76959c0
MD5 ab778f1405da4ef9e7212ff9a142eeb8
BLAKE2b-256 c4b11e8cf9b64a70dab4253efdef09da974cb04fadac3141cd94640b41ab6639

See more details on using hashes here.

File details

Details for the file google_docs_mcp_server_ahmedlaminou-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for google_docs_mcp_server_ahmedlaminou-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12e5c80feae5685df88c42adbe36147b845323ba9d5bb42247ec524f730b2e89
MD5 489f92d7f92fdee55554e726e2462501
BLAKE2b-256 ff0bd66744499c21cc2a467b6d329c5dce389aef411651f987e59dc8937d97d4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page