This server uses the Model Context Protocol (MCP) to connect Claude Desktop and other MCP clients to Google Docs and Google Drive. It provides comprehensive tools for reading, writing, and formatting Google Documents, plus complete Google Drive file management capabilities, serving as a bridge between AI assistants and your documents.
Before installation, ensure you have:
Go to Google Cloud Console: Visit Google Cloud Console and log in.
Create or Select a Project:
Enable APIs:
Configure OAuth Consent Screen:
https://www.googleapis.com/auth/documents
https://www.googleapis.com/auth/drive.file
Create Credentials:
Download Credentials:
credentials.json
⚠️ SECURITY WARNING: Treat this file like a password and never share it publicly!
Clone the Repository:
git clone https://github.com/a-bonus/google-docs-mcp.git mcp-googledocs-server
Navigate to Directory:
cd mcp-googledocs-server
Place Credentials: Move your renamed credentials.json
file into this folder.
npm install
npm run build
Run the server:
node ./dist/server.js
Authorize in Browser:
Complete Authorization:
code=
and &scope
)Verification:
token.json
file createdFind Your Absolute Path:
pwd
(macOS/Linux) or cd
(Windows) to get the full path to your server directoryLocate mcp_config.json
:
~/Library/Application Support/Claude/mcp_config.json
%APPDATA%\Claude\mcp_config.json
~/.config/Claude/mcp_config.json
Edit mcp_config.json
:
{
"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 absolute path.
Restart Claude Desktop
Once configured, you can use commands like:
Use the `google-docs-mcp` server to read the document with ID `YOUR_GOOGLE_DOC_ID`.
Replace YOUR_GOOGLE_DOC_ID
with the actual ID from your Google Doc's URL (the string between /d/
and /edit
).
YOUR_GOOGLE_DOC_ID
"YOUR_GOOGLE_DOC_ID
"YOUR_GOOGLE_DOC_ID
"Text Styling:
Use `applyTextStyle` to make the text 'Important Section' bold and red (#FF0000) in document `YOUR_GOOGLE_DOC_ID`.
Paragraph Styling:
Use `applyParagraphStyle` to center-align the paragraph containing 'Title Here' in document `YOUR_GOOGLE_DOC_ID`.
Table Creation:
Insert a 3x4 table at index 500 in document `YOUR_GOOGLE_DOC_ID` using the `insertTable` tool.
File Management:
List all documents in my Google Drive using `listGoogleDocs`.
Connection Issues:
mcp_config.json
is correctdist
folder exists (run npm run build
if needed)Authorization Errors:
credentials.json
is in the correct locationtoken.json
and restart the authorization processTo 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