The Universal Search MCP Server for Google Workspace uses the Model Context Protocol (MCP) standard to allow AI agents to search your Workspace artifacts. This server provides a way to search across multiple Google Workspace products, including Gmail messages, Google Drive files, Google Calendar events, and Google Chat spaces and messages, using a single tool.
The Universal Search MCP Server provides a standardized way for AI agents to search for information across your entire Google Workspace account without needing to call individual product-specific tools.
Prerequisites
Membership in the Google Workspace Developer Preview Program.
A Google Cloud project. You can create or select a project during Quick setup for personal use, or see Create a project.
An MCP client, like Google Antigravity.
To run the
gcloudcommands for manual setup on this page, set up the gcloud CLI in one of the following development environments:Cloud Shell
To use an online terminal with the gcloud CLI already set up, activate Cloud Shell:
Local shell
To use a local development environment, follow these steps:
- Install the Google Cloud CLI.
If you installed the gcloud CLI previously, make sure you have the
latest version by running
gcloud components update. - If you're using an external identity provider (IdP), sign in to the gcloud CLI with your federated identity. For more information, see Sign in to the gcloud CLI with your federated identity.
- Initialize the gcloud CLI.
- Install the Google Cloud CLI.
If you installed the gcloud CLI previously, make sure you have the
latest version by running
Configure the Universal Search MCP Server
To use the Universal Search MCP Server, set up a Google Cloud project with an AI-agent OAuth 2.0 client and configure your MCP client to connect to it:
- Personal use: If you're connecting an MCP client for your own Google Account, use Quick setup for personal use to configure a project, enable the APIs and MCP services, and create an OAuth client on a single page.
- Multi-user or custom setup: If multiple users will sign in with your OAuth client, or if you want to enable only specific APIs and OAuth scopes, start at Enable the APIs.
Quick setup for personal use
Use Personal mode onboarding in the Google Cloud console to create an OAuth 2.0 client that works only for your Google Account and doesn't require app verification or separate OAuth consent screen setup:
Open Personal mode onboarding in the Google Cloud console. The button pre-selects a Web application client, which Google Antigravity and Claude require:
If your MCP client uses a desktop or mobile OAuth flow instead of a web redirect URI, open personal mode setup for a Desktop app, Android, or iOS client, or change Application type on the page.
In Select Project, select an existing personal-mode project or click Create a new project. If prompted, complete the project creation form.
If your organization administrator doesn't allow users to create new projects, you might encounter the error
You do not have the required "resourcemanager.projects.create" permission to create projects in this location.Select an existing Google Cloud project, or ask your administrator to allow project creation or grant you the Project Creator role,roles/resourcemanager.projectCreator. For details, see Create a project and Permission error messages in the Google Cloud documentation.Configure your OAuth client details:
- Enter a Name for the client.
- If Application type is Web application, in Authorized
redirect URIs, click + Add URI and add your MCP client's callback
URI:
- For Antigravity:
https://antigravity.google/oauth-callback - For Claude:
https://claude.ai/api/mcp/auth_callback
- For Antigravity:
- Verify that Use this client for an AI-powered agent is selected.
Review the Google API Services User Data Policy, select I agree to the Google API Services: User Data Policy., and click Continue.
The console enables core Google Workspace APIs and MCP services in your project and creates your OAuth client.
Copy your Client ID and Client Secret, and then connect your client to the MCP server, skipping step 1 since you already have your OAuth client ID and secret.
Enable the APIs
Skip this step if you used Quick setup for personal use.
To use the Universal Search MCP Server, enable the Google Workspace MCP API in your Google Cloud project:
CLI
gcloud services enable workspacemcp.googleapis.com \
--project=PROJECT_ID
Replace PROJECT_ID with your Google Cloud project ID.
Console
Enable the APIs in the Google Cloud console:
Set up the OAuth consent screen
Skip this step if you used Quick setup for personal use.
The Universal Search MCP Server uses OAuth 2.0 for authentication and authorization. You must configure the OAuth consent screen before you can create an OAuth client ID.
If you have already configured the OAuth consent screen for other MCP servers, ensure you have added the required scopes for the Universal Search MCP Server.
When you authenticate with the Universal Search MCP Server, you can choose to authenticate all requested scopes or only a subset of them. The server respects these choices and only searches across the products for which access has been granted.
For example, if you authenticate with all of the following scopes:
https://www.googleapis.com/auth/gmail.readonlyhttps://www.googleapis.com/auth/drive.readonlyhttps://www.googleapis.com/auth/calendar.readonlyhttps://www.googleapis.com/auth/chat.messages.readonlyhttps://www.googleapis.com/auth/chat.spaces.readonlyhttps://www.googleapis.com/auth/chat.memberships.readonly
Universal Search MCP Server will search across Gmail, Google Drive, Google Calendar, and Google Chat.
However, if you omit https://www.googleapis.com/auth/gmail.readonly and only
grant access to https://www.googleapis.com/auth/drive.readonly,
https://www.googleapis.com/auth/calendar.readonly,
https://www.googleapis.com/auth/chat.messages.readonly,
https://www.googleapis.com/auth/chat.spaces.readonly, and
https://www.googleapis.com/auth/chat.memberships.readonly, universal search
only returns results from Google Drive, Google Calendar, and Google Chat.
It doesn't search your email or return Gmail results.
- In the Google Cloud console, go to Google Auth Platform > Data Access.
- Click Add or Remove Scopes.
Add one or more of the following scopes:
https://www.googleapis.com/auth/gmail.readonlyhttps://www.googleapis.com/auth/drive.readonlyhttps://www.googleapis.com/auth/calendar.readonlyhttps://www.googleapis.com/auth/chat.messages.readonlyhttps://www.googleapis.com/auth/chat.spaces.readonlyhttps://www.googleapis.com/auth/chat.memberships.readonly
Include
https://www.googleapis.com/auth/chat.spaces.readonlyandhttps://www.googleapis.com/auth/chat.memberships.readonlyso the server can tell who is in each Google Chat conversation. Without them, Google Chat results are treated as externally shared and might require user confirmation or be filtered out.Click Update and then Save.
For detailed instructions on setting up the consent screen, see Configure the Google Workspace MCP servers.
Configure your MCP client
To add the Universal Search MCP Server to your MCP client, follow the instructions for your client.
User-delegated OAuth 2.0 client IDs that call the Universal Search MCP Server must have Use this client for an AI-powered agent selected in Google Auth Platform > Clients. To update an existing OAuth 2.0 client ID, select this setting in Google Auth Platform > Clients, as described in Manage OAuth Clients. If you can't change this setting on an existing client, or if the client also supports non-agent features, create a new OAuth 2.0 client ID for your AI agent. For rejected requests, service accounts with domain-wide delegation, or Google Apps Script, see Troubleshooting.
Antigravity
To add the Universal Search MCP Server to Antigravity,
add the server configuration to your mcp_config.json file. These
instructions support Antigravity 2.0, Antigravity IDE, and Antigravity CLI.
If you didn't already create an OAuth client in Quick setup for personal use, create an OAuth 2.0 client ID and secret of type Web application. In the Authorized redirect URIs section, click + Add URI, and then add
https://antigravity.google/oauth-callbackin the URIs field. Select Use this client for an AI-powered agent. For instructions, see Configure the Google Workspace MCP servers.Open or create the configuration file
~/.gemini/config/mcp_config.json.Add the
workspace-universalconfiguration tomcp_config.json:{ "mcpServers": { "workspace-universal": { "serverUrl": "https://workspacemcp.googleapis.com/mcp/v1", "oauth": { "clientId": "OAUTH_CLIENT_ID", "clientSecret": "OAUTH_CLIENT_SECRET" } } } }Replace the following:
OAUTH_CLIENT_ID: The client ID you created.OAUTH_CLIENT_SECRET: The client secret you created.
Save
mcp_config.json.Authenticate the MCP server. You can authenticate using either the GUI settings or the CLI:
For Antigravity IDE or GUI (Antigravity 2.0):
- Open your settings screen (e.g., click Settings at the bottom-left or open Antigravity User Settings).
- Navigate to Customizations.
- Under Installed MCP Servers, click Refresh.
- Find
workspace-universalin the list, 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 Antigravity CLI:
agyOpen the interactive MCP management panel by running:
/mcpUse the arrow keys to select
workspace-universal, move to the Authenticate action, and press Enter. Complete the sign-in flow in your browser, copy the authorization code, paste it into the terminal prompt, and press Enter.
Verify that the server is correctly configured and running:
- For Antigravity IDE or GUI: A Sign out button is displayed
next to
workspace-universalunder Customizations > Installed MCP Servers. - For Antigravity CLI: Open the
/mcppanel to view your configured MCP servers. Verified and authenticated servers display Authed next to their names inside the interactive TUI panel. You can select theworkspace-universalserver under the dashboard view to inspect its status and list all of its available tools.
- For Antigravity IDE or GUI: A Sign out button is displayed
next to
Claude
To add the Universal Search MCP Server to Claude, configure a custom connector.
If you didn't already create an OAuth client in Quick setup for personal use, create an OAuth 2.0 client ID and secret of type Web application, and select Use this client for an AI-powered agent. For instructions, see Configure the Google Workspace MCP servers.
In Claude settings, add a custom connector:
- Server name:
Universal Search MCP Server - Remote MCP server URL:
https://workspacemcp.googleapis.com/mcp/v1 - OAuth client ID and OAuth client secret: Enter your credentials.
- Scopes: Include
https://www.googleapis.com/auth/gmail.readonly,https://www.googleapis.com/auth/drive.readonly,https://www.googleapis.com/auth/calendar.readonly,https://www.googleapis.com/auth/chat.messages.readonly,https://www.googleapis.com/auth/chat.spaces.readonly, andhttps://www.googleapis.com/auth/chat.memberships.readonly.
- Server name:
Test the Universal Search MCP Server
Try asking your MCP client questions that require searching across different products:
- "Find anything related to Project X across my email, docs, and chat messages."
- "When is my next meeting about the marketing plan, and what are the latest notes and chat messages on it?"
If the tools execute successfully and you receive relevant responses from multiple products, your Universal Search MCP Server is correctly configured.
Supported tools
The Universal Search MCP Server offers the following tool. For input and output schemas, see the Universal Search MCP reference.
search_corpus: Searches across multiple Google Workspace products, including Drive, Gmail, Calendar, and Chat, based on the provided query.
Handle user approvals with form elicitation
Google Workspace MCP servers use server-driven human-in-the-loop approvals through MCP form elicitation to protect user data before an AI agent performs sensitive actions, such as sending emails, modifying shared calendar events, updating or trashing files, or accessing shared data.
Choose the endpoint that matches your MCP host's capabilities:
/mcp/v1: Recommended primary endpoint for MCP hosts and clients that support form elicitation. Exposes all tools and full result sets for each server. Keep your MCP host's own permission rules and governance policies active. To reduce duplicate prompts, you can optionally adjust your host's generic local confirmation prompts for/mcp/v1servers. For details, see Coordinate local prompts on/mcp/v1./mcp/v1self: Fallback endpoint for MCP hosts that don't support form elicitation, such ashttps://gmailmcp.googleapis.com/mcp/v1self. Exposes only tools and results that work without form elicitation under default policy, although specific calls might still require approval depending on policy and target resources. The People API and Google Classroom MCP servers don't use form elicitation or provide/mcp/v1self.
For endpoint details, approval UI recommendations, and client implementation steps, see Handle user approvals with form elicitation.
Administrator controls and governance
Google Workspace administrators can apply controls and governance to AI agents that connect to Google Workspace MCP servers or the Google Workspace command-line interface, including OAuth app access settings, user review policies for external agents, agent attribution, data loss prevention, and audit logging. Server-side user approvals work alongside Google Workspace administrator policies and your agent platform's own permissions and restrictions. A user approval never overrides an administrator or platform policy block. For details, see Manage AI agent access & user review in Google Workspace Admin Help, Administrator user review policies, and How policies and user approvals work together.