Google Docs & Drive MCP Server
Enables comprehensive interaction with Google Docs and Google Drive through AI assistants, supporting document reading/writing, rich formatting, table/image insertion, comment management, and complete file/folder operations with secure OAuth authentication.
README
GoogleDocsMCP - AgenticLedger Platform
Google Docs & Drive MCP Server
Production-ready MCP server providing comprehensive Google Docs and Drive integration for the AgenticLedger AI Agent Platform.
🚀 Features
- 30+ Production-Ready Tools - Document editing, formatting, comments, Drive file operations
- OAuth 2.0 Authentication - Secure user-based authorization with automatic token refresh
- Multi-Tab Document Support - Work with new Google Docs multi-tab feature
- Rich Text Formatting - Bold, italic, colors, fonts, paragraph styles, named styles
- Comment Management - Full CRUD operations on document comments
- Google Drive Integration - List, search, create, move, copy, delete documents
- Type-Safe - Full TypeScript with Zod schema validation
- 100% Documented - Comprehensive guides for developers and AI agents
📦 Quick Start
Installation
# Clone repository
git clone https://github.com/oregpt/Agenticledger_MCP_DocsOnly.git
cd Agenticledger_MCP_DocsOnly
# Install dependencies
npm install
# Build
npm run build
Authentication Setup
- Create Google Cloud Project (see GOOGLE_CLOUD_SETUP.md)
- Enable Google Docs API + Google Drive API
- Configure OAuth Consent Screen
- Create OAuth 2.0 credentials and download
credentials.json - Place
credentials.jsonin this directory - Run first-time authorization:
node dist/server.js
# Follow OAuth flow in browser
# token.json will be created automatically
Run Tests
npm run test:integration
🛠️ Available Tools (30+)
<details> <summary><b>Document Access & Editing (5 tools)</b></summary>
readGoogleDoc- Read document (text/json/markdown formats)appendToGoogleDoc- Append text to end of documentinsertText- Insert text at specific indexdeleteRange- Delete content rangelistDocumentTabs- List tabs in multi-tab documents
</details>
<details> <summary><b>Formatting & Styling (3 tools)</b></summary>
applyTextStyle- Character-level formatting (bold, colors, fonts)applyParagraphStyle- Paragraph formatting (alignment, spacing, styles)formatMatchingText- Legacy formatting tool
</details>
<details> <summary><b>Document Structure (4 tools)</b></summary>
insertTable- Create tablesinsertPageBreak- Insert page breaksinsertImageFromUrl- Insert image from URLinsertLocalImage- Upload and insert local image
</details>
<details> <summary><b>Comment Management (6 tools)</b></summary>
listComments- List all document commentsgetComment- Get specific comment detailsaddComment- Create comment anchored to textreplyToComment- Reply to existing commentresolveComment- Mark comment as resolveddeleteComment- Remove comment
</details>
<details> <summary><b>Google Drive Integration (12 tools)</b></summary>
listGoogleDocs- List all documentssearchGoogleDocs- Search documents by name/contentgetRecentGoogleDocs- Get recently modified documentsgetDocumentInfo- Get file metadatacreateDocument- Create new documentcreateFromTemplate- Create from templatecreateFolder- Create Drive folderlistFolderContents- List folder filesgetFolderInfo- Get folder metadatamoveFile- Move to different foldercopyFile- Create copyrenameFile- Rename documentdeleteFile- Delete (move to trash)
</details>
📖 Documentation
For Developers
- README_AGENTICLEDGER.md - Complete integration guide
- PLATFORM_INTEGRATION_REPORT.md - Detailed tool documentation with API tests
- GOOGLE_CLOUD_SETUP.md - Step-by-step OAuth 2.0 setup
- CLAUDE.md - Advanced implementation details
For AI Agents
- ABILITIES_LIMITATIONS.md - Smart workarounds, best practices, index management
Example Files
credentials.example.json- OAuth credentials formattoken.example.json- Token format exampletest-integration.ts- Integration test suite
💡 Example Usage
Read Document
const result = await readGoogleDoc({
documentId: "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
format: "text" // or "json" or "markdown"
});
Append Text
await appendToGoogleDoc({
documentId: "1BxiMVs0XRA...",
textToAppend: "\n\nNew section added by AI Agent"
});
Apply Formatting
await applyTextStyle({
documentId: "1BxiMVs0XRA...",
target: {
textToFind: "Important Note",
matchInstance: 1
},
style: {
bold: true,
foregroundColor: "#FF0000",
fontSize: 14
}
});
Create Document
const newDoc = await createDocument({
title: "AI Generated Report",
folderId: "your-folder-id"
});
Work with Multi-Tab Documents
// List tabs
const tabs = await listDocumentTabs({
documentId: "1BxiMVs0XRA..."
});
// Read specific tab
await readGoogleDoc({
documentId: "1BxiMVs0XRA...",
tabId: tabs.data.tabs[0].tabId
});
🔐 Security
- Never commit credentials (
credentials.json,token.json) - OAuth tokens expire after 1 hour (auto-refresh handled)
- Revoke access at https://myaccount.google.com/permissions
- User-based authentication - only accesses user's documents
- Monitor usage in Google Cloud Console
📊 Performance
- Average Response Time: 725ms per operation (includes Drive API)
- Document Read: ~300ms (fast, cached by Google)
- Text Editing: ~450ms (simple updates)
- Drive Operations: ~650ms (includes Drive API calls)
- API Quotas: 300 requests per minute per user
🔄 Multi-Tab Document Support
Google Docs now supports multiple tabs. This server fully supports this feature:
// Tab-aware tools accept optional tabId parameter
- readGoogleDoc
- appendToGoogleDoc
- insertText
- deleteRange
Usage:
- List tabs with
listDocumentTabs - Target specific tab with
tabIdparameter - Works without
tabId(targets first tab/legacy doc body)
🤝 Contributing
This is an AgenticLedger platform-customized version of a-bonus/google-docs-mcp.
AgenticLedger Customizations:
- Platform-specific documentation
- Integration test suite
- AI agent guides
- Example files and templates
- Enhanced error handling
📜 License
MIT License - See LICENSE file
🔗 Links
- Repository: https://github.com/oregpt/Agenticledger_MCP_DocsOnly
- Upstream Source: https://github.com/a-bonus/google-docs-mcp
- AgenticLedger Platform: [Platform Documentation]
- Google Docs API: https://developers.google.com/docs/api
- Google Drive API: https://developers.google.com/drive/api
📞 Support
-
Check Documentation:
- README_AGENTICLEDGER.md - Integration guide
- PLATFORM_INTEGRATION_REPORT.md - Tool reference
- GOOGLE_CLOUD_SETUP.md - OAuth help
- CLAUDE.md - Advanced features
-
Run Diagnostics:
npm run test:integration -
Review Examples:
- See
test-integration.tsfor real API usage examples
- See
🆚 Comparison: Docs vs Sheets
Use GoogleDocsMCP when:
- Creating reports, letters, proposals
- Need rich text formatting
- Working with narrative content
- Require document structure (headings, TOC)
- Need comment collaboration
Use GoogleSheetsMCP when:
- Working with tabular data
- Need calculations/formulas
- Creating charts and graphs
- Data analysis tasks
- Structured records
Status: ✅ Production Ready Version: 1.0.0 Last Updated: 2025-11-03 Total Tools: 30+ Platform: AgenticLedger
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.