This MCP server connects Claude Desktop and other MCP clients to Google Docs and Drive, providing a powerful interface to read, edit, and manage your documents programmatically.
Before getting started, make sure you have:
Create a Google Cloud Project:
Configure OAuth Consent Screen:
https://www.googleapis.com/auth/documentshttps://www.googleapis.com/auth/drive.fileCreate and Download Credentials:
credentials.jsongit clone https://github.com/a-bonus/google-docs-mcp.git mcp-googledocs-server
cd mcp-googledocs-server
Move your credentials.json file into this directory.
npm install
npm run build
Start the server:
node ./dist/server.js
The terminal will display a URL. Copy and paste it into your browser.
Log in with your Google account and grant permissions.
After approving, you'll be redirected to a page that can't load (this is normal).
Copy the code from the URL (between code= and &scope).
Paste this code back into your terminal and press Enter.
A token.json file will be created in your project directory.
Find the absolute path to your server directory using pwd (macOS/Linux) or cd (Windows).
Locate Claude's configuration file:
~/Library/Application Support/Claude/mcp_config.json%APPDATA%\Claude\mcp_config.json~/.config/Claude/mcp_config.jsonEdit the mcp_config.json file to include:
{
"mcpServers": {
"google-docs-mcp": {
"command": "node",
"args": [
"/PATH/TO/YOUR/CLONED/REPO/mcp-googledocs-server/dist/server.js"
],
"env": {}
}
}
}
(Replace /PATH/TO/YOUR/CLONED/REPO with your actual path)
Save the file and restart Claude Desktop.
To work with Google Docs, you'll need the document ID (the long string between /d/ and /edit in the document URL):
Read a document:
Use the google-docs-mcp server to read the document with ID YOUR_GOOGLE_DOC_ID
Append to a document:
Append 'This was added by Claude!' to document YOUR_GOOGLE_DOC_ID
Insert text at a specific position:
Insert text 'New content here' at index 100 in document YOUR_GOOGLE_DOC_ID
Delete content:
Delete content from range 50-100 in document YOUR_GOOGLE_DOC_ID
For documents with multiple tabs:
List all tabs:
List all tabs in document YOUR_GOOGLE_DOC_ID using the listDocumentTabs tool
Read from a specific tab:
Read the content from tab TAB_ID in document YOUR_GOOGLE_DOC_ID
Write to a specific tab:
Append 'New content' to tab TAB_ID in document YOUR_GOOGLE_DOC_ID
Apply text styling:
Use applyTextStyle to make the text 'Important Section' bold and red (#FF0000) in document YOUR_GOOGLE_DOC_ID
Format paragraphs:
Use applyParagraphStyle to center-align the paragraph containing 'Title Here' in document YOUR_GOOGLE_DOC_ID
Create a table:
Insert a 3x4 table at index 500 in document YOUR_GOOGLE_DOC_ID
Insert an image from URL:
Insert an image from https://example.com/logo.png at index 100 in document YOUR_GOOGLE_DOC_ID
Upload and insert local image:
Upload and insert the image at /Users/myname/Pictures/chart.png at index 200 in document YOUR_GOOGLE_DOC_ID
List comments:
List all comments in document YOUR_GOOGLE_DOC_ID
Add a comment:
Add a comment 'This needs revision' to document YOUR_GOOGLE_DOC_ID
Reply to a comment:
Reply 'Fixed as requested' to comment COMMENT_ID in document YOUR_GOOGLE_DOC_ID
List documents:
List my recent Google Docs using the getRecentGoogleDocs tool
Search for documents:
Search for Google Docs containing 'project proposal' using the searchGoogleDocs tool
Create a new document:
Create a new Google Doc named 'Meeting Notes' using the createDocument tool
Folder operations:
Create a new folder named 'Project Files' in Google Drive
List the contents of folder FOLDER_ID in Google Drive
Authentication issues:
credentials.json file is in the right locationClaude integration problems:
mcp_config.json is correct and absolutenpm run buildTab-related errors:
listDocumentTabs to verify the tab IDsTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "google-docs-mcp" '{"command":"node","args":["/PATH/TO/YOUR/CLONED/REPO/mcp-googledocs-server/dist/server.js"],"env":[]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:
{
"mcpServers": {
"google-docs-mcp": {
"command": "node",
"args": [
"/PATH/TO/YOUR/CLONED/REPO/mcp-googledocs-server/dist/server.js"
],
"env": []
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. Add this to your configuration file:
{
"mcpServers": {
"google-docs-mcp": {
"command": "node",
"args": [
"/PATH/TO/YOUR/CLONED/REPO/mcp-googledocs-server/dist/server.js"
],
"env": []
}
}
}
3. Restart Claude Desktop for the changes to take effect