Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/dvlpjrs/guMCP/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The Google Docs server enables AI agents to create, read, and modify Google Docs documents. It provides tools for document creation, content appending, and full document updates.

Prerequisites

  • Python 3.11+
  • A Google Cloud Project with Google Drive and Google Docs APIs enabled
  • OAuth 2.0 credentials with scopes:
    • https://www.googleapis.com/auth/drive.file
    • https://www.googleapis.com/auth/documents

Authentication

Setup OAuth Credentials

  1. Create a new Google Cloud project
  2. Enable the Google Drive API and Google Docs API
  3. Configure an OAuth consent screen
  4. Add OAuth scopes (see above)
  5. Create an OAuth Client ID for “Desktop App”
  6. Save credentials as local_auth/oauth_configs/gdocs/oauth.json

Authenticate

python src/servers/gdocs/main.py auth

Available Tools

Description: Search for Google Docs in your DriveParameters:
  • query (string, required): Search query
Example:
{
  "query": "project proposal"
}
Returns: List of matching documents with IDs and metadata
Description: Create a new Google Doc with initial contentParameters:
  • title (string, required): Document title
  • content (string, required): Initial document content
Example:
{
  "title": "Project Proposal",
  "content": "# Introduction\n\nThis proposal outlines..."
}
Returns: Document ID and shareable link
Description: Append content to the end of an existing documentParameters:
  • doc_id (string, required): Document ID
  • content (string, required): Content to append
Example:
{
  "doc_id": "abc123xyz789",
  "content": "\n\n## Additional Section\n\nNew content here..."
}
Returns: Confirmation with document link
Description: Replace all content in a document with new contentParameters:
  • doc_id (string, required): Document ID
  • content (string, required): New document content
Example:
{
  "doc_id": "abc123xyz789",
  "content": "# Updated Document\n\nCompletely new content..."
}
Returns: Confirmation with document link

Resources

The Google Docs server provides access to document resources:

List Resources

Lists Google Docs documents from your Drive (up to 20 at a time). URI Format: gdocs:///{document_id}

Read Resource

Reads the full text content of a document, extracting:
  • Paragraphs
  • Tables
  • Table of contents
  • All text elements

Usage Examples

Creating and Editing Documents

# Create a new document
result = await call_tool("create_doc", {
    "title": "Meeting Notes - January 2024",
    "content": "# Meeting Notes\n\nDate: January 15, 2024\n\n## Attendees\n- Alice\n- Bob\n\n## Agenda\n1. Project updates\n2. Q1 planning"
})

doc_id = result["id"]

# Append new content
await call_tool("append_to_doc", {
    "doc_id": doc_id,
    "content": "\n\n## Action Items\n- [ ] Review proposal\n- [ ] Schedule follow-up"
})

Searching and Reading Documents

# Search for documents
docs = await call_tool("search_docs", {
    "query": "quarterly report 2024"
})

# Read a document by its URI
content = await read_resource(f"gdocs:///{docs[0]['id']}")
print(content)

Updating Documents

# Completely replace document content
await call_tool("update_doc", {
    "doc_id": "abc123xyz789",
    "content": "# Updated Report\n\nThis is the revised version of the report..."
})

Document ID vs URL

You can extract a document ID from its URL: URL: https://docs.google.com/document/d/abc123xyz789/edit Document ID: abc123xyz789

Running the Server

Local Development

python src/servers/local.py --server gdocs --user-id local

Best Practices

  1. Document structure: Use markdown-style formatting in content
  2. Append vs Update: Use append_to_doc to add sections, update_doc to rewrite
  3. Search first: Use search_docs to find existing documents before creating new ones
  4. Permissions: Documents are created with your default sharing settings

API Reference

ToolPurposeCommon Use Cases
search_docsFind documentsLocate existing docs
create_docCreate documentInitialize new docs
append_to_docAdd contentLog entries, add sections
update_docReplace contentFull rewrites

Limitations

  • Plain text only (no rich formatting preservation)
  • No image embedding support
  • Tables and complex structures are extracted as text

Build docs developers (and LLMs) love