This comprehensive MCP server connects Claude and other AI assistants to Google Docs and Drive, allowing them to read, edit, format documents, and manage files. It serves as a powerful bridge that enables AI tools to interact with your Google ecosystem programmatically.
Before installation, ensure you have:
https://www.googleapis.com/auth/documents and https://www.googleapis.com/auth/drive.filecredentials.jsongit 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
Start the server:
node ./dist/server.js
A URL will appear in your terminal. Copy it and open in your browser.
Log in with your Google account and grant the requested permissions.
After authorization, your browser will redirect to a "site can't be reached" page. Copy the code from the URL (between code= and &scope).
Paste the code back in your terminal and press Enter.
A token.json file will be created in your project directory.
Get the absolute path to your server directory using pwd (macOS/Linux) or cd (Windows).
Locate or create Claude's configuration file:
~/Library/Application Support/Claude/mcp_config.json%APPDATA%\Claude\mcp_config.json~/.config/Claude/mcp_config.jsonAdd your server configuration (replace the path with your actual path):
{
"mcpServers": {
"google-docs-mcp": {
"command": "node",
"args": [
"/PATH/TO/YOUR/CLONED/REPO/mcp-googledocs-server/dist/server.js"
],
"env": {}
}
}
}
Save the file and restart Claude.
Ask Claude to:
YOUR_GOOGLE_DOC_ID using the google-docs-mcp server."YOUR_GOOGLE_DOC_ID."YOUR_GOOGLE_DOC_ID."Listing Tabs:
YOUR_GOOGLE_DOC_ID using the listDocumentTabs tool."Reading from Specific Tabs:
TAB_ID in document YOUR_GOOGLE_DOC_ID."Writing to Specific Tabs:
TAB_ID in document YOUR_GOOGLE_DOC_ID."TAB_ID of document YOUR_GOOGLE_DOC_ID."Text Styling:
YOUR_GOOGLE_DOC_ID."Paragraph Styling:
YOUR_GOOGLE_DOC_ID."Tables and Images:
YOUR_GOOGLE_DOC_ID."Insert from URL:
YOUR_DOC_ID."Upload Local Image:
YOUR_DOC_ID."getRecentGoogleDocs tool."searchGoogleDocs."createFolder."FILE_ID to folder FOLDER_ID."If Claude shows "Failed" or "Could not attach":
mcp_config.json is correctnpm run build successfullyFor Google authorization errors:
credentials.json is in the correct locationFor tab-related issues:
listDocumentTabs to see available tab IDstabIdTo 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