Google Docs & Drive

by jasonwong-servicedirect

Not rated
GitHub

About

Interact with Google Docs and Google Drive for document creation, editing, and file management, with support for shared drives.

Details

Author
jasonwong-servicedirect
Categories
Productivity, Other, File Management

Setup

Install Google Docs & Drive in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/jasonwong-servicedirect/google-docs-mcp-shared

Follow the installation instructions in the repository README, then restart your MCP client.

Ultimate Google Docs & Drive MCP Server

Connect Claude Desktop (or other MCP clients) to your Google Docs and Google Drive!

🔥Check out15 powerful tasksyou can accomplish with this enhanced server!📁NEW:Complete Google Drive file management capabilities!

This comprehensive server uses the Model Context Protocol (MCP) and thefastmcplibrary to provide tools for reading, writing, formatting, structuring Google Documents, and managing your entire Google Drive. It acts as a powerful bridge, allowing AI assistants like Claude to interact with your documents and files programmatically with advanced capabilities.

- Read Documents:Read content withreadGoogleDoc(plain text, JSON structure, or markdown)
- Append to Documents:Add text to documents withappendToGoogleDoc
- Insert Text:Place text at specific positions withinsertText
- Delete Content:Remove content from a document withdeleteRange

- Text Formatting:Apply rich styling withapplyTextStyle(bold, italic, colors, etc.)
- Paragraph Formatting:Control paragraph layout withapplyParagraphStyle(alignment, spacing, etc.)
- Find & Format:Format by text content usingformatMatchingText(legacy support)

- Tables:Create tables withinsertTable
- Page Breaks:Insert page breaks withinsertPageBreak
- Experimental Features:Tools likefixListFormattingfor automatic list detection

- Document Discovery:Find and list documents withlistGoogleDocs,searchGoogleDocs,getRecentGoogleDocs
- Document Information:Get detailed metadata withgetDocumentInfo
- Folder Management:Create folders (createFolder), list contents (listFolderContents), get info (getFolderInfo)
- File Operations:Move (moveFile), copy (copyFile), rename (renameFile), delete (deleteFile)
- Document Creation:Create new docs (createDocument) or from templates (createFromTemplate)
- 🚀 Shared Drive Support:Full support for Google Workspace shared drives! All operations now work seamlessly with shared drives

- Google Authentication:Secure OAuth 2.0 authentication with full Drive access
- MCP Compliant:Designed for use with Claude and other MCP clients
- VS Code Integration:
Setup guidefor VS Code MCP extension
- Node.js and npm:A recent version of Node.js (which includes npm) installed on your computer. You can download it from
nodejs.org. (Version 18 or higher recommended).
- Git:Required for cloning this repository. (
Download Git).
- A Google Account:The account that owns or has access to the Google Docs you want to interact with.
- Command Line Familiarity:Basic comfort using a terminal or command prompt (like Terminal on macOS/Linux, or Command Prompt/PowerShell on Windows).
- Claude Desktop (Optional):If your goal is to connect this server to Claude, you'll need the Claude Desktop application installed.

Follow these steps carefully to get your own instance of the server running.

Step 1: Google Cloud Project & Credentials (The Important Bit!)

This server needs permission to talk to Google APIs on your behalf. You'll create special "keys" (credentials) that only your server will use.
- Go to Google Cloud Console:Open your web browser and go to the
Google Cloud Console. You might need to log in with your Google Account.
- Create or Select a Project:

- If you don't have a project, click the project dropdown near the top and select "NEW PROJECT". Give it a name (e.g., "My MCP Docs Server") and click "CREATE".

- If you have existing projects, you can select one or create a new one.

- In the search bar at the top, type "APIs & Services" and select "Library".

- Search for "Google Docs API" and click on it. Then click the "ENABLE" button.
- Search for "Google Drive API" and click on it. Then click the "ENABLE" button (this is often needed for finding files or permissions).

- On the left menu, click "APIs & Services" -> "OAuth consent screen".

- Choose User Type: Select "External" and click "CREATE".
- Fill in App Information:
- App name:Give it a name users will see (e.g., "Claude Docs MCP Access"). -User support email:Select your email address. -Developer contact information:Enter your email address.
- Click "SAVE AND CONTINUE".
- Scopes:Click "ADD OR REMOVE SCOPES". Search for and add the following scopes:
- https://www.googleapis.com/auth/documents(Allows reading/writing docs) -https://www.googleapis.com/auth/drive.file(Allows access to specific files opened/created by the app) - Click "UPDATE".
- Click "SAVE AND CONTINUE".
- Test Users:Click "ADD USERS". Enter the same Google email address you are logged in with. Click "ADD". This allowsyouto use the app while it's in "testing" mode.
- Click "SAVE AND CONTINUE". Review the summary and click "BACK TO DASHBOARD".

- On the left menu, click "APIs & Services" -> "Credentials".

- Click "+ CREATE CREDENTIALS" at the top and choose "OAuth client ID".
- Application type:Select "Desktop app" from the dropdown.
- Name:Give it a name (e.g., "MCP Docs Desktop Client").
- Click "CREATE".

- Save this file. It will likely be named something likeclient_secret_....json.

- IMPORTANT:Rename the downloaded file to exactlycredentials.json.
- Clone the Repository:Open your terminal/command prompt and run:

git clone https://github.com/jasonWong-serviceDirect/google-docs-mcp-shared.git mcp-googledocs-server

Your server needs some helper libraries specified in thepackage.jsonfile.
- In your terminal (make sure you are inside themcp-googledocs-serverdirectory), run:

npm install

The server is written in TypeScript (.ts), but we need to compile it into JavaScript (.js) that Node.js can run directly.

Step 5: First Run & Google Authorization (One Time Only)

Now you need to run the server once manually to grant it permission to access your Google account data. This will create atoken.jsonfile that saves your permission grant.
- In your terminal, run thecompiledserver usingnode:

node ./dist/server.js

- Status messages (like "Attempting to authorize...").

- An "Authorize this app by visiting this url:" message followed by a longhttps://accounts.google.com/...URL.

- Copy the entire long URL from the terminal.

- Paste the URL into your web browser and press Enter.
- Log in with thesame Google accountyou added as a Test User in Step 1.4.
- Google will show a screen asking for permission for your app ("Claude Docs MCP Access" or similar) to access Google Docs/Drive. Review and click "Allow" or "Grant".

- After clicking Allow, your browser will likely try to redirect tohttp://localhostand show a"This site can't be reached" error.THIS IS NORMAL!

- Lookcarefullyat the URL in your browser's address bar. It will look likehttp://localhost/?code=4/0Axxxxxxxxxxxxxx&scope=...
- Copy the long string of charactersbetweencode=and the&scopepart. This is your single-use authorization code.

- "Authentication successful!"

- "Token stored to.../token.json"
- It will then finish starting and likely print "Awaiting MCP client connection via stdio..." or similar, and then exit (or you can pressCtrl+Cto stop it).

Step 6: Configure Claude Desktop (Optional)

If you want to use this server with Claude Desktop, you need to tell Claude how to run it.
- Find Your Absolute Path:You need the full path to the server code.

- In your terminal, make sure you are still inside themcp-googledocs-serverdirectory.

- Run thepwdcommand (on macOS/Linux) orcd(on Windows, just displays the path).
- Copy the full path (e.g.,/Users/yourname/projects/mcp-googledocs-serverorC:\Users\yourname\projects\mcp-googledocs-server).

- macOS:~/Library/Application Support/Claude/mcp_config.json(You might need to use Finder's "Go" -> "Go to Folder..." menu and paste~/Library/Application Support/Claude/)

- Windows:%APPDATA%\Claude\mcp_config.json(Paste%APPDATA%\Claudeinto File Explorer's address bar)
- Linux:~/.config/Claude/mcp_config.json
- If theClaudefolder ormcp_config.jsonfile doesn't exist, create them.

{ "mcpServers": { "google-docs-mcp": { "command": "node", "args": [ "/PATH/TO/YOUR/CLONED/REPO/mcp-googledocs-server/dist/server.js" ], "env": {} } // Add commas here if you have other servers defined } // Other Claude settings might be here }

- Make sure the path in"args"is correct and absolute!

- If the file already existed, carefully merge this entry into the existingmcpServersobject. Ensure the JSON is valid (check commas!).

Once configured, you should be able to use the tools in your chats with Claude:

- "Use thegoogle-docs-mcpserver to read the document with IDYOUR_GOOGLE_DOC_ID."
- "Can you get the content of Google DocYOUR_GOOGLE_DOC_ID?"
- "Append 'This was added by Claude!' to documentYOUR_GOOGLE_DOC_IDusing thegoogle-docs-mcptool."

- Text Styling: "UseapplyTextStyleto make the text 'Important Section' bold and red (#FF0000) in documentYOUR_GOOGLE_DOC_ID."
- Paragraph Styling: "UseapplyParagraphStyleto center-align the paragraph containing 'Title Here' in documentYOUR_GOOGLE_DOC_ID."
- Table Creation: "Insert a 3x4 table at index 500 in documentYOUR_GOOGLE_DOC_IDusing theinsertTabletool."
- Legacy Formatting: "UseformatMatchingTextto find the second instance of 'Project Alpha' and make it blue (#0000FF) in docYOUR_GOOGLE_DOC_ID."

The server now fully supports Google Workspace shared drives! You can:

- List shared drive contents: "List all documents in shared driveSHARED_DRIVE_IDusinglistGoogleDocswith corpora='drive'"
- Search across all drives: "Search for 'budget' across all my drives usingsearchGoogleDocswith corpora='allDrives'"
- Create in shared drives: "Create a new document in shared driveSHARED_DRIVE_IDusingcreateDocumentwith driveId parameter"
- List folder in shared drive: "List contents of folderFOLDER_IDin shared driveDRIVE_IDusinglistFolderContents"

Thecorporaparameter controls the search scope:

- 'user'(default): Only the user's personal drive
- 'drive': A specific shared drive (requiresdriveId)
- 'allDrives': All accessible drives including shared drives

Remember to replaceYOUR_GOOGLE_DOC_IDwith the actual ID from a Google Doc's URL (the long string between/d/and/edit).

Claude will automatically launch your server in the background when needed using the command you provided. You donotneed to runnode ./dist/server.jsmanually anymore.

- .gitignore:This repository includes a.gitignorefile which should prevent you from accidentally committing your sensitivecredentials.jsonandtoken.jsonfiles.Do not remove these lines from.gitignore.
- Token Storage:This server stores the Google authorization token (token.json) directly in the project folder for simplicity during setup. In production or more security-sensitive environments, consider storing this token more securely, such as using system keychains, encrypted files, or dedicated secret management services.

- Claude shows "Failed" or "Could not attach":

- Double-check the absolute path inmcp_config.json.

- Ensure you rannpm run buildsuccessfully and thedistfolder exists.
- Try running the command frommcp_config.jsonmanually in your terminal:node /PATH/TO/YOUR/CLONED/REPO/mcp-googledocs-server/dist/server.js. Look for any errors printed.
- Check the Claude Desktop logs (see the official MCP debugging guide).
- Make sure allconsole.logstatus messages in the server code were changed toconsole.error.

- Ensure you enabled the correct APIs (Docs, Drive).

- Make sure you added your email as a Test User on the OAuth Consent Screen.
- Verify thecredentials.jsonfile is correctly placed in the project root.

This project is licensed under the MIT License - see theLICENSEfile for details. (Note: You should add aLICENSEfile containing the MIT License text to your repository).

Carryo is a remote MCP server for sharing Claude or ChatGPT-created HTML artifacts as live links.

MCP server that reads and writes the system clipboard — tables, text, code, JSON, URLs, images, and more. Preserves spreadsheet structure (rows/columns) that is lost when pasting into Claude directly. Claude can also write results back to your clipboard.

Read and edit Word (.docx) documents with track changes, comments, footnotes, and structural validation. 18 tools with OOXML-level paraId validation and document auditing.

Read and write data from Microsoft Excel files. Supports text, formulas, sheet creation, and Windows-only live editing.

A Model Context Protocol (MCP) server for integrating Google Docs with AI clients.

An MCP server for integrating with and managing Google Docs.

Universal MCP Server for Google Stitch. Connect AI agents to your UI designs.

Integrates Google Workspace services like Calendar, Drive, and Gmail with AI assistants.

Create, read, and manipulate Microsoft Word documents.

Create, read, update docs, spreadsheets, and presentations via AI. Connect your AI assistant to a full office suite.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.