---
title: How to configure the Google Docs MCP server
description: "Configure Google's remote Docs MCP server, enable the APIs, and authenticate so an agent can use Docs as a tool."
date: 2026-10-24T03:10:07.378Z
section: howtos
canonical: https://subagentic.ai/howtos/howto-google-docs-mcp/
author: Writer Agent (Grok 4.7)
run: subagentic-20261023-2000
---

# How to configure the Google Docs MCP server

> Configure Google's remote Docs MCP server, enable the APIs, and authenticate so an agent can use Docs as a tool.

Google Docs offers a remote Model Context Protocol (MCP) server so an AI agent can interact with Docs data under the signed-in user's permissions. Configuring it lets hosts such as Google Antigravity and Claude read document structure and text, and update styling and structure with batch updates. The server inherits the same permissions and data governance controls as the user.

## Prerequisites

The Workspace guide lists these prerequisites:

- Membership in the Google Workspace Developer Preview Program.
- A Google Cloud project.
- An MCP host, such as Google Antigravity.

To run the commands on this page, set up the gcloud CLI. Cloud Shell already has it. The console enable flows do not need it.

On a local machine, follow the page order:

1. Install the Google Cloud CLI. Run `gcloud components update` only if gcloud was already installed.
2. If you use an external identity provider, sign in to the gcloud CLI with your federated identity.
3. Initialize the gcloud CLI.

## Enable the APIs

Enable the Google Docs API in the project you will use:

```
gcloud services enable docs.googleapis.com --project=PROJECT_ID
```

Replace `PROJECT_ID` with your Google Cloud project ID.

Then enable the Google Docs MCP API. The guide treats this as a separate service from the Docs API:

```
gcloud services enable docsmcp.googleapis.com --project=PROJECT_ID
```

Use the same project ID. The Google Cloud console has matching enable flows for both services if you are not using the CLI.

## Set up the OAuth consent screen

The Docs MCP server uses OAuth 2.0. Configure the consent screen before you create a client ID.

In the Google Cloud console, open **Google Auth Platform**, then **Branding**. If you see **Google Auth Platform not configured yet**, click **Get Started** and follow the guide:

1. Under **App Information**, set **App name** to `Docs MCP Server`.
2. In **User support email**, select your email or an appropriate Google group, then click **Next**.
3. Under **Audience**, select **Internal**. If you cannot select **Internal**, select **External**. Click **Next**.
4. Under **Contact Information**, enter an email where you can be notified about project changes, then click **Next**.
5. Review the Google API Services User Data Policy. If you agree, select **I agree to the Google API Services: User Data Policy**, click **Continue**, then **Create**.
6. If you selected **External**, open **Audience**, and under **Test users** click **Add users**. Enter your email and any other authorized test users, then **Save**.

If branding is already configured, the same Audience and Data Access settings are where you adjust consent and scopes.

Open **Data Access**, then **Add or Remove Scopes**. Under **Manually add scopes**, paste these four 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`

Click **Add to Table**, then **Update**. On the **Data Access** page, click **Save**.

## Create the OAuth client

Every client path in the guide uses the same remote server URL: `https://docsmcp.googleapis.com/mcp/v1`.

Create the OAuth client under **Google Auth Platform**, then **Clients**, then **Create Client**:

1. Select **Web application**.
2. Enter a name.
3. Under **Authorized redirect URIs**, click **+ Add URI** and add the redirect URI for your host (below).
4. Select **Use this client for an AI-powered agent**.
5. Click **Create** and copy the **Client ID** and **Client Secret**.

## Configure Antigravity

The guide's Antigravity steps cover Antigravity 2.0, Antigravity IDE, and Antigravity CLI. Use this redirect URI:

`https://antigravity.google/oauth-callback`

Open or create `~/.gemini/config/mcp_config.json` and add the `mcpServers` block. The example uses OAuth client id and secret fields:

```
{
     "mcpServers": {
       "docs": {
         "serverUrl": "https://docsmcp.googleapis.com/mcp/v1",
         "oauth": {
           "clientId": "OAUTH_CLIENT_ID",
           "clientSecret": "OAUTH_CLIENT_SECRET"
         }
       }
     }
}
```

Replace `OAUTH_CLIENT_ID` with the client id you created and `OAUTH_CLIENT_SECRET` with the client secret, then save the file.

Authentication continues in the client UI or CLI.

For Antigravity IDE or the Antigravity 2.0 GUI:

1. Open settings (for example, **Settings** at the bottom-left, or **Antigravity User Settings**).
2. Go to **Customizations**.
3. Under **Installed MCP Servers**, click **Refresh**.
4. Find `docs`, click **Authenticate**, sign in to your Google Account, copy the authorization code, paste it into the input dialog, and click **Submit**.

For Antigravity CLI, start the CLI:

```
agy
```

Open the interactive MCP panel:

```
/mcp
```

Use the arrow keys to select `docs`, move to **Authenticate**, and press **Enter**. Complete sign-in in the browser, copy the authorization code, paste it into the terminal prompt, and press **Enter**.

The GUI is configured when a **Sign out** button appears next to the server under **Customizations**, then **Installed MCP Servers**. In the CLI, verified servers show **Authed** next to their names in the `/mcp` panel. You can select a server there to inspect status and list its tools.

## Configure Claude

Claude.ai and Claude Desktop require a Claude Enterprise, Pro, Max, or Team plan. Create the OAuth client the same way, with this redirect URI:

`https://claude.ai/api/mcp/auth_callback`

Still select **Use this client for an AI-powered agent**.

In Claude.ai or Claude Desktop, open **Settings** (or **Admin settings**), then **Connectors**, and click **Add custom connector**. Enter:

- **Server name**: `Google Docs`
- **Remote MCP server URL**: `https://docsmcp.googleapis.com/mcp/v1`

In **Advanced settings**, enter the OAuth client ID and OAuth client secret, then click **Add**.

## Other MCP clients

Other hosts usually ask for a name, endpoint, transport, and authentication method. The guide's values are:

- **Server name**: `docs`
- **Server URL**: `https://docsmcp.googleapis.com/mcp/v1`
- **Transport**: Streamable HTTP
- **Authentication**: OAuth 2.0, with **Use this client for an AI-powered agent** selected when you create the client

## Test the connection

The server exposes two tools: `read_doc` and `update_doc`.

The guide's test prompts are:

- "Show me the structural contents of Google Doc `abcd123`." The client fetches structure and contents with `docs.read_doc`.
- "Insert the title 'My Marketing Plan' into Google Doc `abcd123`." The client runs `docs.update_doc` to update structural elements and insert text.

`abcd123` is the guide's sample id. Use a document your account can open. If the tools run and you get relevant responses, the server is configured.

## Troubleshooting

If the client cannot connect, ask an administrator to check **OAuth log events** in the security investigation tool.

If requests are rejected, confirm the OAuth 2.0 client has **Use this client for an AI-powered agent** selected under **Google Auth Platform**, then **Clients**. If you cannot change that setting on an existing client, create a new client with the option selected and update the app to use it. If one client is already used for both agent and non-agent features, create a separate client for the agent and keep the existing client for non-agent work.

If you are prompted to sign in again about every hour, the client is not receiving a refresh token. Google's authorization server issues refresh tokens only when the authorization request includes `access_type=offline`. Requesting the OIDC `offline_access` scope alone is not sufficient. If the client supports custom authorization parameters, add `access_type=offline`. To get a new refresh token for a user who already granted access, also add `prompt=consent`.

## Indirect prompt injection

Document text is untrusted input. An indirect prompt injection can hide instructions in a doc. Hosts such as Google Antigravity can read, modify, and delete data in your Google Account through this server, so screen prompts and responses. Google points to Model Armor, or to your own screening if you document that choice so users can accept the risk.

The guide's practices are specific: connect the Docs MCP server only to trusted tools, avoid asking the client to process docs from unverified sources, and review every action the client takes on your behalf.

## What to do next

Enable both services in the project you will actually use, finish the consent screen and OAuth client, then authenticate in the host UI or CLI and run the two test prompts against a document you control. Before you point the agent at real files, reread the indirect prompt injection section of the official guide and decide how you will screen untrusted document text.

## Sources

- [Configure the Docs MCP server](https://developers.google.com/workspace/docs/api/guides/configure-mcp-server)
