Configure the Google Docs MCP Server

Connect Google's official hosted Docs MCP server to a Dtwo gateway via OAuth.

On this page
  1. Overview
  2. Prerequisites
  3. 1. Configure Google Docs
  4. 2. Add the MCP server to your gateway config
  5. 3. Deploy and verify

Overview

Google operates an official hosted MCP server for Docs at docsmcp.googleapis.com (currently in Developer Preview), exposing tools to read, create, and edit documents. Access is authorized through OAuth via a Google Cloud OAuth client you register yourself.

Prerequisites

To configure this MCP server you need to join the Google Workspace Developer Preview program and create a Google Cloud OAuth client. See Google Workspace MCP Servers for instructions.

1. Configure Google Docs

  1. Go to console.cloud.google.com and use the project picker near the top of the page to create a new project (or select an existing one). Then, with that project selected, open APIs & Services from the left navigation, click + Enable APIs and services, and enable both the Docs MCP API (search for “MCP”) and the Google Docs API (search for “Google Docs”).

2. Add the MCP server to your gateway config

Go to your gateway in the Dtwo UI and open Configuration → Advanced. In the mcp_servers section add the following entry:

  - name: google-docs
    description: "Google's official hosted Docs MCP server for reading and editing documents."
    url: https://docsmcp.googleapis.com/mcp/v1
    transport_type: streamablehttp
    authentication:
      type: oauth
      grant_type: authorization_code
      scopes:
        - https://www.googleapis.com/auth/drive.readonly
        - https://www.googleapis.com/auth/drive.file
        - https://www.googleapis.com/auth/documents.readonly
        - https://www.googleapis.com/auth/documents
      client_id: "<CLIENT_ID>"
      client_secret: "<CLIENT_SECRET>"
      authorization_url: "https://accounts.google.com/o/oauth2/v2/auth"
      token_url: "https://oauth2.googleapis.com/token"
      redirect_uri: "<CALLBACK_URL>"

Replace the placeholder values:

  • <CLIENT_ID> and <CLIENT_SECRET> — come from the OAuth client you created when configuring Google Workspace MCP Servers.
  • <CALLBACK_URL> — the same OAuth callback URL you set there, found in the Overview tab for your gateway in the Dtwo UI.

3. Deploy and verify

Save the configuration and deploy the gateway.

Then, in your AI client, ask it to authorize Google Docs via the gateway. This opens the Google login screen — sign in as the user whose permissions the agent should inherit, and approve the consent prompt. Once authorized, confirm the server’s tools appear and run a quick call to make sure the connection works.

If the tools don’t appear after you authorize, refresh the tool list in your AI client — some clients don’t pick it up automatically.

Having trouble?

Email us and we'll help you get set up.

Email support

↑↓ to navigate ↵ to open