Automating Google Docs with Claude
Swipe to show menu
Let's set up the Google Docs MCP server.
Google Cloud Console Configuration
New Project Setup
- Access Google Cloud Console through browser interface;
- Click current project name to access project selector;
- Select "New Project" and provide descriptive name (e.g., "docs mcp");
- Wait for project creation and switch to new project.
Required API Activations
- Google Docs API: navigate to APIs & Services โ Library, search "Google Docs API", and enable;
- Google Drive API: similarly enable Google Drive API for file management capabilities.
These APIs provide comprehensive access to Google's document ecosystem, enabling read, write, create, edit, and delete operations across both Docs and Drive platforms.
Configure OAuth Consent Screen
- Navigate to the "Credentials" tab;
- If prompted, click "Configure consent screen";
- Click "Get started";
- Enter application name (e.g., "gmail agent");
- Input your email address;
- Select "External Audience" for user type, if you use general Gmail account;
- Re-enter your email address when prompted;
- Accept the user data policy;
- Click Continue and Create.
Create OAuth Credentials
- Click "Create OAuth Client";
- Select "Desktop App" for local AI agents and scripts;
- Accept suggested naming or customize as needed;
- Download the JSON file and save it as
credentials.jsonin your project directory; - Now you need to move the file with credentials to the folder with the AI agent (
/MCP-Google-Doc). You can do that manually by moving the file icon to the opened folder in the file explorer. Or use Terminal/Command line and copy the file with the commandcp path/to/file_name ., for example:
cp ~/Desktop/credentials.json .
The dot (.) at the end specifies current directory as destination;
- Confirm successful file transfer and remove from original location.
Automatic MCP Server Launch (Recommended)
Clone the Repository
- In Claude chat, paste:
Clone this repo to the Documents/projects
https://github.com/ophydami/MCP-Google-Doc.git
- Run the command. Repo is cloned to the same folder as other MCP servers.
Install Dependencies
- In Claude chat, paste:
run npm install
- Run the command. Claude installs all required packages.
Move the Credentials File
- In Claude, paste:
Move Desktop/credentials.json into project directory.
- Run the command. Claude places the OAuth file inside the cloned repo automatically.
Build and Start Server
- In Claude, paste:
run npm run build and npm start
-
Run. Claude executes commands consistently.
-
Browser opens โ authenticate with your Google account:
- Select the same email used in Google Cloud Console โ click Allow;
- Close the tab after seeing "Authentication successful".
Adding the Config Block
- In Claude, paste:
Add this block to the Claude config file
{
"mcpServers": {
"googledocs": {
"command": "node",
"args": ["/absolute/path/to/build/server.js"]
}
}
}
- Run the prompt.
Verify Config (Optional)
- Open Claude Settings (Mac:
Cmd + ,; Windows:Ctrl + ,); - Go to Developer โ Edit Config;
- Confirm the new block is added (either after another Google server MCP or at the end). Both are fine.
Restart Claude
- Fully exit Claude Desktop. (Mac:
Cmd + Q; Windows:Alt + F4); - Reopen Claude to finish the MCP launch.
Manual Server Installation
Local Environment Preparation
- Navigate to designated directory for AI agent storage
cd Documents/projects
- Download and enter the Google Docs MCP repository
git clone https://github.com/ophydami/MCP-Google-Doc.git
cd MCP-Google-Doc
- Download all required packages and dependencies
npm install
Build and Authentication Process
Optimize code, minify files, and create production-ready bundles
npm run build
Authentication Initialization
Launch authentication server and initiate OAuth flow
npm start
Claude Desktop Integration
Settings Access
- Open Claude Desktop settings (
Cmd+,orCtrl+,); - Navigate to Developer tab;
- Select "Edit Config" to access configuration file.
Configuration Integration
- Add comma after existing configuration blocks;
- Insert Google Docs MCP configuration block
"googledocs": {
"command": "node",
"args": [
"/path/to/build/server.js"
]
}
- Update path information using
pwdcommand output in the Terminal/Command line; - Save configuration file and restart Claude Desktop.
Everything was clear?
Thanks for your feedback!
Sectionย 3. Chapterย 1
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Sectionย 3. Chapterย 1