Google Docs MCP server

Provides a bridge between Google Docs and AI tools for reading document content, appending text, and applying formatting to specific text within documents.
Back to servers
Provider
a-bonus
Release date
Apr 15, 2025
Language
TypeScript
Stats
24 stars

This MCP server creates a powerful bridge between Claude and your Google Docs & Drive, allowing you to read, edit, format documents, and manage your Drive files through natural language commands.

Installation

Prerequisites

Before starting, ensure you have:

  • Node.js (version 18+) installed from nodejs.org
  • Git installed from git-scm.com
  • A Google Account that owns or can access your Google Docs
  • Basic familiarity with command line interfaces
  • Claude Desktop app (optional, for integration)

Set Up Google Cloud Project

  1. Create a project and enable APIs:

    • Go to Google Cloud Console
    • Create a new project (e.g., "My MCP Docs Server")
    • In the API Library, enable both Google Docs API and Google Drive API
  2. Configure OAuth consent screen:

    • Go to "APIs & Services" → "OAuth consent screen"
    • Select "External" and click "CREATE"
    • Enter app name (e.g., "Claude Docs MCP Access")
    • Add your email as the support email and developer contact
    • Add the scopes:
      • https://www.googleapis.com/auth/documents
      • https://www.googleapis.com/auth/drive.file
    • Add your Google email address as a test user
  3. Create credentials:

    • Go to "APIs & Services" → "Credentials"
    • Click "+ CREATE CREDENTIALS" and select "OAuth client ID"
    • Select "Desktop app" and give it a name
    • Click "CREATE"
    • Download the JSON file and rename it to credentials.json

Install the Server

  1. Clone the repository:

    git clone https://github.com/a-bonus/google-docs-mcp.git mcp-googledocs-server
    cd mcp-googledocs-server
    
  2. Place credentials:

    • Move your renamed credentials.json file into the mcp-googledocs-server folder
  3. Install dependencies:

    npm install
    
  4. Build the server:

    npm run build
    
  5. First run and authorization:

    node ./dist/server.js
    
    • Copy the URL displayed in terminal and open in your browser
    • Log in with your Google account and authorize the application
    • Copy the authorization code from the browser URL (after "code=" and before "&scope")
    • Paste this code into the terminal prompt
    • Verify a token.json file appears in your server directory

Configure Claude Desktop

  1. Find your absolute path:

    • In the terminal, use pwd (macOS/Linux) or cd (Windows) to get your server's full path
  2. Locate or create Claude's configuration file:

    • macOS: ~/Library/Application Support/Claude/mcp_config.json
    • Windows: %APPDATA%\Claude\mcp_config.json
    • Linux: ~/.config/Claude/mcp_config.json
  3. Edit configuration file:

    {
      "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)

  4. Restart Claude Desktop

Usage

With Claude Desktop, you can use natural language to instruct the AI to perform various Google Docs and Drive operations.

Document Access & Editing

Use the google-docs-mcp server to read document 1a2b3c4d5e6f7g8h9i
Please append "Meeting notes from today:" to document 1a2b3c4d5e6f7g8h9i
Insert "This is a new paragraph." at position 250 in document 1a2b3c4d5e6f7g8h9i

Formatting & Styling

Apply bold and red (#FF0000) formatting to the text "Important Deadline" in document 1a2b3c4d5e6f7g8h9i
Center-align the paragraph containing "Project Overview" in document 1a2b3c4d5e6f7g8h9i

Document Structure

Insert a 3x4 table at index 500 in document 1a2b3c4d5e6f7g8h9i
Add a page break after the section titled "First Quarter Results" in document 1a2b3c4d5e6f7g8h9i

Google Drive Management

List my recent Google Docs
Search for documents containing "quarterly report"
Create a new folder called "Project Alpha" in my Drive
Move file 1a2b3c4d5e6f7g8h9i to folder 9i8h7g6f5e4d3c2b1a

Troubleshooting

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

  • Verify the absolute path in mcp_config.json is correct
  • Ensure the dist folder exists (run npm run build)
  • Try running the server manually to check for errors
  • Confirm your Google APIs are enabled and credentials are valid

If you encounter Google authorization errors:

  • Verify you've enabled both the Google Docs and Drive APIs
  • Confirm your email is added as a test user
  • Check that credentials.json is in the correct location

How to add this MCP server to Cursor

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.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later