- Home
- MCP servers
- Google Docs & Drive
Google Docs & Drive
- typescript
0
GitHub Stars
typescript
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"oregpt-agenticledger_mcp_docsonly": {
"command": "node",
"args": [
"dist/server.js"
]
}
}
}You can use this MCP server to integrate Google Docs and Google Drive with the AgenticLedger AI Agent Platform. It provides authority to read, edit, format, comment, and manage documents and Drive files through a type-safe, production-ready interface that handles OAuth authentication and token refresh automatically.
How to use
You interact with the Google Docs & Drive MCP Server through your MCP client to perform document operations. Start by authenticating with Google OAuth, then call tools to read, edit, format, or manage documents and folders. Leverage multi-tab aware tools to work with documents that use Google Docs’ multi-tab feature, and use the Drive integration to list, search, create, move, copy, or delete files.
How to install
Prerequisites: Node.js installed (recommended LTS version) and npm available on your system.
Step 1: Install dependencies
npm install
Step 2: Build the project
npm run build
Step 3: Run first-time authorization to create token.json
node dist/server.js
Follow the OAuth flow in your browser to authorize access. A token.json file will be created automatically.
Multi-Tab Document Support
Google Docs now supports multiple tabs. This MCP server supports tab-aware operations by accepting an optional tabId where applicable. If you omit tabId, the operation targets the main document body or the first tab by default.
Example Usage
const result = await readGoogleDoc({
documentId: "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
format: "text" // or "json" or "markdown"
});
await appendToGoogleDoc({
documentId: "1BxiMVs0XRA...",
textToAppend: "\n\nNew section added by AI Agent"
});
await applyTextStyle({
documentId: "1BxiMVs0XRA...",
target: {
textToFind: "Important Note",
matchInstance: 1
},
style: {
bold: true,
foregroundColor: "#FF0000",
fontSize: 14
}
});
Security
Never commit credentials or tokens. OAuth tokens expire after 1 hour and are auto-refreshed. Revoke access at https://myaccount.google.com/permissions. This integration uses user-based authentication, so it only accesses the authorized user’s documents.
Performance
Typical operation response times are within a few hundred milliseconds, with Drive-related actions incurring additional latency due to API interactions. Be mindful of API quotas: the server is designed to handle multiple requests per minute per user.
Notes
This MCP server uses OAuth 2.0 for secure access to Google Docs and Drive. Ensure you place the credentials file in the working directory and complete the initial authorization flow as described during setup.
Example Commands for Quick Start
# Install dependencies
npm install
# Build the project
npm run build
# Start the server (first-time authorization will guide you through Google login)
node dist/server.js
Available tools
readGoogleDoc
Read document content in text, json, or markdown formats.
appendToGoogleDoc
Append text to the end of a document.
insertText
Insert text at a specified index within a document.
deleteRange
Delete a range of content in the document.
listDocumentTabs
List tabs in multi-tab documents to identify tabId values.
applyTextStyle
Apply character-level styling such as bold, color, or font to matched text.
applyParagraphStyle
Apply paragraph-level formatting like alignment and spacing.
formatMatchingText
Apply formatting to text that matches given criteria (legacy support).
insertTable
Create tables within a document to structure content.
insertPageBreak
Insert a page break at a specified location.
insertImageFromUrl
Insert an image into the document from a URL.
insertLocalImage
Upload a local image and insert it into the document.
listComments
List all comments in the document.
getComment
Retrieve details for a specific comment.
addComment
Create a new comment anchored to specific text.
replyToComment
Add a reply to an existing comment thread.
resolveComment
Mark a comment as resolved.
deleteComment
Remove a comment from the document.
listGoogleDocs
List all Google documents accessible to the user.
searchGoogleDocs
Search documents by name or content.
getRecentGoogleDocs
Retrieve recently modified documents.
getDocumentInfo
Fetch metadata for a document.
createDocument
Create a new Google document.
createFromTemplate
Create a document from a template.
createFolder
Create a new Drive folder.
listFolderContents
List files within a folder.
getFolderInfo
Get metadata for a Drive folder.
moveFile
Move a file to another folder.
copyFile
Create a copy of a document.
renameFile
Rename a document.
deleteFile
Delete (move to trash) a file.