npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

docugen-mcp

v5.0.0

Published

DocGen - 100% COMPLETE Google Docs API - All 3 primary methods + 33 batch operations + helpers

Downloads

20

Readme

DocuGen MCP Server

License Node.js Version npm version TypeScript MCP Compatible Google APIs

Complete Google Docs automation for AI assistants. All 33 batch operations + tabs, suggestions, and analysis tools. 43+ operations total.

Features

Complete implementation with clean architecture:

  • All 33 Batch Operations - Every single Google Docs API batch operation
  • Tab Management - Full support for document tabs and nested tabs
  • Suggestions API - Create and manage suggested changes
  • Document Analysis - Extract structure, metrics, and content
  • Complete Table Operations - Insert/delete rows/columns, merge/unmerge cells
  • Style Management - Document, section, and custom styles
  • Error Handling - Exponential backoff retry logic
  • Performance Optimization - Document caching and batch queuing
  • UTF-16 Support - Accurate index calculations for all Unicode

Quick Start

Installation

# Run directly with npx
npx docugen-mcp

# Or install globally
npm install -g docugen-mcp

Setup (5 minutes)

  1. Get Google Cloud Credentials:

    • Go to Google Cloud Console
    • Create project, enable Docs & Drive APIs
    • Create OAuth 2.0 credentials (Desktop app)
    • Download credentials JSON
  2. Configure Your AI Assistant:

Claude Desktop:

{
  "mcpServers": {
    "docugen": {
      "command": "npx",
      "args": ["docugen-mcp"],
      "env": {
        "GOOGLE_OAUTH_PATH": "/path/to/credentials.json"
      }
    }
  }
}
  1. Start Using:
    • Restart your AI assistant
    • Test: "Create a new Google Doc"
    • Authenticate once when browser opens

Complete Tool List (70+ Operations)

Core Document Operations

  • create-document - Create with initial content
  • get-document - Retrieve with field masks
  • delete-document - Move to trash
  • analyze-document - Extract structure and metrics

Text Operations (Complete)

  • insert-text - Insert at multiple positions
  • delete-text - Delete content ranges
  • replace-all-text - Find and replace
  • move-text - Move between positions

Formatting (Complete)

  • update-text-style - Bold, italic, colors, fonts, links
  • update-paragraph-style - Headings, alignment, spacing, indentation
  • update-document-style - Document-wide styles
  • update-section-style - Section-specific styles

Tables (Complete)

  • insert-table - Create with content
  • insert-table-row - Add rows
  • insert-table-column - Add columns
  • delete-table-row - Remove rows
  • delete-table-column - Remove columns
  • update-table-cell-style - Style cells
  • update-table-row-style - Style rows
  • update-table-column-properties - Set widths
  • merge-table-cells - Merge cells
  • unmerge-table-cells - Split cells
  • pin-table-header-rows - Fix headers

Lists

  • create-paragraph-bullets - Bullet/numbered/checkbox lists
  • delete-paragraph-bullets - Remove list formatting

Images & Objects

  • insert-inline-image - Add from URLs
  • replace-image - Replace existing
  • delete-positioned-object - Remove images

Document Structure

  • insert-page-break - Page breaks
  • insert-section-break - Section breaks
  • create-header - Add headers
  • create-footer - Add footers
  • delete-header - Remove headers
  • delete-footer - Remove footers
  • create-footnote - Add footnotes

Named Ranges

  • create-named-range - Create ranges
  • delete-named-range - Remove ranges
  • replace-named-range-content - Replace content

Tab Management (New)

  • get-tabs - List all tabs
  • create-tab - Create new tab
  • delete-tab - Remove tab
  • rename-tab - Change title
  • move-tab - Reorder tabs
  • get-tab-content - Get specific tab

Suggestions API (New)

  • create-suggestion - Create suggested edits
  • list-suggestions - Get all suggestions
  • accept-suggestion - Accept changes
  • reject-suggestion - Reject changes
  • get-document-with-suggestions - View inline

Document Analysis (New)

  • extract-outline - Get structure
  • get-word-count - Statistics
  • find-all-links - Extract links
  • find-all-images - List images
  • find-all-tables - List tables
  • calculate-reading-time - Reading estimate

High-Level Workflows

  • create-report - Generate reports
  • create-resume - Build resumes
  • mail-merge - Bulk generation
  • convert-markdown - Import markdown
  • export-markdown - Export markdown

Batch Operations

  • batch-update - Execute any of 33 operations

Usage Examples

Complete Document Creation

// Create document
await createDocument({
  title: "Q4 2024 Report",
  content: "Executive Summary"
});

// Add sections (auto-sorted descending)
await insertText({
  documentId: "doc123",
  insertions: [
    { index: 100, text: "Results" },
    { index: 50, text: "Achievements" },
    { index: 150, text: "Outlook" }
  ]
});

// Create data table
await insertTable({
  documentId: "doc123",
  index: 200,
  rows: 4,
  columns: 3,
  content: [
    ["Metric", "Q3", "Q4"],
    ["Revenue", "$1.2M", "$1.5M"],
    ["Users", "10K", "15K"],
    ["Growth", "20%", "25%"]
  ]
});

// Style header row
await updateTableRowStyle({
  documentId: "doc123",
  tableStartIndex: 200,
  rowIndices: [0],
  backgroundColor: "#4285f4",
  foregroundColor: "#ffffff",
  bold: true
});

// Merge cells
await mergeTableCells({
  documentId: "doc123",
  tableStartIndex: 200,
  rowIndex: 3,
  columnIndex: 0,
  rowSpan: 1,
  columnSpan: 2
});

Tab Management

// Create tabs
await createTab({
  documentId: "doc123",
  title: "Technical Specs"
});

// Add content to specific tab
await insertText({
  documentId: "doc123",
  tabId: "tab-2",
  insertions: [
    { index: 1, text: "API Endpoints" }
  ]
});

Suggestions

// Create suggestion
await createSuggestion({
  documentId: "doc123",
  suggestionId: "sug-001",
  insertText: {
    index: 50,
    text: "Needs review"
  }
});

// Accept suggestion
await acceptSuggestion({
  documentId: "doc123",
  suggestionId: "sug-001"
});

Critical Implementation Details

1. Backward Ordering

Operations automatically sorted descending:

// Input: [10, 50, 100]
// Executed: 100 → 50 → 10

2. Table Cell Addressing

Zero-based indices with table start:

{
  tableCellLocation: {
    tableStartLocation: { index: 200 },
    rowIndex: 0,
    columnIndex: 1
  }
}

3. UTF-16 Encoding

Accurate character counting:

"Hello 😀" // 8 UTF-16 units, not 7

4. Error Handling

Automatic retry with exponential backoff for rate limits.

5. Performance

  • Document caching
  • Batch queuing (up to 100)
  • Field masks for efficiency

Architecture

DocuGen MCP Server v4.0
├── Core Systems
│   ├── Authentication (OAuth 2.0)
│   ├── Error Handling (Exponential Backoff)
│   ├── Document Cache
│   └── Batch Queue
├── Managers
│   ├── Document Manager
│   ├── Tab Manager
│   ├── Table Manager
│   ├── Style Manager
│   ├── Suggestion Manager
│   └── Named Range Manager
├── Utilities
│   ├── UTF-16 Calculator
│   ├── Index Validator
│   ├── Field Mask Builder
│   └── Batch Optimizer
└── MCP Interface
    ├── 33 Batch Operations
    ├── Tab Operations (10+)
    ├── Suggestion Operations (8+)
    ├── Analysis Operations (10+)
    └── High-Level Workflows (5+)

Why DocuGen is Production Ready

  1. Complete API Coverage - Every Google Docs API endpoint
  2. Clean Architecture - Single implementation, modular utilities
  3. Nothing Missing - All 33 operations + advanced features
  4. Production Ready - Error handling, caching, and retries
  5. Well Tested - All operations verified and working

For Organizations

Deploy for your entire team with one setup. Each employee maintains private access.

IT Setup (15 minutes)

  1. Create Google Cloud project
  2. Enable Docs & Drive APIs
  3. Create OAuth credentials
  4. Share configuration with team

Employee Setup (2 minutes)

  1. Add configuration to AI assistant
  2. Restart assistant
  3. Authenticate once
  4. Start creating documents

Support

Author

Created by Gautam Mandewalker

📍 Cumming, Forsyth County, Georgia, USA

🔗 GitHub | LinkedIn

License

Apache-2.0