home / mcp / google docs mcp server
Provides programmatic access to Google Docs, Sheets, and Drive for reading, writing, and management via MCP.
Configuration
View docs{
"mcpServers": {
"a-bonus-google-docs-mcp": {
"command": "node",
"args": [
"/PATH/TO/YOUR/CLONED/REPO/mcp-googledocs-server/dist/server.js"
],
"env": {
"SERVICE_ACCOUNT_PATH": "/path/to/service-account-key.json",
"GOOGLE_IMPERSONATE_USER": "[email protected]"
}
}
}
}This Google Docs, Sheets, and Drive MCP Server bridges your Claude Desktop or other MCP clients with Google Docs, Sheets, and Drive. It enables reading, writing, formatting, and organizing documents and spreadsheets, while also managing your Google Drive files through a single MCP endpoint for practical automation and AI-assisted workflows.
You connect your MCP client to the server to access Google Docs, Sheets, and Drive. Use the available tools to read content, write and format text, manage document structure, and manipulate spreadsheets and files in Drive. You can work with multi-tab Google Docs, read and write markdown, insert images, create tables, and manage comments. When you issue a command, specify the target document or spreadsheet by its ID and choose the tool that matches your task, such as reading a range in a sheet, appending text to a document, or inserting an image from a URL.
For multi-tab documents, you can list tabs, read from a specific tab using tabId, and write to a tab without affecting others. If tabId is omitted, operations target the first tab or the document body for legacy documents.
Prerequisites and setup follow these concrete steps.
1. Install Node.js and npm. Use a recent LTS release, preferably Node.js 18 or higher.
2. Install Git if you do not have it.
3. Prepare credentials for Google APIs by following the OAuth setup and obtaining a downloaded credentials.json file. Rename the downloaded file to credentials.json and place it in the server project directory.
4. Clone the server repository and place credentials in the project folder.
5. Install dependencies and build the server.
6. Run the server once to authorize access to Google APIs, then use the generated token.json for subsequent runs.
The server supports OAuth-based access to Google Docs, Sheets, and Drive, with an optional enterprise setup using a service account and domain-wide delegation. When using a service account, set environment variables for the service account path and the user to impersonate. If you configure impersonation, the server will access the specified userβs documents and Drive content.
Claude Desktop can be configured to launch the MCP server process, using an absolute path to the compiled server file. Place the configuration in the dedicated MCP config location for your OS and ensure the command and arguments are correct and absolute.
Keep credentials.json and token.json secure. Do not commit them to version control. The token.json file grants access to your Google data and should be treated as a secret.
If you see startup or authorization issues, verify path correctness, ensure you built the project, and check for any error messages printed by the server. Review OAuth setup steps to confirm APIs are enabled and test users are configured. If tab-related errors appear, confirm the tabId exists by listing document tabs.
The server exposes a comprehensive set of capabilities to interact with Google Docs, Sheets, and Drive. You can read, write, format, and structure documents, manage tabs, handle comments, and perform advanced actions on spreadsheets and files. Specific functions include reading documents, appending text, inserting text at a position, deleting ranges, and tab-aware operations; markdown support; rich text and paragraph styling; table creation; image insertion from URLs or local uploads; comment management; spreadsheet read/write/append/clear operations; spreadsheet metadata retrieval; sheet creation and labeling; and drive file management tasks such as listing, creating folders, moving, copying, renaming, and deleting.
Google Docs: read content, modify with markdown, apply text and paragraph styles, insert tables or images, and manage comments. Use tab-specific variants to operate on a particular tab.
Google Sheets: read and write ranges in A1 notation, append rows, create new spreadsheets or add sheets, clear ranges, and fetch detailed spreadsheet information.
Some operations may be limited by Google Drive API behavior, such as anchored comments or certain merge/convert scenarios. In such cases, adjust your workflow to use manual interactions for full fidelity.
This project is licensed under the MIT License.
Read content from a Google Document. Returns plain text, JSON structure, or markdown depending on the request.
Append text to a Google Document, with optional tab targeting.
Insert text at a specific position, with optional tab targeting.
Delete content within a specified range, with optional tab targeting.
List all tabs in a multi-tab Google Document and provide IDs and summaries.
List all comments in a document with metadata such as author and dates.
Retrieve a specific comment and its replies.
Add a new comment anchored to a location in the document.
Add a reply to an existing comment.
Mark a comment as resolved when supported by the API.
Delete a comment from the document.
Read data from a Google Sheet range using A1 notation.
Write data to a specified spreadsheet range, overwriting existing data.
Append new rows to a spreadsheet.
Clear values within a spreadsheet range.
Retrieve detailed metadata about a spreadsheet and its sheets.
Create a new spreadsheet, optionally with initial data.
Add a new sheet/tab to an existing spreadsheet.
List spreadsheets accessible by the authenticated user.
Create a table in a Google Document at a specified position.
Insert a page break at a given location in a document.
Insert an image into a document from a public URL.
Upload a local image to Drive and insert it into the document.
Apply rich text styling such as bold, italic, color, and size to selected text.
Apply paragraph styling such as alignment and spacing to a block of text.
Format text that matches a given pattern across the document.
Create a new Google Document, optionally with initial content.
Create a document from a template.