Configure the Google Drive MCP Server
Overview
Google operates an official hosted MCP server for Drive at drivemcp.googleapis.com (currently in Developer Preview), exposing search, list, and read tools for file content and metadata. Access is authorized through OAuth via a Google Cloud OAuth client you register yourself.
1. Configure Google Drive
- 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, search for “MCP”, and enable the Drive MCP API.
2. Add the MCP server to your gateway config
In the mcp_servers section of your gateway configuration add the following entry:
- name: google-drive
description: "Google's official hosted Drive MCP server for searching and reading files."
url: https://drivemcp.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
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 Configuration section 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 Drive 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.
Having trouble? Email support@dtwo.ai.