DEV Community

xbill for Google Developer Experts

Posted on • Originally published at xbill999.Medium on

MCP Configuration for Google Workspace with Antigravity CLI

This article covers the MCP setup and configuration for using Google Workspace and underlying Gemini LLM with Antigravity CLI to enhance and extend Workspace operations over MCP.

Didn’t you already do this?

Yes! The first version of the article was built out with Gemini CLI:

MCP Configuration for Google Workspace with Gemini CLI

This version revisits the complete setup with Antigravity CLI.

What is Google Workspace?

Google Workspace (formerly G Suite) is a cloud-based, subscription-driven productivity and collaboration suite developed by Google, designed for businesses, schools, and organizations. It bundles essential tools — like Gmail, Drive, Docs, Meet, and Calendar — using a custom domain, offering enhanced security, administrative controls, and shared cloud storage.

More details are here:

Google Workspace: Secure Online Productivity & Collaboration Tools

Google Workspace? Isn’t MCP overkill?

Native MCP support in Google Workspace opens up new use cases and flexibility with the entire Workspace suite.

As of the date writing this- Google Workspace MCP support is in Developer Preview. You can sign up for access to the Developer Preview here:

Google Workspace Developer Preview Program | Google for Developers

What is MCP?

Unless you have been living off grid without Internet- MCP is the new universal connector and next “Big Thing”.

More information is here:

What is Model Context Protocol (MCP)? A guide

Google MCP Strategy

Google has gone all-in for all the core Cloud services to provide connections over MCP. An overview is here:

Google Cloud MCP servers overview | Google Cloud Documentation

Antigravity CLI

Antigravity CLI is the follow-on successor to Gemini CLI- the terminal driven, agent assisted coding tool.

Full details on installing Antigravity CLI are here:

Getting Started with Antigravity CLI

Testing the Antigravity CLI Environment

Once you have all the tools in place- you can test the startup of Antigravity CLI.

You will need to authenticate with a Google Cloud Project or your Google Account:

agy
Enter fullscreen mode Exit fullscreen mode

This will start the interface:

Full Installation Instructions

The detailed installation instructions for Antigravity CLI are here:

Getting Started with Antigravity CLI

Google Skills Repository

Google Skills give your MCP client well known approaches to work with the core Google products.

The full details are here:

Level Up Your Agents: Announcing Google's Official Skills Repository | Google Cloud Blog

To install the Skills in Antigravity CLI:

npx skills install github.com/google/skills
Enter fullscreen mode Exit fullscreen mode

Developer Knowledge API

But — wait there is more! This setup is optional but it improves the quality of the Antigravity context:

Building with the Developer Knowledge API and Antigravity CLI

What you talkin ‘bout Willis?

That was a lot of setup! But wait- there is more! So what is different about this lab compared to all the others out there?

This demo is one of the first deep dives into configuring Workspace for MCP. Antigravity CLI provides a complete working environment with a full MCP client. Google Workspace exposes the key features of the platform over the MCP layer.

Where do I start?

The strategy for configuring Workspace with MCP is a incremental step by step approach.

First, the Workspace configuration settings are updated. Then, these settings are used to configure Antigravity CLI. Finally- Antigravity CLI is used as a MCP client to the Workspace environment. Several samples are run using the Workspace MCP Tools directly from Antigravity CLI.

Sample CodeLabs

Several Code Labs have been developed to step through Google Workspace MCP configuration. A sample is here:

Google Workspace MCP servers in Antigravity | Google Codelabs

Workspace Developer Tools

Developer Tools are provided to enable working with Google Workspace:

Google Workspace Developer Tools | Google for Developers

This has been pre-configured in the MCP config file:

        "workspace-developer": {
          "url": "https://workspace-developer.goog/mcp",
          "trust": true
        },
Enter fullscreen mode Exit fullscreen mode

MCP for Workspace Setup

MCP is available in the core Workspace setup. A getting started guide is available here:

Configure the Google Workspace MCP servers | Google for Developers

Setup the Basic Antigravity CLI Environment

At this point you should have a working Shell environment and a working Antigravity CLI installation. All of the relevant code examples and documentation is available in GitHub.

The next step is to clone the GitHub repository to your local environment:

cd ~
git clone https://github.com/xbill9/workspace-mcp-agy
cd workspace-mcp-agy
Enter fullscreen mode Exit fullscreen mode

Then run init.sh from the cloned directory.

The script will attempt to determine your shell environment and set the correct variables:

source init.sh
Enter fullscreen mode Exit fullscreen mode

If your session times out or you need to re-authenticate- you can run the set_env.sh script to reset your environment variables:

source set_env.sh
Enter fullscreen mode Exit fullscreen mode

Variables like PROJECT_ID need to be setup for use in the various build scripts- so the set_env script can be used to reset the environment if you time-out.

Oauth Configuration

The Google Workspace MCP servers use OAuth 2.0 for secure authentication. You must configure an OAuth consent screen and create a Desktop application client.

Set up the OAuth Consent Screen

The Google Workspace MCP servers use OAuth 2.0 for authentication. You must configure the consent screen first.

In the Google Cloud console, go to Google Auth Platform > Branding. Click Get Started if not configured.

Configure App Information:

  • App name: Google Workspace MCP Servers
  • User support email: Select your email.

Configure Audience: Select Internal (or External if Internal is not available):

Configure Contact Information: Enter your email address.

Review and agree to the User Data Policy, then click Create.

If you selected External, go to Audience and add your email under Test users.

Oauth Scopes

Go to Data Access > Add or Remove Scopes. Under Manually add scopes, add the following for the servers you want to use:

Create an OAuth Client ID

Go to Google Auth Platform > Clients > Create Client.

Select web application as the application type. Name it workspace :

Use the Antigravity CLI for the authorized domains:

NOTE : This setup differs from Gemini CLI

Click Create and copy the Client ID and Client Secret. You will need these in the next step. (the actual values have been hidden)

Antigravity CLI Settings

Here is the sample MCP .agents/mcp_config.json setup:

{
  "mcpServers": {
        "workspace-developer": {
          "url": "https://workspace-developer.goog/mcp",
          "trust": true
        },
    "gmail": {
      "serverUrl": "https://gmailmcp.googleapis.com/mcp/v1",
      "oauth": {
        "enabled": true,
        "clientId": "${CLIENT_ID}",
        "clientSecret": "${CLIENT_SECRET}",
        "scopes": [
          "https://www.googleapis.com/auth/gmail.readonly",
          "https://www.googleapis.com/auth/gmail.compose"
        ]
      }
    },
    "drive": {
      "serverUrl": "https://drivemcp.googleapis.com/mcp/v1",
      "oauth": {
        "enabled": true,
        "clientId": "${CLIENT_ID}",
        "clientSecret": "${CLIENT_SECRET}",
        "scopes": [
          "https://www.googleapis.com/auth/drive.readonly",
          "https://www.googleapis.com/auth/drive.file"
        ]
      }
    },
    "calendar": {
      "serverUrl": "https://calendarmcp.googleapis.com/mcp/v1",
      "oauth": {
        "enabled": true,
        "clientId": "${CLIENT_ID}",
        "clientSecret": "${CLIENT_SECRET}",
        "scopes": [
          "https://www.googleapis.com/auth/calendar.calendarlist.readonly",
          "https://www.googleapis.com/auth/calendar.events.freebusy",
          "https://www.googleapis.com/auth/calendar.events.readonly"
        ]
      }
    },
    "people": {
      "serverUrl": "https://people.googleapis.com/mcp/v1",
      "oauth": {
        "enabled": true,
        "clientId": "${CLIENT_ID}",
        "clientSecret": "${CLIENT_SECRET}",
        "scopes": [
          "https://www.googleapis.com/auth/directory.readonly",
          "https://www.googleapis.com/auth/userinfo.profile",
          "https://www.googleapis.com/auth/contacts.readonly"
        ]
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

More Antigravity Quirks

Antigravity CLI does not substitute shell variables. To get your mcp_config.json with the Oauth values- run a mass substitution or use agy cli to rewrite the file.

Initial Connection

Start up Antigravity CLI after all the environment variables have been set:

xbill@penguin:~/workspace-mcp$ agy

MCP Servers

Plugins (~/.gemini/antigravity-cli/plugins)
> ✓ calendar [Auth Needed] Tools: list_events, get_event, list_calendars, suggest_time, create_event, +3 more
   ✓ drive [Auth Needed] Tools: copy_file, create_file, download_file_content, get_file_metadata, get_file_permissions, +3
                           more
   ✓ gmail [Auth Needed] Tools: create_draft, list_drafts, get_thread, search_threads, label_thread, +7 more
   ✓ google-dev-knowledge Tools: search_documents, answer_query, get_documents
   ✓ people [Auth Needed] Tools: search_directory_people, search_contacts, get_user_profile
   ✓ workspace-developer Tools: search_workspace_docs, fetch_workspace_docs
Enter fullscreen mode Exit fullscreen mode

The OAuth server has not been explicitly enabled for gmail, drive, calendar, and people- so they show as not authenticated.

Oauth MCP Connection Settings

To simplify the Oauth setup — a prebuilt mcp_config.json has been provided for Antigravity CLI. The values for the Oauth client need to be set in the current test environment.

source save_oauth.sh
Enter fullscreen mode Exit fullscreen mode

The settings need to be enabled for each service. As an example — for Google Drive:

> /mcp
Enter fullscreen mode Exit fullscreen mode

then select drive, then authenticate:

Then go through the flow:

and paste the code.

Then it will return an error::

Authenticate MCP Server: drive

Authentication failed: no pending auth state for server drive
Enter fullscreen mode Exit fullscreen mode

You may see an authentication error depending on your client environment and agy cli version.

A brief discussion of the issue is here:

Known issues | Google Cloud MCP servers | Google Cloud Documentation

For agy 1.0.12 on Chrome OS— exit Antigravity CLI and restart.

The drive service will now be authenticated:

  ✓ drive [Authed] Tools: copy_file, create_file, download_file_content, get_file_metadata, get_file_permissions, +3 mo
Enter fullscreen mode Exit fullscreen mode

Repeat the OAuth permissions for each Workspace service.

Validate The Setup

Once the MCP OAuth authentication has been enabled for the Workspace services- you can check them with Antigravity CLI:

MCP Servers

Plugins (~/.gemini/antigravity-cli/plugins)
> ✓ calendar [Authed] Tools: list_events, get_event, list_calendars, suggest_time, create_event, +3 more
   ✓ drive [Authed] Tools: copy_file, create_file, download_file_content, get_file_metadata, get_file_permissions, +3 more
   ✓ gmail [Authed] Tools: create_draft, list_drafts, get_thread, search_threads, label_thread, +7 more
   ✓ google-dev-knowledge Tools: search_documents, answer_query, get_documents
   ✓ people [Authed] Tools: search_directory_people, search_contacts, get_user_profile

> list the mcp tools

  Here is the list of available Model Context Protocol (MCP) tools, grouped by their respective servers:

  ### 📅 calendar
  • list_events : Retrieve events from a calendar.
  • get_event : Get details for a specific event.
  • list_calendars : List the calendars in the user's account.
  • suggest_time : Suggest optimal times for events.
  • create_event : Create a new calendar event.
  • update_event : Update an existing event.
  • delete_event : Remove an event.
  • respond_to_event : RSVP or respond to a calendar invite.
  ──────
  ### 📂 drive

  • copy_file : Copy an existing file on Google Drive.
  • create_file : Create a new file in a Drive folder.
  • download_file_content : Download binary/raw file data.
  • get_file_metadata : Read metadata (name, owners, web links) of a file.
  • get_file_permissions : View permissions/access lists for a file.
  • list_recent_files : Retrieve recently updated files.
  • read_file_content : View text content of files (supports Docs, Sheets, etc.).
  • search_files : Search Drive using queries or filters.
  ──────
  ### 📧 gmail
  • create_draft : Draft a new email message.
  • list_drafts : List draft emails in the inbox.
  • get_thread : Retrieve a complete thread with messages and metadata.
  • search_threads : Search Gmail threads using filters/queries.
  • label_thread : Add labels to an entire thread.
  • unlabel_thread : Remove labels from a thread.
  • list_labels : Retrieve all custom and system labels.
  • label_message : Add labels to a specific message.
  • unlabel_message : Remove labels from a specific message.
  • create_label : Create a new custom folder/label.
  • update_label : Modify an existing label.
  • delete_label : Permanently delete a label.
  ──────
  ### 👥 people

  • search_directory_people : Search domain/directory profiles.
  • search_contacts : Search personal contacts.
  • get_user_profile : Retrieve detailed profile fields for specific users.

Enter fullscreen mode Exit fullscreen mode

All Right Already! Can you actually do something with Workspace?

At this point- Antigravity CLI is setup with the Workspace MCP server and has direct access to all the MCP Tools. Any operations with the Tools come back directly into the Antigravity CLI Context.

Calendar

> what non confidential meetings do I have tomorrow?

  Excluding the confidential sync, you have the following events scheduled for tomorrow, Friday, June 26, 2026:

  ### 1. 👥 All Staff Morning Meeting

  • Time: 9:30 AM – 10:30 AM EDT
  • Location: Zoom Meeting (Join Link https://zoom.us/j/93042103347?pwd=20b4KM2fhXZa8DSxfBKpdxLrITiehV.1)
  • Organizer: Adam Lowler
  • Your Status: RSVP is pending (Needs Action)

  ### 2. 🎮 TooManyGames 2026 (Multi-day Event)

  • Time: Starts tomorrow at 2:00 PM EDT (Runs through Sunday, June 28, 5:00 PM EDT)
  • Location: Greater Philadelphia Expo Center at Oaks, Oaks, PA
  • Your Status: Accepted (Created from Gmail, marked as Free time)
Enter fullscreen mode Exit fullscreen mode

Gmail

> list my last 5 spam message headers that reference fake payments

18.8k in | 3.1k out | 635 thinking
● Bash(python3 /home/xbill/workspace-mcp-agy/fetch_fake_payments.py) (ctrl+o to expand)

  Here are your last 5 spam message headers referencing fake payments, invoices, transactions, subscriptions, or bills.
  They were retrieved and filtered locally from your last 500 spam messages:

   # | From | Subject | Date (UTC) | Message ID
  ---|---------------------------------|----------------------------------|-------------------------|--------------------
   1 | Andrew Wilson | Invoice Digital Wallet = Review | June 25, 2026, 19:25:43 | 19f003f9bcaeefd2 
     | <delivery@invoicely.com> | Recent Wallet Transaction from | |
     | | Andrew Wilson | |
   2 | Bianca T. Webb | Your Payment Receipt is Now | June 24, 2026, 15:29:35 | 19efa40735e23ca0 
     | <marouan.abbou@cirvianum.cat> | Available | |
   3 | F. Smith Johnson | Order acknowledgement | June 23, 2026, 14:52:55 | 19ef4f85c2e2fe13 
     | <merriwphoi@gmail.com> | DFN9O~4YF6XOE~T0K_3NCYNTI | |
   4 | Account Security | Bill Gates backs natural memory | June 19, 2026, 18:39:44 | 19ee12e8ef78e562 
     | <support@didar.me> | treatment that could end the | |
     | | Alzheimer's crisis | |
   5 | Capacity Alert | Your 250GB Cloud Storage | June 14, 2026, 16:55:27 | 19ec70f4971139f2 
     | <support@menshealth.de> | Subscription Has Expired | |

Enter fullscreen mode Exit fullscreen mode

Drive

create a new google drive file with the latest info on antigravity cli

 ### Google Drive File Details

  • Title: Antigravity CLI Guide 
  • File ID: 1NS6TTT2HbFqEuzZMLb70ofMqbBTVUBL6fyFQr8gLEAM 
  • Link: Antigravity CLI Guide on Google Docs https://docs.google.
  com/document/d/1NS6TTT2HbFqEuzZMLb70ofMqbBTVUBL6fyFQr8gLEAM/edit?usp=drivesdk&ouid=109596250650303916595

  The created document covers:

  • Core overview and lightweight Terminal User Interface (TUI) capabilities.
  • A platform comparison matrix comparing the CLI ( agy ) vs. Antigravity 2.0.
  • Native installation scripts for macOS, Linux, and Windows.
  • Authentication workflows including local keyrings and remote SSH URL loops.
  • Workspace rules and configuration specifications ( AGENTS.md ).
  • A quickstart step-by-step tutorial.
Enter fullscreen mode Exit fullscreen mode

People

> search my contacts for Lenovo

43.8k in | 438 out | 318 thinking
● people/search_contacts(Search contacts) (ctrl+o to expand)

  I found the following contact matching Lenovo:

  • Name/Email: Lenovo@enews.lenovo.com ( Lenovo@enews.lenovo.com )

  Please let me know if this is the contact you were looking for or if you would like me to perform any further actions!
Enter fullscreen mode Exit fullscreen mode

Final Review

As a final step — Antigravity CLI was used for a full review of the project:

> what does this project do?
  This project is a management and authorization workspace for Google Cloud Platform (GCP) hosted Model Context Protocol
  (MCP) servers.

  It serves as the bridge that allows AI client tools (like Cursor, Claude Code, or the Gemini CLI) to securely access
  and interact with your personal or enterprise Google Workspace APIs (Gmail, Google Drive, Google Calendar, People, and
  Chat).

  Here is a breakdown of what the repository specifically manages and automates:

  ### 1. GCP API Enablement
  It automates the process of enabling both the core Google Workspace APIs and their corresponding MCP wrapper APIs in
  your GCP project:

  • Core APIs: Gmail, Drive, Calendar, People, and Chat APIs.
  • MCP Wrappers: gmailmcp , drivemcp , calendarmcp , and chatmcp services that translate standard GCP requests into
  the Model Context Protocol format.

  ### 2. Environment Management

  It sets up and maintains a local .env configuration mapping Vertex AI parameters (Project ID, Region/Location, and
  default models like gemini-2.5-flash ).

  ### 3. Authentication & Application Default Credentials (ADC)

  It configures local authentication:

  • Ensures standard gcloud login is active.
  • Sets up and refreshes Application Default Credentials (ADC) so your local development tools have the necessary
  authorized tokens to call Vertex AI or GCP endpoints.

  ### 4. Secure OAuth Scoping

  It provides automated utilities to safely prompt, capture, and cache your custom Google OAuth Client IDs and Client
  Secrets locally (storing them in your ~/ home directory instead of committing them to public git repositories) so
  that your workspace remains secure-tokens remain safe.

  ### 5. MCP Server Registration Guidance

  It prints and assists with the CLI configurations to quickly spin up, authenticate, and register the individual
  Workspace MCP servers (e.g., executing /mcp auth <service> and listing active tool validation).

Enter fullscreen mode Exit fullscreen mode

Summary

Antigravity CLI was configured as a MCP client using the MCP Server for Google Workspace. Then, the MCP connection was used to connect to the Workspace Environment and test basic operations. Finally, Antigravity CLI was used for a complete project review.

Top comments (0)