Google Workspace MCP servers in Antigravity

1. Introduction

In this codelab, you will learn how to use the Model Context Protocol (MCP) to connect Antigravity to your Google Workspace data. MCP is an open standard that enables AI models to securely use tools provided by remote servers. You will set up Antigravity to interact with Gmail, Google Drive, Google Calendar, Google Chat, and the People API without writing any code!

Google Workspace MCP Architecture

What you'll do

  • Enable Google Workspace MCP services in your Google Cloud project.
  • Configure Antigravity to access these MCP services.
  • Test the integration with fun and useful prompts that interact with your Google Workspace data.

What you'll need

  • A web browser such as Chrome
  • A Google Cloud project
  • A Google Workspace account
  • Antigravity installed on your local machine

Easy access to this codelab

qr_code.png

2. Before you begin

Create or Select a Google Cloud project

In the Google Cloud Console, select or create a Google Cloud project.

Enable the APIs

To use the Google Workspace MCP servers, you must enable the standard Google Workspace APIs. While some MCP servers operate independently, others still require the underlying standard API to be enabled:

  • Gmail and Chat still require their standard APIs.
  • Drive requires the standard API for certain tools.
  • Calendar does not require the standard API to be enabled.
  • The People API handles both standard access and MCP functionality, so it does not have a separate MCP service to enable.

Enable MCP Services

Next, enable the dedicated MCP services for the products.

Configure the Chat App

To use the Google Chat MCP server, you must configure a Chat app in your Google Cloud project.

  1. In the Google Cloud console, search for Google Chat API, and click Google Chat API > Manage > Configuration.

  1. Set up the Chat app:
    • In App name field, enter Chat MCP.
    • In Avatar URL field, enter https://developers.google.com/chat/images/quickstart-app-avatar.png.
    • In Description, enter Chat MCP server.
    • Under Functionality, turn off Enable interactive features.
    • Under Logs, select Log errors to Logging.
  2. Click Save.

chat_app.png

3. Configure OAuth Consent and Client

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

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

  1. In the Google Cloud console, go to Google Auth Platform > Branding. Click Get Started if not configured.
  2. Configure App Information:
    • App name: Google Workspace MCP Servers
    • User support email: Select your email.
  3. Configure Audience: Select Internal (or External if Internal is not available).
  4. Configure Contact Information: Enter your email address.
  5. Review and agree to the User Data Policy, then click Create.
  6. If you selected External, go to Audience and add your email under Test users.
  7. Go to Data Access > Add or Remove Scopes. Under Manually add scopes, add the following for the servers you want to use:
    • Google Calendar: https://www.googleapis.com/auth/calendar.calendarlist.readonly, https://www.googleapis.com/auth/calendar.events.freebusy, https://www.googleapis.com/auth/calendar.events.readonly
    • Google Chat: https://www.googleapis.com/auth/chat.spaces.readonly, https://www.googleapis.com/auth/chat.memberships.readonly, https://www.googleapis.com/auth/chat.messages.readonly, https://www.googleapis.com/auth/chat.users.readstate.readonly
    • Google Drive: https://www.googleapis.com/auth/drive.readonly, https://www.googleapis.com/auth/drive.file
    • Gmail: https://www.googleapis.com/auth/gmail.readonly, https://www.googleapis.com/auth/gmail.compose
    • People API: https://www.googleapis.com/auth/directory.readonly, https://www.googleapis.com/auth/userinfo.profile, https://www.googleapis.com/auth/contacts.readonly
  8. Click Add to Table, then Update, and finally Save.

oauth_consent_screen.png

Create an OAuth Client ID

  1. Go to Google Auth Platform > Clients > Create Client.
  2. Select Web application as the application type.
  3. Name it Antigravity.
  4. Under Authorized redirect URIs, click + Add URI then enter https://antigravity.google/oauth-callback.
  5. Click Create and copy the Client ID and Client Secret. You will need these in the next step.

oauth_client.png

4. Configure Antigravity

Now let's configure Antigravity to use these endpoints. If you don't have Antigravity installed, follow the installation instructions on the Antigravity website.

Add custom MCP servers

  1. Open MCP Servers via the ... dropdown at the top of the editor's agent panel.

open_mcp_servers.png

  1. Click Manage MCP Servers then View raw config.

manage_mcp_servers.png

  1. Modify the newly opened file mcp_config.json with the following custom MCP server configuration. Before doing so, replace the <YOUR_CLIENT_ID> and <YOUR_CLIENT_SECRET> placeholders with the OAuth client ID and secret you created in the previous steps:
{
  "mcpServers": {
    "gws-calendar": {
      "serverUrl": "https://calendarmcp.googleapis.com/mcp/v1",
      "oauth": {
        "clientId": "<YOUR_CLIENT_ID>",
        "clientSecret": "<YOUR_CLIENT_SECRET>"
      }
    },
    "gws-chat": {
      "serverUrl": "https://chatmcp.googleapis.com/mcp/v1",
      "oauth": {
        "clientId": "<YOUR_CLIENT_ID>",
        "clientSecret": "<YOUR_CLIENT_SECRET>"
      }
    },
    "gws-drive": {
      "serverUrl": "https://drivemcp.googleapis.com/mcp/v1",
      "oauth": {
        "clientId": "<YOUR_CLIENT_ID>",
        "clientSecret": "<YOUR_CLIENT_SECRET>"
      }
    },
    "gws-gmail": {
      "serverUrl": "https://gmailmcp.googleapis.com/mcp/v1",
      "oauth": {
        "clientId": "<YOUR_CLIENT_ID>",
        "clientSecret": "<YOUR_CLIENT_SECRET>"
      }
    },
    "gws-people": {
      "serverUrl": "https://people.googleapis.com/mcp/v1",
      "oauth": {
        "clientId": "<YOUR_CLIENT_ID>",
        "clientSecret": "<YOUR_CLIENT_SECRET>"
      }
    }
  }
}

mcp_config.png

  1. Return to Manage MCP Servers then click Refresh.

configured_mcp_servers.png

Authenticate custom MCP servers

  1. Open Antigravity User Settings via the Editor-Specific settings menu dropdown at the top of the window.

open_user_settings.png

  1. Navigate to Customizations.

customizations.png

  1. For each server listed under INSTALLED MCP SERVERS:
    1. Click Authenticate.

installed_servers.png

  1. Go through the authentication flow in the new browser window that opens.
  2. Once complete, click Copy to Clipboard.

copy_auth_code.png

  1. Close the browser window.
  2. Paste the auth code you just copied in the text field that's displayed in Antigravity's settings.
  3. Click Submit.

mcp_servers_authenticated.png

5. Test tools

Now you can interact with your Google Workspace data using natural language. Here are some example prompts for each service.

Google Calendar

Try searching your schedule:

  • "What are my upcoming meetings this week?"
  • "Do I have any free time tomorrow afternoon?"

test_prompt.png

Google Chat

Try searching for messages:

  • "Look for messages containing ‘[KEYWORD]' in ‘[SPACE_NAME]'"

Google Drive

Try searching or reading files:

  • "Search for files on my Google Drive that contain ‘[KEYWORD]'."
  • "List the most recent documents I edited."
  • "Read the content of my ‘[FILE_NAME]' doc and summarize the main goals."

Gmail

Try searching or managing your emails:

  • "Summarize the last 5 emails I received."
  • "Draft an email to ‘[EMAIL_ADDRESS]' requesting an update on the ‘[PROJECT_NAME]' project."

People API

Try searching your profile or contacts:

  • "According to my Google profile, what is my name?"
  • "Find contact info for ‘[NAME]'."

Combining Multiple Services

The true power of MCP is realized when orchestrating tasks across multiple services. Try these prompts that demonstrate cross-service capabilities:

  • "Search for files in Drive related to ‘[PROJECT_NAME] milestone updates', summarize their content, find the email address for ‘[NAME]', and create a Gmail draft to them with the summary."

Explore More Tools

These are just a few examples of what you can do. To see the full list of tools available for each service and try them out, refer to the Supported Products section of the official documentation.

6. Clean up

To clean up your project without deleting it, you can disable the APIs and MCP services you enabled:

  1. In the Google Cloud Console, go to the API & Services Dashboard.
  2. Click on each of the Google Workspace and MCP APIs you enabled (e.g., Calendar MCP, Chat MCP) and click Disable API.

Delete the OAuth client credentials in the Google Auth Platform console if you no longer plan to use them.

7. Congratulations

Congratulations! You have successfully configured and tested the official Google Workspace MCP servers using Antigravity.

Reference docs