Google Sheets offers a remote Model Context Protocol (MCP) server that allows AI agents to securely interact with Google Sheets data. By configuring the Google Sheets MCP server, you enable AI applications like Google Antigravity and Claude to perform actions in Google Sheets.
The Google Sheets MCP server provides a standardized way for AI agents to:
- Read data: Retrieve cell values, sheet names, grid properties, and other spreadsheet metadata.
- Take action: Update cell values, set formulas, insert rows/columns, and execute spreadsheet structural batch updates.
- Respect security: Inherit the same permissions and data governance controls as the user.
Prerequisites
A Google Cloud project. To create a project, see Create a project.
An MCP client, like Google Antigravity.
To run the commands 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 Google Sheets MCP server
To use the Google Sheets MCP server, you must enable it in your Google Cloud project and then configure your MCP client to connect to it.
Enable the APIs
To use the Google Sheets MCP server, you must enable the following API in your Google Cloud project:
Google Sheets API
CLI
gcloud services enable sheets.googleapis.com --project=PROJECT_ID
Replace PROJECT_ID
with your Google Cloud project ID.
Console
Enable the APIs in the Google Cloud console:
Enable the MCP services
To enable the MCP components for Google Sheets, you must enable the following service in your Google Cloud project:
Google Sheets MCP API
CLI
gcloud services enable sheetsmcp.googleapis.com --project=PROJECT_ID
Replace PROJECT_ID
with your Google Cloud project ID.
Console
Enable the MCP services in the Google Cloud console:
Set up the OAuth consent screen
The Google Sheets 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.
In the Google Cloud console, go to Google Auth Platform > Branding.
If you have already configured the Google Auth Platform, you can configure the following OAuth Consent Screen settings in Branding, Audience, and Data Access. If you see a message that says Google Auth Platform not configured yet, click Get Started:
- Under App Information, in App name, type
Sheets MCP Server. - In User support email, select your email address or an appropriate Google group.
- Click Next.
- Under Audience, select Internal. If you can't select Internal, select External.
- Click Next.
- Under Contact Information, enter an Email address where you can be notified about any changes to your project.
- Click Next.
- Under Finish, review the Google API Services User Data Policy and if you agree, select I agree to the Google API Services: User Data Policy.
- Click Continue.
- Click Create.
- If you selected External for user type, add test users:
- Click Audience.
- Under Test users, click Add users.
- Enter your email address and any other authorized test users, then click Save.
- Under App Information, in App name, type
Click Data Access > Add or Remove Scopes. A panel appears with a list of scopes for each API that you've enabled in your Google Cloud project.
Under Manually add scopes, paste the scopes for the Google Sheets MCP server:
https://www.googleapis.com/auth/drive.readonlyhttps://www.googleapis.com/auth/spreadsheets.readonly
Click Add to Table.
Click Update.
After selecting the scopes required by your app, on the Data Access page, click Save.
Configure your MCP client
To add the Google Sheets remote MCP server to your MCP client, follow the instructions for your client.
Antigravity
To add the Google Sheets remote 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.
Create an OAuth 2.0 client ID and secret:
In the Google Cloud console, go to Google Auth Platform > Clients > Create Client
Select Web application as the application type.
Enter a Name.
In the Authorized redirect URIs section, click + Add URI, and then add
https://antigravity.google/oauth-callbackin the URIs field.Click Create and copy your Client ID and Client Secret.
Open or create the configuration file
~/.gemini/antigravity/mcp_config.json.Add the
mcpServersconfiguration tomcp_config.json:{ "mcpServers": { "sheets": { "serverUrl": "https://sheetsmcp.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
sheetsin 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
sheets, 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 the server under 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 any server under the dashboard view to inspect its status and list all of its available tools.
The remote MCP server is ready to use in Antigravity.
Claude
To use the Google Sheets remote MCP server with Claude.ai or Claude Desktop, you must have the Claude Enterprise, Pro, Max, or Team plan.
To add the Google Sheets remote MCP server to Claude, configure a custom connector with an OAuth client ID and secret.
Create an OAuth 2.0 client ID and secret:
In the Google Cloud console, go to Google Auth Platform > Clients > Create Client
Select Web application as the application type.
Enter a Name.
In the Authorized redirect URIs section, click + Add URI, and then add
https://claude.ai/api/mcp/auth_callbackin the URIs field.Click Create and copy your Client ID and Client Secret.
Configure the MCP server in Claude:
- In Claude.ai or Claude Desktop, go to Settings (or Admin settings) > Connectors.
- Click Add custom connector.
- Enter the connection details for the Google Sheets product:
- Server name:
Google Sheets. - Remote MCP server URL:
https://sheetsmcp.googleapis.com/mcp/v1
- Server name:
- In Advanced settings, enter your OAuth client ID and OAuth client secret.
- Click Add.
Others
Many AI applications have ways to connect to a remote MCP server. You typically need to enter details about the server, like its name, endpoints, transport protocol, and authentication method. For the Google Sheets remote MCP server, enter the following:
Server name:
sheetsServer URL:
https://sheetsmcp.googleapis.com/mcp/v1Transport: HTTP
Authentication: The Google Sheets remote MCP server uses OAuth 2.0. For details, see Learn about authentication and authorization.
For more details on connecting different types of clients, see Configure MCP in an AI application.
Test the Google Sheets MCP server
After you configure the MCP client, you can verify the connection by running some test prompts.
Try asking your MCP client the following questions:
"Read sheet Sheet1 from Google Sheet
abcd123."The client fetches grid values using
sheets.get_values."Insert a column at column index 2 in Google Sheet
abcd123."The client performs
sheets.insert_dimensionto mutate columns.
If the tools execute successfully and you receive relevant responses, your Google Sheets MCP server is correctly configured.
Troubleshooting
If you encounter issues connecting to the MCP server, you can check for errors in the OAuth logs. Ask your administrator to check the OAuth log events in the security investigation tool.
Tool reference
The following tools are available for the Google Sheets MCP server:
get_valuesget_spreadsheetupdate_spreadsheetupdate_valuesupdate_formulasinsert_dimension
Important security consideration: Indirect prompt injection
When you expose a language model to untrusted data, there is a risk of an indirect prompt injection attack. Because MCP clients like Google Antigravity have access to powerful tools and APIs through the Google Sheets MCP server, they can read, modify, and delete data in your Google Account.
To mitigate these risks, follow these best practices:
- Only use trusted tools. Never connect Google Sheets MCP server to untrusted or unverified applications.
- Be cautious with untrusted inputs. Avoid asking your MCP client to process spreadsheets or other resources from unverified sources. These inputs may contain hidden instructions that can hijack your session, allowing an attacker to modify, steal, or delete your data.
- Review all actions. Always carefully review the actions taken by your AI client on your behalf to ensure they are correct and align with your intentions.
Related topics
- Google Workspace MCP servers in Antigravity (codelab)
- Configure the Docs MCP server
- Configure the Gmail MCP server
- Configure the Calendar MCP server
- Configure the Drive MCP server
- Configure the Slides MCP server
- Configure the People API MCP server