Google Docs MCP Server
14 MCP tools for creating, editing, and sharing Google Docs using markdown. Template system, folder organisation, and PDF export.
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.
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:
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
Create, read, update, copy
Organise Drive
Permissions & access
Placeholder substitution
PDF download
Document info
Tool Reference
Full list of all 14 MCP tools available:
create_doc_from_markdownCreate a new Google Doc from markdown contentexport_doc_as_markdownExport an existing Google Doc as markdownupdate_doc_from_markdownReplace document content with new markdownlist_docsList recent documents or search by namecopy_docDuplicate a document with new titleTechnical Architecture
Built on Cloudflare’s edge computing stack:
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
- User authenticates with Google (grants API access)
- MCP client authenticates with server (establishes session)
- 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:
- Copy the template document
- Parse replacement key-value pairs
- Use Docs API batchUpdate for text replacement
- 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:
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_markdownCreated document: Q1 Planning - Meeting Notes URL: https://docs.google.com/document/d/1abc…/edit
Share it with the team as editors
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