Skip to main content
Glama
Google Docs MCP Proxy

Google Docs MCP Proxy

by dsingh80

Google Docs MCP Proxy

A local stdio MCP server that handles Google OAuth2 locally and proxies authenticated requests to the Google Docs and Google Drive REST APIs.

This solves the problem where Cursor cannot complete OAuth for Google's hosted Workspace MCP servers (Google does not support the cursor:// redirect protocol).

Architecture

Cursor Agent ──stdio JSON-RPC──► Local MCP Server ──Bearer──► docs.googleapis.com
                                        │                  └──► drive.googleapis.com
                                        └──► OAuth2 Token Manager ──► Google OAuth

Related MCP server: gdocs-mcp

Prerequisites

  1. A Google Cloud project with:

    • Google Docs API enabled

    • Google Drive API enabled

    • OAuth consent screen configured with scopes:

      • https://www.googleapis.com/auth/documents

      • https://www.googleapis.com/auth/drive

    • OAuth 2.0 client of type Desktop app (not Web application) — Desktop app clients allow http://127.0.0.1 redirects without pre-registration

  2. Node.js 18+

Setup

1. Install dependencies

npm install

2. Configure environment

cp .env.example .env

Edit .env and fill in your OAuth client credentials from Google Cloud Console:

GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-client-secret

3. Authorize (one-time)

npm run auth

This opens your browser to Google's consent screen, completes the OAuth2 flow, and saves tokens to token.json (gitignored). You only need to do this once — tokens refresh automatically.

Headless alternative: Set GOOGLE_REFRESH_TOKEN=<your-refresh-token> in .env to skip the interactive flow entirely.

4. Add to Cursor's mcp.json

Add the following entry to ~/.cursor/mcp.json (under mcpServers):

"google-docs": {
  "command": "node",
  "args": [
    "D:\\Documents\\_Projects\\google-docs-mcp\\node_modules\\tsx\\dist\\cli.mjs",
    "D:\\Documents\\_Projects\\google-docs-mcp\\src\\index.ts"
  ]
}

Restart Cursor after saving.

MCP Tools

google_docs_request

Make any request to the Google Docs REST API.

Parameter

Type

Description

path

string

Path after /v1/, e.g. documents/{id}:batchUpdate

method

GET | POST | PATCH | PUT | DELETE

HTTP method

body

object (optional)

JSON request body

query

object (optional)

Query string params (string values)

Examples:

Create a document:

{ "path": "documents", "method": "POST", "body": { "title": "My New Doc" } }

Read a document:

{ "path": "documents/DOC_ID", "method": "GET" }

Insert text via batchUpdate:

{
  "path": "documents/DOC_ID:batchUpdate",
  "method": "POST",
  "body": {
    "requests": [
      { "insertText": { "text": "Hello world\n", "location": { "index": 1 } } }
    ]
  }
}

google_drive_request

Make any request to the Google Drive REST API v3.

Same parameters; base URL is https://www.googleapis.com/drive/v3/.

Examples:

List files:

{ "path": "files", "method": "GET", "query": { "pageSize": "10" } }

Search for docs:

{
  "path": "files",
  "method": "GET",
  "query": { "q": "mimeType='application/vnd.google-apps.document'", "pageSize": "5" }
}

Development

npm run dev    # tsx --watch (hot reload)
npm start      # run once
npm run auth   # re-authorize (if tokens are revoked)

Security notes

  • .env and token.json are gitignored — never commit them

  • OAuth credentials live in the project .env, not in global mcp.json

  • Token refresh happens automatically via native fetch; no manual intervention needed after initial auth

Available Tools

2 tools
google_docs_requestA

Make an authenticated request to the Google Docs REST API (https://docs.googleapis.com/v1/). Supports creating documents (POST documents), reading (GET documents/{id}), and editing via batchUpdate (POST documents/{id}:batchUpdate).

Inputs: path (required), method (required), body, query.

google_drive_requestB

Make an authenticated request to the Google Drive REST API (https://www.googleapis.com/drive/v3/). Supports listing files (GET files), fetching metadata (GET files/{id}), creating/moving/deleting files, and managing permissions.

Inputs: path (required), method (required), body, query.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 2 tools

    Disambiguation3/5

    The two tools are separated by target API (Docs v1 vs Drive v3), but their descriptions are structurally identical ('make an authenticated request') and the domains genuinely overlap — a document can be created via Docs documents.create or Drive files.create with a Docs mimeType. An agent may hesitate about which surface to use for document-level operations, though the descriptions do name their services clearly.

    Naming Consistency5/5

    Both tools follow the exact same pattern: google_<service>_request. Perfectly predictable and the name immediately telegraphs both the target service and the passthrough nature of the operation.

    Tool Count3/5

    Two generic passthrough tools are a legitimate design for an API proxy, since each one fans out to many endpoints. However, with only two tools the surface feels thin and gives no affordance for common higher-level operations, so it sits at the borderline.

    Completeness4/5

    Because both tools expose the full underlying REST surfaces (Docs documents/get/batchUpdate, Drive files/permissions CRUD), essentially any lifecycle operation is reachable. The gap is convenience and guardrails — no schema hints, batching helpers, or export/convert operations — but an agent can work around this by constructing raw requests.

    Related MCP Connectors

    Related MCP Servers