Jez | Jeremy Dawes
Back to projects
mcp active

Google Docs MCP Server

14 MCP tools for creating, editing, and sharing Google Docs using markdown. Template system, folder organisation, and PDF export.

MCPCloudflare WorkersGoogle APIsTypeScriptOAuth 2.0

Overview

A production MCP server that gives AI agents full access to Google Docs and Drive. Create documents from markdown, fill templates with placeholders, manage folders, and control sharing - all through natural conversation with Claude.

14
MCP Tools
2
APIs Integrated
1 day
Build Time

The Problem

Working with Google Docs programmatically is painful:

  • OAuth complexity - Token refresh, scopes, consent screens
  • Two APIs - Docs API for content, Drive API for files/sharing
  • Format mismatch - Docs uses a complex JSON structure, not markdown
  • Template workflows - No simple placeholder substitution

Businesses need a way to let AI assistants create and manage documents without building custom integrations.

Solution

Built a complete MCP server that abstracts Google’s complexity behind simple, natural tools:

Key Feature

Markdown native - create and edit Google Docs using familiar markdown syntax. The server handles all format conversion automatically.

What Makes It Different

  • 14 Tools covering documents, folders, sharing, and templates
  • Markdown interchange - Write markdown, get Google Docs
  • Template system - Fill {{placeholders}} to generate documents
  • Full sharing control - Share with users or make public
  • PDF export - Get download URLs for archiving

Tool Categories

Documents5

Create, read, update, copy

Folders3

Organise Drive

Sharing3

Permissions & access

Templates1

Placeholder substitution

Export1

PDF download

Metadata1

Document info

Tool Reference

Full list of all 14 MCP tools available:

create_doc_from_markdownCreate a new Google Doc from markdown content
export_doc_as_markdownExport an existing Google Doc as markdown
update_doc_from_markdownReplace document content with new markdown
list_docsList recent documents or search by name
copy_docDuplicate a document with new title

Technical Architecture

Built on Cloudflare’s edge computing stack:

Cloudflare WorkersKV StorageGoogle Docs APIGoogle Drive APIOAuth 2.0

Key Technical Decisions

Markdown as Interchange Format

Google Docs uses a complex JSON structure internally. By using markdown as the interchange format, agents can work with familiar syntax while the server handles all conversion.

Dual OAuth Flow

  1. User authenticates with Google (grants API access)
  2. MCP client authenticates with server (establishes session)
  3. Tokens stored in KV with automatic refresh

Direct API Calls

Built using direct fetch() to Google APIs rather than SDKs. This ensures Workers compatibility and keeps the bundle small.

Template System

The fill_template tool copies a template document and replaces all {{placeholder}} markers:

  1. Copy the template document
  2. Parse replacement key-value pairs
  3. Use Docs API batchUpdate for text replacement
  4. Return the new document URL

Results

The server handles document automation workflows:

  • 14 tools covering the full Google Docs/Drive surface
  • 1-day build from concept to production
  • Edge deployed - low latency globally
  • Multi-tenant - each user connects their own Google account

Example Workflow

See how Claude handles document creation:

Document Creation Flow

Create a meeting notes document for our Q1 planning session with sections for attendees, agenda, and action items

I’ll create that document for you.

create_doc_from_markdown

Created document: Q1 Planning - Meeting Notes URL: https://docs.google.com/document/d/1abc…/edit

Share it with the team as editors

share_doc

Shared with team@company.com as editor.

Use Cases

Meeting Notes - Create structured documents from conversation, share with attendees

Contract Generation - Fill templates with client details, generate PDFs for signing

Report Automation - Generate weekly/monthly reports from data, distribute to stakeholders

Documentation - Create and organise technical docs in Drive folders

Interested in a similar solution?

Let's talk about your project