This Google Docs & Drive MCP server enables Claude and other MCP clients to interact with your Google documents and Drive files. It provides a comprehensive set of tools for reading, writing, formatting documents, and managing files in your Google Drive through a seamless integration.
Before installation, ensure you have:
https://www.googleapis.com/auth/documents
https://www.googleapis.com/auth/drive.file
credentials.json
git clone https://github.com/a-bonus/google-docs-mcp.git mcp-googledocs-server
cd mcp-googledocs-server
Move your credentials.json
file into the mcp-googledocs-server
directory.
npm install
npm run build
node ./dist/server.js
Follow these authorization steps:
code=
and before &scope
)token.json
file appears in your directorypwd
(macOS/Linux) or cd
(Windows)~/Library/Application Support/Claude/mcp_config.json
%APPDATA%\Claude\mcp_config.json
~/.config/Claude/mcp_config.json
{
"mcpServers": {
"google-docs-mcp": {
"command": "node",
"args": [
"/PATH/TO/YOUR/CLONED/REPO/mcp-googledocs-server/dist/server.js"
],
"env": {}
}
}
}
You can now use commands like:
google-docs-mcp
server to read the document with ID YOUR_GOOGLE_DOC_ID
."YOUR_GOOGLE_DOC_ID
."# Reading documents
"Read the Google Doc with ID 1abc123xyz456 using the google-docs-mcp server."
# Appending content
"Append the text 'New section added by Claude' to document 1abc123xyz456."
# Inserting text at specific locations
"Insert 'This is important!' at index 500 in document 1abc123xyz456."
# Deleting content
"Delete text from index 200 to 300 in document 1abc123xyz456."
# Apply text styling
"Make the text 'Important Note' bold and red (#FF0000) in document 1abc123xyz456."
# Paragraph formatting
"Center-align the paragraph containing 'Executive Summary' in document 1abc123xyz456."
# Create a table
"Insert a 3x4 table at index 200 in document 1abc123xyz456."
# Insert page breaks
"Add a page break after the 'References' section in document 1abc123xyz456."
To insert an image from a public URL:
"Insert the image from https://example.com/logo.png at index 100 in document 1abc123xyz456."
Parameters:
documentId
: Google Document IDimageUrl
: Publicly accessible URLindex
: Position in the documentwidth
(optional): Image width in pointsheight
(optional): Image height in pointsTo upload and insert a local image:
"Upload and insert the image from /Users/myname/Pictures/chart.png at index 200 in document 1abc123xyz456."
Parameters:
documentId
: Google Document IDlocalImagePath
: Path to the local image fileindex
: Position in the documentwidth
and height
(optional): Image dimensions in pointsuploadToSameFolder
(optional, default: true): Whether to upload to the document's folderSupported formats: .jpg, .jpeg, .png, .gif, .bmp, .webp, .svg
# List all comments
"List all comments in document 1abc123xyz456."
# Add a new comment
"Add a comment 'Please verify this data' to the text 'Q2 results' in document 1abc123xyz456."
# Reply to comments
"Reply 'Updated as requested' to comment ABC123 in document 1abc123xyz456."
# Resolve comments
"Resolve comment DEF456 in document 1abc123xyz456."
# List documents
"List my recent Google Docs."
# Search for documents
"Search for documents containing 'Project Proposal'."
# Create folders
"Create a new folder named 'Project Alpha' in my Google Drive."
# List folder contents
"Show me the contents of folder 2abc123xyz456."
# Create documents
"Create a new Google Doc titled 'Meeting Notes - May 2023'."
If Claude fails to connect to the server:
mcp_config.json
is correct and absolutedist
folder exists (run npm run build
if needed)If you encounter Google authorization errors:
credentials.json
is properly placed in the project rootTo 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.json
2. 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